<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Vllm on moyutianzun's blog</title><link>https://moyutianzun.cn/en/categories/vllm/</link><description>Recent content in Vllm on moyutianzun's blog</description><generator>Hugo</generator><language>en</language><copyright>moyutianzun</copyright><lastBuildDate>Fri, 26 Sep 2025 09:10:35 +0800</lastBuildDate><atom:link href="https://moyutianzun.cn/en/categories/vllm/index.xml" rel="self" type="application/rss+xml"/><item><title>vllm v1 源码解析 —— 单机八卡推理</title><link>https://moyutianzun.cn/en/blog/vllm-v1-yuan-ma-jie-xi------dan-ji-ba-qia/</link><pubDate>Fri, 26 Sep 2025 09:10:35 +0800</pubDate><guid>https://moyutianzun.cn/en/blog/vllm-v1-yuan-ma-jie-xi------dan-ji-ba-qia/</guid><description>&lt;p style=""&gt;单机八卡，我们按照PP + TP的方式来进行方案说明，使用的是vllm框架，主要命令和函数如下：&lt;/p&gt;&lt;pre&gt;&lt;code&gt;python single_node_multi_gpu_demo.py --mode pipeline_parallel --tensor-parallel 4 --pipeline-parallel 2 --model facebook/opt-13b
&lt;p&gt;def pipeline_parallel_inference(self, model_name: str, tensor_parallel_size: int, pipeline_parallel_size: int):
&amp;ldquo;&amp;ldquo;&amp;ldquo;流水线并行推理 - 将模型层分布到多个GPU上&amp;rdquo;&amp;rdquo;&amp;rdquo;
print(f&amp;quot;🚀 启动流水线并行推理 - 模型: {model_name}&amp;quot;)
print(f&amp;quot; 张量并行: {tensor_parallel_size}, 流水线并行: {pipeline_parallel_size}&amp;quot;)&lt;/p&gt;</description></item><item><title>vllm v1 源码解析 —— Core</title><link>https://moyutianzun.cn/en/blog/vllm-v1-yuan-ma-jie-xi------core/</link><pubDate>Tue, 23 Sep 2025 03:56:10 +0800</pubDate><guid>https://moyutianzun.cn/en/blog/vllm-v1-yuan-ma-jie-xi------core/</guid><description>&lt;p style=""&gt;一个client建立之后就会建立一个core engine，这些配置会通过QMZ IPC发送给core engine。&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h1 style="" id="core-engine-architecture"&gt;Core engine Architecture&lt;/h1&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h2 style="" id="worker-and-executor"&gt;Worker and Executor&lt;/h2&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h2 style="" id="multiprocexecutor"&gt;MultiprocExecutor&lt;/h2&gt;&lt;p style=""&gt;在MultiprocExecutor类中，可以清晰的找到三部曲：&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;1、创建RPC消息队列&lt;/p&gt;&lt;pre&gt;&lt;code class="language-python"&gt;# Initialize worker and set up message queues for SchedulerOutputs
# and ModelRunnerOutputs
max_chunk_bytes = envs.VLLM_MQ_MAX_CHUNK_BYTES_MB * 1024 * 1024
self.rpc_broadcast_mq = MessageQueue(self.world_size,
self.world_size,
max_chunk_bytes=max_chunk_bytes)
scheduler_output_handle = self.rpc_broadcast_mq.export_handle()&lt;/code&gt;&lt;/pre&gt;&lt;p style=""&gt;&lt;/p&gt;</description></item></channel></rss>