Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: "Diffusion parallel transport 配置规则"
created: 2026-09-05
updated: 2026-09-05
updated: 2026-11-27
type: rule
tags: [vllm-omni, components, config, diffusion]
sources: ["PR #6340", vllm_omni/config/stage_config.py, vllm_omni/config/omni_config.py, vllm_omni/engine/async_omni_engine.py, vllm_omni/engine/arg_utils.py, vllm_omni/entrypoints/cli/serve.py, tests/config/test_omni_config.py, tests/entrypoints/test_async_omni_diffusion_config.py, tests/entrypoints/test_serve.py]
sources: ["PR #6340", "PR #11109", vllm_omni/config/stage_config.py, vllm_omni/config/omni_config.py, vllm_omni/engine/async_omni_engine.py, vllm_omni/engine/arg_utils.py, vllm_omni/entrypoints/cli/serve.py, tests/config/test_omni_config.py, tests/entrypoints/test_async_omni_diffusion_config.py, tests/entrypoints/test_serve.py]
confidence: high
---

# Diffusion parallel transport 配置规则

## VOMNI-CFG-1q — SymmMem Ulysses transport 开关必须完整投影且默认关闭
## VOMNI-CFG-1q SymmMem Ulysses transport 必须按版本完整投影

- 触发:新增/修改 diffusion 并行 transport flag、`StageDeployConfig`、`OmniStageDiffusionParallelConfig`、default diffusion stage 或 `serve` CLI。
- 强制:`ulysses_a2a_permute` 在 deploy、structured parallel config、legacy/default-stage construction 和 CLI 都以同一 bool 字段传递;省略时最终值为 false,显式 true 必须到达 strict-Ulysses consumer,不能由 `ulysses_degree` 或其他 SP mode 隐式开启。
- 禁止:只在 parser/dataclass 声明、在 default stage 或 deploy merge 丢失;以 truthiness 吞掉明确 false;把 `advanced_uaa`、Ring 或 AllGather 配置解释为已启用 SymmMem;将 JIT/capability failure 推迟到首个请求。
- 验收:覆盖 CLI true/false、deploy true、structured/default-stage true 与 omitted false,断言最终 `parallel_config`;再由 DIFF-4x 覆盖 eligible consumer init 与不合资格组合不走 fused path。^[PR #6340]
- 触发:新增/修改 diffusion 并行 transport、`StageDeployConfig`、`OmniStageDiffusionParallelConfig`、default diffusion stage 或 `serve` CLI。
- `v0.34.0` tag 仍使用 `--ulysses-a2a-permute` / `ulysses_a2a_permute` 布尔字段,省略为 false。旧 true 迁移为 `copy_engine`,要保留旧 false 的 transport 行为则显式选 `nccl`,不能直接省略。[tag CLI](https://github.com/vllm-project/vllm-omni/blob/06a28821a7f72bdb436c3df656b10f67fded0846/vllm_omni/entrypoints/cli/serve.py#L813) · [tag config](https://github.com/vllm-project/vllm-omni/blob/06a28821a7f72bdb436c3df656b10f67fded0846/vllm_omni/diffusion/data.py#L300)
- 从 [PR #11109](https://github.com/vllm-project/vllm-omni/pull/11109) 的 main 合入点起,CLI 参数换成 `--ulysses-a2a-backend {auto,nccl,copy_engine}`,deploy/structured/legacy default-stage 配置使用 `ulysses_a2a_backend`。CLI 未提供时保留 unset,让 deploy 的选择生效;运行时确实省略时才默认 `auto`。不要把旧布尔字段当兼容别名,也不要把内部策略仍使用的布尔变量当公开参数。[新 CLI](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/entrypoints/cli/serve.py#L822) · [新 config](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/diffusion/data.py#L325)
- 验收:分别验证相应版本的 CLI、deploy、structured/default-stage 和最终 `parallel_config`;新版本区分显式 `nccl`、显式 `copy_engine` 与 unset,确保未指定的 CLI 不覆盖 deploy。transport 解析、硬件拓扑和生命周期见 [DIFF-4x](../diffusion/rules-system-runtime.md#diff-4x-symmmem-ulysses-a2a-transport-与-workspace-生命周期)。
11 changes: 5 additions & 6 deletions knowledge/repos/vllm-omni/components/diffusion/parallelism.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Diffusion 并行策略总览"
created: 2026-07-16
updated: 2026-09-05
updated: 2026-11-27
type: guide
tags: [vllm-omni, components, diffusion]
sources: [docs/design/feature/tensor_parallel.md, docs/design/feature/cfg_parallel.md, docs/design/feature/vae_parallel.md, "PR #6340", "PR #6786", vllm_omni/diffusion/distributed/a2a_permute.py, vllm_omni/diffusion/distributed/cfg_parallel.py, vllm_omni/diffusion/attention/parallel/ulysses.py]
sources: [docs/design/feature/tensor_parallel.md, docs/design/feature/cfg_parallel.md, docs/design/feature/vae_parallel.md, "PR #6340", "PR #6786", "PR #11109", vllm_omni/diffusion/distributed/a2a_permute.py, vllm_omni/diffusion/distributed/cfg_parallel.py, vllm_omni/diffusion/attention/parallel/ulysses.py]
---

# Diffusion 并行策略总览
Expand All @@ -22,10 +22,9 @@ sources: [docs/design/feature/tensor_parallel.md, docs/design/feature/cfg_parall
(tp/dp/pp/ep/stage_replica 已接线;sp/cfg/vae_pp/hsdp 为保留位)见
[Configuration](../configuration/architecture.md);stage 级 `tensor_parallel_size` 等
字段见 deploy schema。
- strict Ulysses 可显式设置 `ulysses_a2a_permute=true` 使用 SymmMem permute-free A2A;它默认关闭,
advanced-UAA 与 AllGather 不走该 path;strict Ulysses+Ring 的 Ulysses leg 可用。workspace/capture/shutdown 与硬件 parity 门禁见
[DIFF-4x](rules-system-runtime.md#diff-4x-symmmem-ulysses-a2a-只能显式启用并保持-workspace-生命周期闭合),
配置投影见 [VOMNI-CFG-1q](../configuration/rules-diffusion-parallel-transport.md#vomni-cfg-1q-symmmem-ulysses-transport-开关必须完整投影且默认关闭)。^[PR #6340]
- strict Ulysses transport 以目标版本为准:`v0.34.0` tag 用旧布尔开关且默认关闭;[#11109](https://github.com/vllm-project/vllm-omni/pull/11109) 合入后,`ulysses_a2a_backend=auto` 仅在合资格的 CUDA strict pure Ulysses 路径自动选 CE;不满足选择条件就不启用 CE。显式 `copy_engine` 与 `nccl` 可用于固定实验的 transport;先确认模型、设备与执行模式支持,不以参数值推断实际 kernel。
选择约束和 workspace 生命周期见 [DIFF-4x](rules-system-runtime.md#diff-4x-symmmem-ulysses-a2a-transport-与-workspace-生命周期),
配置投影见 [VOMNI-CFG-1q](../configuration/rules-diffusion-parallel-transport.md#vomni-cfg-1q-symmmem-ulysses-transport-必须按版本完整投影)。
- CFG parallel state 的未初始化 serial-1 fallback、已初始化错误传播以及 two/N-branch rank
分派,见 [DIFF-4y](rules-system-runtime.md#diff-4y-cfg-parallel-state-未初始化时串行初始化错误必须可见)。
- 并行度 × 设备容量的启动验收硬规则在
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Diffusion paged cache 与系统运行时规则"
created: 2026-09-03
updated: 2026-09-22
updated: 2026-11-27
type: rule
tags: [vllm-omni, components, diffusion]
sources: ["PR #5255", "PR #5344", "PR #5543", "PR #5838", "PR #6094", "PR #6102", "PR #6385", "PR #6340", "PR #6714", "PR #6814", "PR #6563", "PR #5716", "PR #6786", vllm_omni/diffusion/attention/, vllm_omni/diffusion/attention/parallel/ulysses.py, vllm_omni/diffusion/attention/parallel/ring_kernels.py, vllm_omni/diffusion/diffusion_kv/, vllm_omni/diffusion/distributed/cfg_parallel.py, vllm_omni/diffusion/distributed/parallel_state.py, vllm_omni/diffusion/worker/diffusion_model_runner.py, vllm_omni/platforms/interface.py, vllm_omni/platforms/npu/platform.py, tests/diffusion/diffusion_kv/, tests/diffusion/distributed/test_cfg_parallel.py, tests/diffusion/attention/test_piecewise_attn.py, tests/diffusion/attention/test_ulysses_uaa.py, "PR #5491", "PR #5194", "vllm_omni/diffusion/data.py", "vllm_omni/diffusion/utils/hf_utils.py", "PR #7041", "PR #6463", "PR #6844", "PR #7548"]
sources: ["PR #5255", "PR #5344", "PR #5543", "PR #5838", "PR #6094", "PR #6102", "PR #6385", "PR #6340", "PR #6714", "PR #6814", "PR #6563", "PR #5716", "PR #6786", vllm_omni/diffusion/attention/, vllm_omni/diffusion/attention/parallel/ulysses.py, vllm_omni/diffusion/attention/parallel/ring_kernels.py, vllm_omni/diffusion/diffusion_kv/, vllm_omni/diffusion/distributed/cfg_parallel.py, vllm_omni/diffusion/distributed/parallel_state.py, vllm_omni/diffusion/worker/diffusion_model_runner.py, vllm_omni/platforms/interface.py, vllm_omni/platforms/npu/platform.py, tests/diffusion/diffusion_kv/, tests/diffusion/distributed/test_cfg_parallel.py, tests/diffusion/attention/test_piecewise_attn.py, tests/diffusion/attention/test_ulysses_uaa.py, "PR #5491", "PR #5194", "vllm_omni/diffusion/data.py", "vllm_omni/diffusion/utils/hf_utils.py", "PR #7041", "PR #6463", "PR #6844", "PR #7548", "PR #11109"]
confidence: high
---

Expand Down Expand Up @@ -86,12 +86,15 @@ confidence: high
- 验收:32Q/8KV、异构 prefix、单 token/单 head、非对称等维 LSE 和 batch compaction 精确
对照 dense/reference 输出。 ^[PR #5543] ^[PR #6102]

## DIFF-4x — SymmMem Ulysses A2A 只能显式启用并保持 workspace 生命周期闭合
## DIFF-4x SymmMem Ulysses A2A transport 与 workspace 生命周期

- 触发:修改 `ulysses_a2a_permute`、strict Ulysses all-to-all、NCCL SymmetricMemory JIT extension、CUDA graph capture 或 diffusion worker shutdown。
- 强制:默认关闭;只在 `ulysses_degree > 1`、strict Ulysses 的正向 `(scatter,gather)=(2,1)` 与反向 `(1,2)` layout 启用,并在 worker/model 初始化时 JIT build/capability failure 直接 fail-at-init。advanced-UAA 保持其 `_ulysses_all_to_all_any_*` path;AllGather 不选择 Ulysses;strict Ulysses+Ring 的 Ulysses leg 仍可使用该 path。每个 `(device, process-group)` 只有一个单 CUDA stream 的 grow-only byte workspace;首次分配及增长必须是 collective、在增长前同步,容量内以 typed byte-slice view 复用;graph capture 中禁止增长,须先 warm up 最大 shape;worker shutdown 同步并释放 workspace。Fast Ulysses QKV staging 只有 input/output 同一 CUDA device、同一 dtype、input rank-3、shape 相同、output contiguous,且 inner row `stride(2)==1`、`stride(1)==size(2)`、outer stride 不小于一整 row(无 overlap)时,才可在 `CUDAGuard(input.device())` 与 current CUDA stream 上用 `cudaMemcpy2DAsync`。^[PR #6714] ^[PR #6814]
- 禁止:把 flag 当作默认 transport、静默 fallback;按历史 shape/dtype 无界缓存 allocation;跨 stream 重用 staging buffer;capture 中隐式分配/扩容;把任意 strided tensor 当作 copy-engine eligible,或把 CPU/mock workspace 测试、PR benchmark 写成数学/输出 parity、普遍速度或跨硬件收益。
- 验收:覆盖 CLI/deploy/default-stage 的显式 flag 透传与默认 false、eligible strict path 的 init build、UAA/AllGather/noneligible layout 不调用该 path、strict Ulysses+Ring 的 eligible Ulysses leg、peak workspace 复用/collective growth、capture growth fail、single-stream reject 与 shutdown release;copy op 必须拒绝 device/dtype/rank/shape/output-contiguity/inner-row/overlap 不匹配。当前没有新增 upstream unit;仅 B300 上 row-strided BF16 bitwise copy、四-rank forward/reverse parity 和四-GPU H3 smoke 证据,不能外推为一般硬件或性能结论。^[PR #6340] ^[PR #6814]
- 触发:修改 `ulysses_a2a_backend`、旧版 `ulysses_a2a_permute`、strict Ulysses all-to-all、NCCL SymmetricMemory JIT、CUDA graph 或 diffusion worker shutdown。
- 选择:`v0.34.0` tag 的旧 bool 默认关闭。自 [#11109](https://github.com/vllm-project/vllm-omni/pull/11109) 起,CUDA `auto` 只有满足 strict pure Ulysses、非 causal、使用目标布局且无 CUDA-graphed denoising 时才尝试 copy engine;group 必须单机、具备 P2P 和 torch symmetric memory,超过两 rank 还要求全 NVLink;两 rank 可用 PCIe P2P。group collective 给所有 rank 同一结果,条件不满足则记录理由并走 `nccl`。显式 `nccl` 不做 CE 选择;在进入 `select_transport` 的 CUDA Ulysses 分支,显式 `copy_engine` 不合硬件或 graph 条件会报错;策略仍按调用的 mode/layout 决定实际交换。NPU 的 `auto` 不自动启用 SHMEM;显式 `copy_engine` 走平台自己的 eager、pure Ulysses、HCCS/SHMEM 校验。[选择器](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/diffusion/distributed/ulysses_transport.py) · [调用方](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/diffusion/attention/parallel/factory.py)
- 组合路径:纯 AllGather-KV 不执行 Ulysses exchange;Ulysses × AllGather-KV 在 transport selector 前返回,显式 `copy_engine` 的内部标志仍传给 Ulysses leg(实际 exchange 受 mode/layout 限制),不传给 AllGather leg。不能把 CUDA selector 的拓扑/graph 拒绝规则套到这一分支;显式 NPU 仍先经平台配置校验。
- Overlap:`v0.34.0` tag 没有 `--ulysses-overlap-chunks`。在 #11109 合入点,正数 chunks 与显式 `nccl`、非 strict、Ring 或 AllGather 不兼容,配置阶段拒绝;合法 `auto` 若随后解析为 `nccl` 则不启用 overlap。CUDA graph capture 另行禁用 head overlap。
- Workspace:CE 的正向布局为 `(scatter,gather)=(2,1)`,反向为 `(1,2)`;advanced-UAA 保留独立交换。每个 `(device, process-group)` 只有一个单 CUDA stream 的 grow-only byte workspace;首次分配及增长必须是 collective、在增长前同步,容量内以 typed byte-slice view 复用;graph capture 中禁止增长,须先 warm up 最大 shape;worker shutdown 同步并释放 workspace。Fast Ulysses QKV staging 只有 input/output 同一 CUDA device、同一 dtype、input rank-3、shape 相同、output contiguous,且 inner row `stride(2)==1`、`stride(1)==size(2)`、outer stride 不小于一整 row(无 overlap)时,才可在 `CUDAGuard(input.device())` 与 current CUDA stream 上用 `cudaMemcpy2DAsync`。 ^[PR #6714] ^[PR #6814]
- 禁止:把 `auto` 的按条件选择说成显式 `copy_engine` 的静默 fallback;把 strict Ulysses+Ring 可走的旧版/显式 Ulysses leg 当作新 `auto` 会选择的 pure Ulysses;跨 stream 复用 workspace、无界缓存或 capture 中扩容;把 CPU/mock 或单机 benchmark 外推为跨平台收益。
- 验收:覆盖显式策略、`auto` 的 topology/graph fallback 和 overlap gating,验证不合资格布局不走 fused path;只改配置投影时验证真实 consumer 收到值即可。改变交换、workspace 或生命周期时,再按受影响路径补实际硬件 forward/reverse parity、workspace collective growth/复用、capture growth fail 与 teardown。历史 B300 row-strided BF16、四 rank parity 和 H3 smoke 仅证明其对应配置。^[PR #6340] ^[PR #6814]

## DIFF-4y — CFG parallel state 未初始化时串行,初始化错误必须可见

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "LingBot World 运行入口、配置与验证"
created: 2026-10-09
updated: 2026-10-09
updated: 2026-11-27
type: guide
tags: [vllm-omni, models, diffusion, benchmark]
sources:
Expand All @@ -10,6 +10,7 @@ sources:
- vllm-project/vllm-omni@9cf443a7bb24d6b8007981311466d769ec13b3d8:vllm_omni/deploy/lingbot_world_v2_stepwise.yaml
- vllm-project/vllm-omni@9cf443a7bb24d6b8007981311466d769ec13b3d8:benchmarks/lingbot_world/README.md
- vllm-project/vllm-omni@9cf443a7bb24d6b8007981311466d769ec13b3d8:benchmarks/lingbot_world/workload.py
- vllm-project/vllm-omni@6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb:vllm_omni/diffusion/models/lingbot_world/pipeline.py
confidence: high
---

Expand Down Expand Up @@ -82,7 +83,7 @@ python examples/online_serving/streaming_video_generation/streaming_video_client

## 并行、量化与质量开关

当前 pipeline 校验纯 Ulysses:`sequence_parallel_size == ulysses_degree`,`ring_degree == allgather_degree == 1`,strict mode,禁用 `ulysses_a2a_permute`。PP/CFG/VAE-patch parallel size 大于 1、HSDP 和 expert parallel 均拒绝;不能把同 group 的 VAE width sharding 描述成支持 `vae_patch_parallel_size`。
当前 pipeline 校验纯 Ulysses:`sequence_parallel_size == ulysses_degree`,`ring_degree == allgather_degree == 1`,strict mode。上述核对版本及 `v0.34.0` 用旧字段,要求 `ulysses_a2a_permute=false`。从 [#11109 合入点](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/diffusion/models/lingbot_world/pipeline.py#L288) 起,LingBot World 的 `auto` 被固定为 `nccl`,显式 `nccl` 接受,显式 `copy_engine` 不支持;勿把通用 CUDA `auto` 的 CE 行为外推到该模型。PP/CFG/VAE-patch parallel size 大于 1、HSDP 和 expert parallel 均拒绝;不能把同 group 的 VAE width sharding 描述成支持 `vae_patch_parallel_size`。
四 GPU compiled 示例在 `benchmarks/lingbot_world/configs/usp4_compiled.yaml`;其 TP=1 是该配置的选择,不是 pipeline validator 对所有 TP 的限制。

在线 FP8 通过通用 quantization 配置传到 transformer 的 vLLM parallel linears,可按完整 prefix 保留敏感层为 BF16。camera/C2WS exclusion 是质量实验的配置选择,不是所有场景默认正确的策略。KV reuse 省去一次 writeback,VAE width sharding 改变边界数值顺序;每个开关都应与匹配的 BF16/默认 commit/full-frame decode 对照,不能从单个 kernel speedup 推断 E2E 或长 session 质量。
Expand Down
6 changes: 3 additions & 3 deletions knowledge/repos/vllm-omni/models/lingbot-world/rules.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "LingBot World 模型规则"
created: 2026-09-22
updated: 2026-10-09
updated: 2026-11-27
type: rule
tags: [vllm-omni, models, diffusion]
sources:
Expand Down Expand Up @@ -55,9 +55,9 @@ sources:
## LBW-2b — 并行配置必须在组件加载前满足 pure Ulysses 合同

- 触发:修改 LingBot parallel config 或并行能力验证。
- 强制:sequence parallel 仅接受 `sequence_parallel_size == ulysses_degree` 的 pure strict Ulysses,`ring_degree == allgather_degree == 1` 且禁用 `ulysses_a2a_permute`;在加载组件前拒绝不支持的模式。
- 强制:sequence parallel 仅接受 `sequence_parallel_size == ulysses_degree` 的 pure strict Ulysses,`ring_degree == allgather_degree == 1`;在加载组件前拒绝不支持的模式。`v0.34.0` 等旧字段版本要求 `ulysses_a2a_permute=false`;自 [#11109 合入点](https://github.com/vllm-project/vllm-omni/blob/6c30b6eb7f5e69407b5353be4f806e0bfc7a96fb/vllm_omni/diffusion/models/lingbot_world/pipeline.py#L288) 起,显式 `nccl` 接受,`auto` 固定为 `nccl`,显式 `copy_engine` 抛出 `NotImplementedError`。
- 禁止:设置 `pipeline_parallel_size > 1`、`cfg_parallel_size > 1` 或 `vae_patch_parallel_size > 1`,或启用 HSDP / expert parallel;不能把 VAE width sharding 解释为支持 tiled VAE executor。
- 验收:合法 pure Ulysses 通过;非法并行组合在 tokenizer、encoder、VAE 加载前失败。实际 process group 的检查属于 `LBW-2e`。[并行验证源码](https://github.com/vllm-project/vllm-omni/blob/9cf443a7bb24d6b8007981311466d769ec13b3d8/vllm_omni/diffusion/models/lingbot_world/pipeline.py#L249)。
- 验收:合法 pure Ulysses 通过,新字段的三种 transport 分别验收;非法并行组合在 tokenizer、encoder、VAE 加载前失败。实际 process group 的检查属于 `LBW-2e`。[并行验证源码](https://github.com/vllm-project/vllm-omni/blob/9cf443a7bb24d6b8007981311466d769ec13b3d8/vllm_omni/diffusion/models/lingbot_world/pipeline.py#L249)。

## LBW-2c — Online FP8 配置必须贯通 eligible linears 与稳定的完整层名

Expand Down
Loading