From fd78e96be7ae742249300761540292f371677188 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Thu, 26 Nov 2026 01:45:13 -0500 Subject: [PATCH 1/5] docs(knowledge): scope MiniCPM-o Ascend graph contracts by profile --- .../components/configuration/_index.md | 2 +- .../configuration/rules-topology-profiles.md | 19 +++++++++++-------- .../vllm-omni/models/minicpm-o-4-5/_index.md | 11 ++++++----- .../minicpm-o-4-5/rules-code2wav-runtime.md | 15 ++++++++------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/knowledge/repos/vllm-omni/components/configuration/_index.md b/knowledge/repos/vllm-omni/components/configuration/_index.md index de9f5180b..e35bcaf59 100644 --- a/knowledge/repos/vllm-omni/components/configuration/_index.md +++ b/knowledge/repos/vllm-omni/components/configuration/_index.md @@ -53,7 +53,7 @@ sources: ["claude-workflow-starter-private@296ea45", vllm_omni/config/] | 添加新模型和注册点 | [adding a model](adding-a-model.md) | | composable strategy、并行拓扑、VAE batch mode 的 WORLD→DP 门禁与 load balancing owner | [并行拓扑合同](rules-parallel-topology.md) | -| 冻结 topology、辅助 stage、mixed V1/MRv2 runner、deploy profile 与 `additional_config` 投影 | [topology 与部署 profile](rules-topology-profiles.md) | +| 冻结 topology、辅助 stage、mixed V1/MRv2 runner、deploy profile(含 MiniCPM-o Ascend 的继承和 outer/inner graph 边界)与 `additional_config` 投影 | [topology 与部署 profile](rules-topology-profiles.md) | - [部署 platform overlay 的最终配置合同](rules-platform-overlays.md)。 - [配置规则 — CUDA graph 显存预留与 KV 预算](rules-cudagraph-kv-reserve.md) diff --git a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md index c269dc004..4574d5ad1 100644 --- a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md +++ b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md @@ -1,10 +1,10 @@ --- title: "topology 与部署 profile 合同" created: 2026-09-04 -updated: 2026-10-06 +updated: 2026-11-26 type: rule tags: [vllm-omni, components, config] -sources: ["PR #4222", "PR #4795", "PR #5604", "PR #5842", "PR #5885", "PR #6082", vllm_omni/config/stage_config.py, vllm_omni/config/config_factory.py, vllm_omni/engine/stage_init_utils.py, vllm_omni/engine/stage_runtime.py, tests/engine/test_async_omni_engine_stage_init.py, vllm_omni/deploy/, "PR #6186", "PR #6813", "PR #6291", "PR #6829", vllm_omni/config/pipeline_registry.py, tests/config/test_config_factory.py, tests/config/test_omni_config.py, tests/config/test_pipeline_registry.py, tests/utils/test_tracking_parser.py, "PR #6230", vllm_omni/entrypoints/utils.py, tests/entrypoints/test_serve.py, tests/entrypoints/test_utils.py, "PR #7272", "PR #8184"] +sources: ["PR #4222", "PR #4795", "PR #5604", "PR #5842", "PR #5885", "PR #6082", vllm_omni/config/stage_config.py, vllm_omni/config/config_factory.py, vllm_omni/engine/stage_init_utils.py, vllm_omni/engine/stage_runtime.py, tests/engine/test_async_omni_engine_stage_init.py, vllm_omni/deploy/, "PR #6186", "PR #6813", "PR #6291", "PR #6829", vllm_omni/config/pipeline_registry.py, tests/config/test_config_factory.py, tests/config/test_omni_config.py, tests/config/test_pipeline_registry.py, tests/utils/test_tracking_parser.py, "PR #6230", vllm_omni/entrypoints/utils.py, tests/entrypoints/test_serve.py, tests/entrypoints/test_utils.py, "PR #7272", "PR #8184", "PR #10595"] confidence: high --- @@ -50,9 +50,12 @@ confidence: high - 验收:用 bare `config.json` 和三个 architecture 分别验证 model type、pipeline、stage config 与默认 deploy 名称;sync/async 配置只切换 processor wiring,并保持三 stage 顺序与 stage architecture 一致。 ^[PR #5842] -## CONF-5e — MiniCPM-o 部署 profile 必须一致传递 CFM Graph 开关 +## CONF-5e — MiniCPM-o CFM Graph 参数必须投影到实际平台与 profile -- 触发:修改 MiniCPM-o 4.5 bundled deploy YAML 或 Code2Wav connector extra 中的 CFM CUDA Graph 开关、缓存上限或配置传递。\n- 强制:`minicpmo_4_5.yaml`、`minicpmo_4_5_2gpu.yaml`、`minicpmo_4_5_3gpu.yaml` 和 `minicpmo_4_5_8x4090.yaml` 必须一致声明 `enable_cfm_graph` 与 `cfm_max_graphs`;当前默认值为 `true` 与 `32`,并传入 `MiniCPMO45Code2Wav` 的 `_cfm_graph_config` 和 `BatchedToken2Wav`。非 CUDA 设备仍必须回退 eager。\n- 禁止:只更新一个 deploy profile、依赖未记录的默认值,或把配置存在误认为 graph 已在非 CUDA 环境生效;不得把模型专有开关扩展成所有模型的通用配置合同。\n- 验收:解析四份 deploy 配置并断言开关和上限一致,追踪非默认值到 `_cfm_graph_config` 与 `BatchedToken2Wav`;覆盖开关关闭和非 CUDA fallback,并确认 stage topology 未发生额外变化。\n^[PR #6082] +- 触发:修改 MiniCPM-o 4.5 bundled deploy YAML 或 Code2Wav connector extra 中的 CFM graph 开关、预算或配置传递。 +- 强制:按目标 revision 展开 `base_config`、平台及 stage 覆盖,跟踪 connector CFM 参数到 `MiniCPMO45Code2Wav` / `BatchedToken2Wav`;Ascend 的 Stage 2 本地开关和上限按 CONF-5g 验证。 +- 禁止:要求派生 YAML 重复声明继承字段、所有 profile 使用同一预算,或把 #6082 的 CUDA 路径解释为所有非 CUDA 设备永远 eager;配置存在不等于捕获、重放或测量已经发生。 +- 验收:对支持的 profile 检查展开后的启停、默认/覆盖值和非默认配置确实到达 consumer;分别覆盖支持的平台与不支持的 eager 路径,不从 connector 改动推断 stage topology 改变。 ^[PR #6082] ^[PR #10595] ## CONF-5f — π0 的 checkpoint、registry 与 deploy 必须闭合为单 diffusion stage @@ -63,10 +66,10 @@ confidence: high ## CONF-5g — MiniCPM-o NPU Code2Wav 开关必须按 Stage 2 传递 -- 触发:修改 MiniCPM-o 4.5 bundled deploy YAML,或新增/调整 `code2wav_enable_npu_graph`、`code2wav_max_npu_graphs` 这类 Ascend Code2Wav graph 配置。 -- 强制:`minicpmo_4_5.yaml`、`minicpmo_4_5_2gpu.yaml` 和 `minicpmo_4_5_3gpu.yaml` 必须在 `platforms.npu.stages` 中按 stage 声明配置;Stage 0/1 保持 `compilation_config.cudagraph_mode: PIECEWISE`,Stage 2 只通过 `additional_config` 传递 graph 开关和上限,默认值为 `true` 与 `32`,并保持最终 runner 的 outer eager 语义。所有断言必须基于 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 展开的最终 stage config。 -- 禁止:把 Code2Wav NPU 开关放入 shared connector extra、全局配置或其他 stage;只修改一个 profile;以 YAML 原文或字段存在推断配置已到达 Code2Wav consumer;用全局 eager override 破坏 Stage 0/1 的 `PIECEWISE` 配置。 -- 验收:逐一解析三个 profile,断言 connector extra 不含两个 Code2Wav key,NPU 展开结果包含 Stage 0/1 的 `PIECEWISE`、Stage 2 的 `enforce_eager: true`、`code2wav_enable_npu_graph: true` 和 `code2wav_max_npu_graphs: 32`,并覆盖开关关闭和缓存上限为 0 的路径。^[PR #5604] +- 触发:修改 MiniCPM-o 4.5 bundled deploy YAML 或调整 `code2wav_enable_npu_graph`、`code2wav_max_npu_graphs`。 +- 强制:Ascend 通过 Stage 2 的 `additional_config` 投影这两个 key,并保持最终 runner outer eager;encoder/CFM/HiFT 子图边界见 [MCPMO-1f](../../models/minicpm-o-4-5/rules-code2wav-runtime.md)。用 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 核对实际 profile,包括替换而非深合并的 `additional_config` 和继承的 connector 设置。 +- 禁止:把这两个 key 放进 shared connector extra、全局配置或其他 stage;用全局 eager 改变 Stage 0/1;对所有 revision 和 profile 硬编码 `PIECEWISE` 或统一 graph cap。 +- 验收:按 revision 断言最终 Stage 0/1 runner 模式、Stage 2 outer eager、开关及 cap,覆盖关闭和 cap 0。含 #10595 的配置见[基底 YAML](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5.yaml#L253-L376)与[双卡 overlay](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5_2gpu.yaml#L25-L91):Stage 0/1 为 `FULL_DECODE_ONLY`;Stage 2 基底 cap=32,双 NPU overlay cap=96,Talker/Code2Wav 各两副本。断言继承后的五步 CFM 与副本/设备映射,参照[部署配置测试](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/tests/config/test_minicpmo_4_5_duplex_mrv2_deploy.py#L84-L117)。配置解析只证明投影,不是硬件资格。 ^[PR #5604] ^[PR #10595] 部署 YAML 的展开顺序见 [deploy-yaml](deploy-yaml.md);stage 执行合同见 [model-executor 规则](../model-executor/rules.md)。 diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/_index.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/_index.md index 8699e422f..9cb08fb7a 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/_index.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/_index.md @@ -1,10 +1,10 @@ --- title: "MiniCPM-o 4.5" created: 2026-07-20 -updated: 2026-10-06 +updated: 2026-11-26 type: index tags: [vllm-omni, models, model-executor] -sources: ["PR #3642", "PR #5382", "PR #5524", "PR #5638", "PR #5792", "PR #5869", "PR #6056", "PR #6154", "PR #6170", "PR #6318", "PR #6404", "PR #6678", "PR #6628", tests/dfx/perf/tests/test_minicpmo_4_5.json, tests/dfx/perf/tests/test_minicpmo_4_5_duplex_seed_tts.json, tests/e2e/accuracy/minicpmo_4_5/test_minicpmo_4_5.py, tests/engine/duplex/test_duplex_deploy_config.py, tests/e2e/online_serving/helpers/minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex_expansion.py, vllm_omni/experimental/fullduplex/client.py, vllm_omni/model_executor/models/minicpmo_4_5/duplex/stage0.py, vllm_omni/entrypoints/duplex/realtime_input.py, vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_talker_batching.py, vllm_omni/platforms/npu/models/minicpmo_4_5_code2wav.py, "PR #6082", "PR #6587", "PR #8007", "PR #8332", "PR #8443", "PR #8462", "PR #8222"] +sources: ["PR #3642", "PR #5382", "PR #5524", "PR #5638", "PR #5792", "PR #5869", "PR #6056", "PR #6154", "PR #6170", "PR #6318", "PR #6404", "PR #6678", "PR #6628", tests/dfx/perf/tests/test_minicpmo_4_5.json, tests/dfx/perf/tests/test_minicpmo_4_5_duplex_seed_tts.json, tests/e2e/accuracy/minicpmo_4_5/test_minicpmo_4_5.py, tests/engine/duplex/test_duplex_deploy_config.py, tests/e2e/online_serving/helpers/minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex_expansion.py, vllm_omni/experimental/fullduplex/client.py, vllm_omni/model_executor/models/minicpmo_4_5/duplex/stage0.py, vllm_omni/entrypoints/duplex/realtime_input.py, vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_talker_batching.py, vllm_omni/platforms/npu/models/minicpmo_4_5_code2wav.py, "PR #6082", "PR #6587", "PR #8007", "PR #8332", "PR #8443", "PR #8462", "PR #8222", "PR #10595"] confidence: high --- @@ -16,7 +16,7 @@ confidence: high - 模型:`vllm_omni/model_executor/models/minicpmo_4_5/`,包含 LLM、TTS wrapper 和 pipeline;输入处理在 `model_executor/stage_input_processors/minicpmo_4_5_omni.py`。 - 配置与入口:`config/pipeline_registry.py`、`deploy/minicpmo_4_5.yaml`、 - `minicpmo_4_5_3gpu.yaml`、`minicpmo_4_5_8x4090.yaml`。 + `minicpmo_4_5_2gpu.yaml`、`minicpmo_4_5_3gpu.yaml`、`minicpmo_4_5_8x4090.yaml`。 - 共享 owner:[Model Executor](../../components/model-executor/_index.md)、 [Config](../../components/configuration/_index.md) 和 [Serving](../../components/serving/_index.md)。 @@ -31,8 +31,9 @@ Code2Wav 在所有平台使用树内 `MiniCPMO45Token2wav`。CUDA 可显式开 Campplus TensorRT;这是可关闭的局部加速,不替换 encoder/HiFT,也不会自动启用 Step-Audio2 的 token2wav。engine cache/profile 与 fallback 门禁见 MCPMO-1c。 -四份 bundled deploy 在 CUDA 上另默认开启 HiFT graph:只 capture pre-iSTFT 子图,按 connector -chunk/cache shape 预捕并限量 lazy capture,且不服从 stage `enforce_eager`;非 CUDA 回 eager。 +在支持的 CUDA profile,HiFT graph 捕获 pre-iSTFT 子图,按 connector chunk/cache shape 预捕并限量 +lazy capture;Stage 2 outer `enforce_eager` 不控制这些 inner graph。Ascend 路径按 MCPMO-1f 验证, +不可概括为所有非 CUDA 都回 eager。 HiFT/CFM 的 shape、显存、并发、整代退休与部分-graph 性能证据边界见 [Code2Wav CUDA graph 规则](rules-cuda-graphs.md)。 新增核对:MCPMO-1k;legacy step-level 与 Whole-Euler 必须按实际路径区分。 diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md index 5cf8ec4f2..93d4f7f56 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md @@ -1,10 +1,10 @@ --- title: "MiniCPM-o 4.5 Code2Wav 运行时合同" created: 2026-07-20 -updated: 2026-09-07 +updated: 2026-11-26 type: rule tags: [vllm-omni, models, model-executor] -sources: ["PR #3642", "PR #5165", "PR #5382", "PR #5524", "PR #5638", "PR #5792", "PR #5869", "PR #6056", "PR #6154", "PR #6170", "PR #6318", "PR #6828", tests/dfx/perf/tests/test_minicpmo_4_5.json, tests/dfx/perf/tests/test_minicpmo_4_5_duplex_seed_tts.json, tests/e2e/accuracy/minicpmo_4_5/test_minicpmo_4_5.py, tests/e2e/online_serving/helpers/minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_realtime_duplex_drivers.py, tests/e2e/online_serving/test_minicpmo_4_5.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_expansion.py, tests/e2e/online_serving/run_minicpmo_realtime_duplex_soft_interrupt.py, vllm_omni/benchmarks/data_modules/seed_tts_dataset.py, vllm_omni/benchmarks/data_modules/seed_tts_eval.py, vllm_omni/benchmarks/patch/patch.py, vllm_omni/deploy/minicpmo_4_5.yaml, vllm_omni/experimental/fullduplex/client.py, vllm_omni/entrypoints/duplex/chat_fallback.py, vllm_omni/entrypoints/duplex/realtime_input.py, vllm_omni/entrypoints/duplex/session_runner.py, vllm_omni/entrypoints/duplex/serving.py, vllm_omni/entrypoints/duplex/vad.py, vllm_omni/model_executor/models/minicpmo_4_5/duplex/adapter.py, vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/batched_token2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/cuda_graph_wrapper.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_code2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_tts.py, vllm_omni/model_executor/stage_input_processors/minicpmo_4_5_omni.py, tests/model_executor/models/minicpmo_4_5/test_audio_chunk_mask.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_code2wav_batching.py, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_pipeline.py, tests/model_executor/models/minicpmo_4_5/test_talker_batching.py, tests/model_executor/models/minicpmo_4_5/test_vision_flash_attention.py, "PR #6082", "PR #5604", "PR #6274", "PR #6346", "PR #6397", "PR #6406", "PR #6458", "PR #6587", "PR #6619", "PR #6757", "PR #6529", "PR #6772", vllm_omni/entrypoints/duplex/protocol.py] +sources: ["PR #3642", "PR #5165", "PR #5382", "PR #5524", "PR #5638", "PR #5792", "PR #5869", "PR #6056", "PR #6154", "PR #6170", "PR #6318", "PR #6828", tests/dfx/perf/tests/test_minicpmo_4_5.json, tests/dfx/perf/tests/test_minicpmo_4_5_duplex_seed_tts.json, tests/e2e/accuracy/minicpmo_4_5/test_minicpmo_4_5.py, tests/e2e/online_serving/helpers/minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_realtime_duplex_drivers.py, tests/e2e/online_serving/test_minicpmo_4_5.py, tests/e2e/online_serving/test_minicpmo_4_5_duplex.py, tests/e2e/online_serving/test_minicpmo_4_5_expansion.py, tests/e2e/online_serving/run_minicpmo_realtime_duplex_soft_interrupt.py, vllm_omni/benchmarks/data_modules/seed_tts_dataset.py, vllm_omni/benchmarks/data_modules/seed_tts_eval.py, vllm_omni/benchmarks/patch/patch.py, vllm_omni/deploy/minicpmo_4_5.yaml, vllm_omni/experimental/fullduplex/client.py, vllm_omni/entrypoints/duplex/chat_fallback.py, vllm_omni/entrypoints/duplex/realtime_input.py, vllm_omni/entrypoints/duplex/session_runner.py, vllm_omni/entrypoints/duplex/serving.py, vllm_omni/entrypoints/duplex/vad.py, vllm_omni/model_executor/models/minicpmo_4_5/duplex/adapter.py, vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/batched_token2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/cuda_graph_wrapper.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_code2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py, vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_tts.py, vllm_omni/model_executor/stage_input_processors/minicpmo_4_5_omni.py, tests/model_executor/models/minicpmo_4_5/test_audio_chunk_mask.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_code2wav_batching.py, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_pipeline.py, tests/model_executor/models/minicpmo_4_5/test_talker_batching.py, tests/model_executor/models/minicpmo_4_5/test_vision_flash_attention.py, "PR #6082", "PR #5604", "PR #6274", "PR #6346", "PR #6397", "PR #6406", "PR #6458", "PR #6587", "PR #6619", "PR #6757", "PR #6529", "PR #6772", vllm_omni/entrypoints/duplex/protocol.py, "PR #10595"] confidence: high --- @@ -12,12 +12,13 @@ confidence: high 入口与其他规则见 [共享规则](rules.md)。 -## MCPMO-1f — Ascend Code2Wav NPUGraph 只捕获精确形状的 CFM DiT +## MCPMO-1f — Ascend Code2Wav 保持 outer eager,按实际 inner graph 路径验收 -- 触发:MiniCPM-o 4.5 在 Ascend 上修改 Code2Wav、CFM DiT estimator、NPUGraph 开关、图缓存或 bundled deploy profile。 -- 强制:Stage 2 保持 outer `enforce_eager: true`,只将确定性的 `blocks_forward_chunk` 放入按 exact shape 捕获的 inner NPUGraph;`t_embedder`、flow encoder、HiFT/RNG、请求解析和 request-owned state commit 必须 eager。cached 与 uncached attention/CNN state 使用独立 graph bucket,`code2wav_max_npu_graphs` 默认 32,超过上限的新 shape 回 eager;`code2wav_enable_npu_graph: false` 必须能关闭该 inner graph。Token2Wav 加载前设置 `torch.npu.config.allow_internal_format = False`、`torch.npu.set_compile_mode(jit_compile=False)`,拒绝 `ASCEND_LAUNCH_BLOCKING=1`,并在 graph mode 要求 MATH SDPA。 -- 禁止:捕获整个 Code2Wav Stage 2 或依赖全局 `--enforce-eager` 代替 stage-scoped 配置;把 graph 开关放进 shared connector extra;让失败捕获继续复用可能已损坏的 allocator/RNG state;把 NPU graph 的 parity、缓存或性能结论外推到 HiFT、TRT、CUDA 或其他模型。 -- 验收:解析 `minicpmo_4_5.yaml`、`minicpmo_4_5_2gpu.yaml` 和 `minicpmo_4_5_3gpu.yaml` 的 NPU 最终 stage config,断言 Stage 0/1 的 `PIECEWISE`、Stage 2 的 outer eager 与 additional config;CPU 测试覆盖 timestep、exact dispatch、cache bucket、clone ownership、runtime precondition、MATH 选择和 fail-stop;A3 测试覆盖 uncached/cached eager parity。任何性能声明还必须记录 exact command、A3 硬件/驱动/torch-npu、warmup、测量轮数、并发、延迟/RTF 和峰值 NPU memory。^[PR #5604] +- 触发:MiniCPM-o 4.5 在 Ascend 上修改 Code2Wav、CFM estimator、NPUGraph 开关、图缓存或 bundled deploy profile。 +- 强制:Stage 2 的 runner 保持 `enforce_eager: true`;这不关闭模型内部的设备 graph。早期 #5604 的 platform exact-step 路径只捕获 `blocks_forward_chunk`,cached/uncached shape 分桶;含 #10595 的 runtime 可在 NPU 上使用共享 CFM Whole-Euler/step wrapper,也可分别启用 Flow encoder 和 HiFT 子图。按当前 dispatch 区分这些路径:支持时在模型内部捕获有界子图,请求解析、request-owned state 提交和未捕获部分留在外层。带 capture 的 NPU runtime 仍需在 Token2Wav 加载前配置 `allow_internal_format=False`、`jit_compile=False` 并拒绝 `ASCEND_LAUNCH_BLOCKING=1`;SDPA 限制按实际路径验证。 +- 禁止:把 #5604 的 step-only、encoder/HiFT 全 eager 或默认 graph cap 当成后续版本的通用合同;把关闭 CFM graph 当成同时关闭独立的 encoder/HiFT 图;为已达到 cap、未命中 bucket 或未通过资格校验的请求强制 replay;捕获整个 Stage 2,或把部件 parity/速度外推为端到端结果。 +- 验收:先按 [CONF-5e/CONF-5g](../../components/configuration/rules-topology-profiles.md) 检查最终配置;再分别断言 CFM/encoder/HiFT 的开关、有效输出及下一 chunk 使用的 cache,覆盖 graph 关闭、边界 shape、cached/uncached、超预算、未被接纳及各路径的 capture 失败策略。对支持的 Ascend profile 比较 graph 与 eager;只有同硬件、同 profile、同 checkpoint 和 workload 的端到端测量才支持服务性能结论。区分 Ngram/BF16 与可选 DSpark/W8A8,不把组件资格测试或单轮历史数据作当前版本的端到端证明。 ^[PR #5604] ^[PR #10595] +- 版本证据:[合入树的 CFM 初始化与 dispatch](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/model_executor/models/minicpmo_4_5/code2wav/token2wav.py#L638-L758)、[平台开关与加载条件](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/platforms/npu/models/minicpmo_4_5_code2wav.py#L370-L433)。 ## MCPMO-1g — Token2Wav 的 eager TorchDynamo 包装必须在流式热路径中移除 From de95e8b1675cbd1b0a7acee2e094623d16414549 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Thu, 26 Nov 2026 01:52:50 -0500 Subject: [PATCH 2/5] docs(knowledge): distinguish legacy CUDA capture from supported Ascend paths --- .../minicpm-o-4-5/rules-code2wav-runtime.md | 2 +- .../models/minicpm-o-4-5/rules-cuda-graphs.md | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md index 93d4f7f56..ad60af31d 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md @@ -15,7 +15,7 @@ confidence: high ## MCPMO-1f — Ascend Code2Wav 保持 outer eager,按实际 inner graph 路径验收 - 触发:MiniCPM-o 4.5 在 Ascend 上修改 Code2Wav、CFM estimator、NPUGraph 开关、图缓存或 bundled deploy profile。 -- 强制:Stage 2 的 runner 保持 `enforce_eager: true`;这不关闭模型内部的设备 graph。早期 #5604 的 platform exact-step 路径只捕获 `blocks_forward_chunk`,cached/uncached shape 分桶;含 #10595 的 runtime 可在 NPU 上使用共享 CFM Whole-Euler/step wrapper,也可分别启用 Flow encoder 和 HiFT 子图。按当前 dispatch 区分这些路径:支持时在模型内部捕获有界子图,请求解析、request-owned state 提交和未捕获部分留在外层。带 capture 的 NPU runtime 仍需在 Token2Wav 加载前配置 `allow_internal_format=False`、`jit_compile=False` 并拒绝 `ASCEND_LAUNCH_BLOCKING=1`;SDPA 限制按实际路径验证。 +- 强制:Stage 2 的 runner 保持 `enforce_eager: true`;这不关闭模型内部的设备 graph。早期 #5604 的 platform exact-step 路径只捕获 `blocks_forward_chunk`,cached/uncached shape 分桶;含 #10595 的 runtime 可在 NPU 上使用共享 CFM Whole-Euler/step wrapper,也可分别启用 Flow encoder 和 HiFT 子图。按当前 dispatch 区分这些路径:支持时在模型内部捕获有界子图,请求解析、request-owned state 提交和未捕获部分留在外层。带 capture 的 NPU runtime 仍需在 Token2Wav 加载前配置 `allow_internal_format=False`、`jit_compile=False` 并拒绝 `ASCEND_LAUNCH_BLOCKING=1`;SDPA 限制按实际路径验证;启用且设备为 NPU 时,缺少所需 graph API 可使加载报错,不是未命中 bucket 时的 eager 回退。 - 禁止:把 #5604 的 step-only、encoder/HiFT 全 eager 或默认 graph cap 当成后续版本的通用合同;把关闭 CFM graph 当成同时关闭独立的 encoder/HiFT 图;为已达到 cap、未命中 bucket 或未通过资格校验的请求强制 replay;捕获整个 Stage 2,或把部件 parity/速度外推为端到端结果。 - 验收:先按 [CONF-5e/CONF-5g](../../components/configuration/rules-topology-profiles.md) 检查最终配置;再分别断言 CFM/encoder/HiFT 的开关、有效输出及下一 chunk 使用的 cache,覆盖 graph 关闭、边界 shape、cached/uncached、超预算、未被接纳及各路径的 capture 失败策略。对支持的 Ascend profile 比较 graph 与 eager;只有同硬件、同 profile、同 checkpoint 和 workload 的端到端测量才支持服务性能结论。区分 Ngram/BF16 与可选 DSpark/W8A8,不把组件资格测试或单轮历史数据作当前版本的端到端证明。 ^[PR #5604] ^[PR #10595] - 版本证据:[合入树的 CFM 初始化与 dispatch](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/model_executor/models/minicpmo_4_5/code2wav/token2wav.py#L638-L758)、[平台开关与加载条件](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/platforms/npu/models/minicpmo_4_5_code2wav.py#L370-L433)。 diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md index 9569444d9..fde550f59 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md @@ -1,31 +1,34 @@ --- title: "MiniCPM-o 4.5 Code2Wav CUDA graph 规则" created: 2026-09-04 -updated: 2026-10-06 +updated: 2026-11-26 type: rule tags: [vllm-omni, models, model-executor] -sources: [vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/batched_token2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, "PR #5869", "PR #6082", "PR #6587", "PR #7416", "PR #8007", "PR #8443", "PR #8222"] +sources: [vllm_omni/model_executor/models/cosyvoice3/code2wav_core/hifigan.py, vllm_omni/model_executor/models/minicpmo_4_5/batched_token2wav.py, vllm_omni/model_executor/models/minicpmo_4_5/cuda_graph_wrapper.py, tests/model_executor/models/minicpmo_4_5/test_cfm_graph_capture_gating.py, tests/model_executor/models/minicpmo_4_5/test_cuda_graph_wrapper.py, "PR #5869", "PR #6082", "PR #6587", "PR #7416", "PR #8007", "PR #8443", "PR #8222", "PR #10595"] confidence: high --- # MiniCPM-o 4.5 Code2Wav CUDA graph 规则 +本页的 MCPMO-1d/1e 记录 CUDA HiFT 与 legacy CFM step 实现的合同,不是非 CUDA 的能力矩阵。 +支持的 Ascend 内部 graph、启动门禁与 fallback 查 [Code2Wav 运行时合同(MCPMO-1f)](rules-code2wav-runtime.md)。 + ## MCPMO-1d — HiFT graph 只捕获稳定 pre-iSTFT 子图并限界 shape cache -- 触发:`enable_hift_graph`、capture batch/chunk 配置、HiFT inference 分段或 streaming cache shape。 -- 强制:只在 parameter device 为 CUDA 时启用;非 CUDA 回 eager。capture bucket 由 codec chunk、left context、Flow lookahead、token→mel ratio 与 mel/source cache 推导;新版在首个 forward 的预捕阶段准备 uncached/cached、initial 和配置的 exact shape;只有合法 capture buckets 的缺失 graph 可 lazy capture(默认上限 8),未知 final shape、超限或无法容纳 batch 时回 eager。active stream capture 中禁止嵌套 capture/replay并回 eager;静态输入先清零再复制真实 batch,输出 slice 后 clone。 +- 触发:CUDA HiFT 路径的 `enable_hift_graph`、capture batch/chunk 配置、HiFT inference 分段或 streaming cache shape。 +- 强制:#5869 的 CUDA-only 实现仅接受 CUDA parameter device,其非 CUDA 分支回 eager;不要把这个历史门禁当作后续共享 wrapper 的设备白名单。CUDA capture bucket 由 codec chunk、left context、Flow lookahead、token→mel ratio 与 mel/source cache 推导;新版在首个 forward 的预捕阶段准备 uncached/cached、initial 和配置的 exact shape;只有合法 capture buckets 的缺失 graph 可 lazy capture(默认上限 8),未知 final shape、超限或无法容纳 batch 时回 eager。active stream capture 中禁止嵌套 capture/replay并回 eager;静态输入先清零再复制真实 batch,输出 slice 后 clone。 - 强制:graph 只覆盖 `_inference_pre_istft`;ISTFT 与 waveform clamp 留在 graph 外的 `_finalize_decode`;MiniCPM 显式 cached ISTFT 的首 shape 仍检查 NOLA,后续复用合同见 MCPMO-MRV2-1d。HiFT window/harmonic IDs 必须是随 module device 移动的 non-persistent buffers。开关独立于 stage `enforce_eager`;四份 bundled MiniCPM-o deploy 默认开启。 - 禁止:无 connector 配置、非正 chunk、负 left context、source/mel cache 不整除时静默 capture;不核对新版 exact initial/continuation 配置就将 `initial_codec_chunk_frames` 当已预捕(旧版仅 lazy capture,新版预捕合同见 MCPMO-GRAPH-1e);把 lazy graph limit 说成总显存上界,因为启动 graphs、global pool、static tensors 与其他 graph owners 仍驻留。active-capture 分支虽绕过 nested replay,却调用完整 eager decode(native ISTFT 或 cached envelope 首次 miss 仍可能 NOLA sync);未做真实 outer-graph 测试前,不能把日志中的 “fallback” 当成可捕获保证。custom `capture_batch_sizes` 也尚未校验正数/去重。 -- 验收:CUDA test 比较 cached/uncached graph 与 eager,CPU/mock 覆盖 lazy capture/limit fallback,deploy test 固定默认开关;另测非 CUDA disable、invalid config、unsupported batch、nested capture 和 variable final chunk。static input/output 与 lazy graph map 为无锁可变状态;并发 replay/capture 需先证明被上层串行化或增加互斥与重叠调用测试。PR 的单 A800 profile 约 30→5 ms/chunk、250→43 ms/request,只绑定部分 graph、单 prompt/commit `8fa28d88`,无 repeats/端到端质量,不能泛化为稳定 speedup。^[PR #5869] ^[PR #8443] ^[PR #8222] +- 验收:CUDA test 比较 cached/uncached graph 与 eager,CPU/mock 覆盖 lazy capture/limit fallback,deploy test 固定默认开关;回归 #5869 CUDA-only 实现时验证其非 CUDA disable;当前设备路径按相应 backend 验证。另测 invalid config、unsupported batch、nested capture 和 variable final chunk。static input/output 与 lazy graph map 为无锁可变状态;并发 replay/capture 需先证明被上层串行化或增加互斥与重叠调用测试。PR 的单 A800 profile 约 30→5 ms/chunk、250→43 ms/request,只绑定部分 graph、单 prompt/commit `8fa28d88`,无 repeats/端到端质量,不能泛化为稳定 speedup。^[PR #5869] ^[PR #8443] ^[PR #8222] -## MCPMO-1e — legacy step-level CFM DiT Graph 必须按 shape 整代退休并保持 eager parity +## MCPMO-1e — legacy CUDA step-level CFM DiT Graph 按 shape 整代退休并保持 eager parity -- 触发:修改 MiniCPM-o 4.5 Code2Wav legacy step-level CFM DiT estimator 的 `blocks_forward_chunk` graph target、按 shape 捕获/重放、cache retirement 或 eager fallback;Whole-Euler 的完整 solver capture 另见 MCPMO-GRAPH-1a/1b。 -- 强制:仅在 CUDA 且显式启用时捕获 `estimator.blocks_forward_chunk`;`t_embedder`、`torch.cat`、`expand`、buffer 准备和 10-step Euler loop 保持 eager。graph key 必须包含所有输入的 shape、dtype 和 device;`cnn_cache=None` 与 `att_cache=None` 转为 graph 可接受的零值时,必须保持与 eager `[None] * depth` 的首 chunk 数值语义,重放结果和 cache 输出需 clone。 +- 触发:修改 MiniCPM-o 4.5 Code2Wav legacy CUDA step-level CFM DiT estimator 的 `blocks_forward_chunk` graph target、按 shape 捕获/重放、cache retirement 或 eager fallback;Whole-Euler 的完整 solver capture 另见 MCPMO-GRAPH-1a/1b。 +- 强制:对 #6082/#6587 的 legacy CUDA wrapper,仅在 CUDA 且显式启用时捕获 `estimator.blocks_forward_chunk`;`t_embedder`、`torch.cat`、`expand`、buffer 准备和 10-step Euler loop 保持 eager。graph key 必须包含所有输入的 shape、dtype 和 device;`cnn_cache=None` 与 `att_cache=None` 转为 graph 可接受的零值时,必须保持与 eager `[None] * depth` 的首 chunk 数值语义,重放结果和 cache 输出需 clone。 - 强制:`cfm_max_graphs` 是一代的有界容量。满载遇到新 shape 时,先同步,再只对本 wrapper 拥有的全部 `CUDAGraph` 调用 `reset()` 并清空 cache,随后捕获新一代的首图;绝不可逐 entry/LRU eviction。不得进行 process-wide cuBLAS workspace 清理或 `empty_cache()`:HiFT 等共享 global graph pool 的存活图不属于 CFM 的退休范围。`max_graphs <= 0` 必须禁用捕获并 eager。 - 强制:warmup 或 capture 发生异常时,在该 wrapper 的剩余生命周期内保持禁用并退休其自有 generation;不能在可能脏的 capture stream/allocator 状态继续捕获。无法由 key 重建的 dtype 仅标记该 shape eager,不得禁用其他可捕获 shape;capture admission 不得依赖 device free-memory。维护固定字段的 calls/hits/captures/flushes/eager 累计 telemetry。 - 禁止:捕获整个 `_estimator_step` 或手写替代 graph target;使用无界 shape cache、逐图 eviction、跨 owner 的 process-wide cleanup,或在 nested capture 中重放;捕获失败后伪装成功;把 CFM graph 的配置、性能或 parity 结论外推到 HiFT、encoder、TRT 或其他模型。 -- 验收:CUDA 测试覆盖 uncached/cached shape 的 graph/eager 数值 parity、`None` cache parity、lazy capture、整代 flush 后 HiFT replay parity、capture/warmup failure 后不再 capture、unsupported dtype shape-local eager 与 `max_graphs <= 0` eager;CPU/mock 覆盖 active capture/non-CUDA、free-memory 非 gating、telemetry 和 inert non-CUDA memory reporting,并确认 deploy 配置值实际到达 estimator。^[PR #6082] ^[PR #6587] +- 验收:CUDA 测试覆盖 uncached/cached shape 的 graph/eager 数值 parity、`None` cache parity、lazy capture、整代 flush 后 HiFT replay parity、capture/warmup failure 后不再 capture、unsupported dtype shape-local eager 与 `max_graphs <= 0` eager;CPU/mock 按该 legacy CUDA wrapper 覆盖 active capture、历史非 CUDA 分支、free-memory 非 gating、telemetry 和 inert non-CUDA memory reporting,并确认 deploy 配置值实际到达 estimator。^[PR #6082] ^[PR #6587] ## MCPMO-1k — 显式启用 CFM 帧桶时,padding 不得进入有效输出与 cache From 74ec918f1cd0a8189204e0d92d31cce9bdaee777 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Thu, 26 Nov 2026 01:53:56 -0500 Subject: [PATCH 3/5] docs(knowledge): preserve existing CFM rule anchor --- .../repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md index fde550f59..42cda1e82 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md @@ -21,7 +21,7 @@ confidence: high - 禁止:无 connector 配置、非正 chunk、负 left context、source/mel cache 不整除时静默 capture;不核对新版 exact initial/continuation 配置就将 `initial_codec_chunk_frames` 当已预捕(旧版仅 lazy capture,新版预捕合同见 MCPMO-GRAPH-1e);把 lazy graph limit 说成总显存上界,因为启动 graphs、global pool、static tensors 与其他 graph owners 仍驻留。active-capture 分支虽绕过 nested replay,却调用完整 eager decode(native ISTFT 或 cached envelope 首次 miss 仍可能 NOLA sync);未做真实 outer-graph 测试前,不能把日志中的 “fallback” 当成可捕获保证。custom `capture_batch_sizes` 也尚未校验正数/去重。 - 验收:CUDA test 比较 cached/uncached graph 与 eager,CPU/mock 覆盖 lazy capture/limit fallback,deploy test 固定默认开关;回归 #5869 CUDA-only 实现时验证其非 CUDA disable;当前设备路径按相应 backend 验证。另测 invalid config、unsupported batch、nested capture 和 variable final chunk。static input/output 与 lazy graph map 为无锁可变状态;并发 replay/capture 需先证明被上层串行化或增加互斥与重叠调用测试。PR 的单 A800 profile 约 30→5 ms/chunk、250→43 ms/request,只绑定部分 graph、单 prompt/commit `8fa28d88`,无 repeats/端到端质量,不能泛化为稳定 speedup。^[PR #5869] ^[PR #8443] ^[PR #8222] -## MCPMO-1e — legacy CUDA step-level CFM DiT Graph 按 shape 整代退休并保持 eager parity +## MCPMO-1e — legacy step-level CFM DiT Graph 必须按 shape 整代退休并保持 eager parity - 触发:修改 MiniCPM-o 4.5 Code2Wav legacy CUDA step-level CFM DiT estimator 的 `blocks_forward_chunk` graph target、按 shape 捕获/重放、cache retirement 或 eager fallback;Whole-Euler 的完整 solver capture 另见 MCPMO-GRAPH-1a/1b。 - 强制:对 #6082/#6587 的 legacy CUDA wrapper,仅在 CUDA 且显式启用时捕获 `estimator.blocks_forward_chunk`;`t_embedder`、`torch.cat`、`expand`、buffer 准备和 10-step Euler loop 保持 eager。graph key 必须包含所有输入的 shape、dtype 和 device;`cnn_cache=None` 与 `att_cache=None` 转为 graph 可接受的零值时,必须保持与 eager `[None] * depth` 的首 chunk 数值语义,重放结果和 cache 输出需 clone。 From b9dfc9980c3883025ca99be37f3ab30785d24792 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Thu, 26 Nov 2026 01:56:47 -0500 Subject: [PATCH 4/5] docs(knowledge): fix MiniCPM-o graph rule navigation --- .../components/configuration/rules-topology-profiles.md | 2 +- .../repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md | 2 +- knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md index 4574d5ad1..bcd86b594 100644 --- a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md +++ b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md @@ -67,7 +67,7 @@ confidence: high ## CONF-5g — MiniCPM-o NPU Code2Wav 开关必须按 Stage 2 传递 - 触发:修改 MiniCPM-o 4.5 bundled deploy YAML 或调整 `code2wav_enable_npu_graph`、`code2wav_max_npu_graphs`。 -- 强制:Ascend 通过 Stage 2 的 `additional_config` 投影这两个 key,并保持最终 runner outer eager;encoder/CFM/HiFT 子图边界见 [MCPMO-1f](../../models/minicpm-o-4-5/rules-code2wav-runtime.md)。用 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 核对实际 profile,包括替换而非深合并的 `additional_config` 和继承的 connector 设置。 +- 强制:Ascend 通过 Stage 2 的 `additional_config` 投影这两个 key,并保持最终 runner outer eager;encoder/CFM/HiFT 子图边界见 [MCPMO-1f](../../models/minicpm-o-4-5/rules-code2wav-runtime.md#mcpmo-1f--ascend-code2wav-保持-outer-eager按实际-inner-graph-路径验收)。用 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 核对实际 profile,包括替换而非深合并的 `additional_config` 和继承的 connector 设置。 - 禁止:把这两个 key 放进 shared connector extra、全局配置或其他 stage;用全局 eager 改变 Stage 0/1;对所有 revision 和 profile 硬编码 `PIECEWISE` 或统一 graph cap。 - 验收:按 revision 断言最终 Stage 0/1 runner 模式、Stage 2 outer eager、开关及 cap,覆盖关闭和 cap 0。含 #10595 的配置见[基底 YAML](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5.yaml#L253-L376)与[双卡 overlay](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5_2gpu.yaml#L25-L91):Stage 0/1 为 `FULL_DECODE_ONLY`;Stage 2 基底 cap=32,双 NPU overlay cap=96,Talker/Code2Wav 各两副本。断言继承后的五步 CFM 与副本/设备映射,参照[部署配置测试](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/tests/config/test_minicpmo_4_5_duplex_mrv2_deploy.py#L84-L117)。配置解析只证明投影,不是硬件资格。 ^[PR #5604] ^[PR #10595] diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md index 42cda1e82..88973d444 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md @@ -11,7 +11,7 @@ confidence: high # MiniCPM-o 4.5 Code2Wav CUDA graph 规则 本页的 MCPMO-1d/1e 记录 CUDA HiFT 与 legacy CFM step 实现的合同,不是非 CUDA 的能力矩阵。 -支持的 Ascend 内部 graph、启动门禁与 fallback 查 [Code2Wav 运行时合同(MCPMO-1f)](rules-code2wav-runtime.md)。 +支持的 Ascend 内部 graph、启动门禁与 fallback 查 [Code2Wav 运行时合同(MCPMO-1f)](rules-code2wav-runtime.md#mcpmo-1f--ascend-code2wav-保持-outer-eager按实际-inner-graph-路径验收)。 ## MCPMO-1d — HiFT graph 只捕获稳定 pre-iSTFT 子图并限界 shape cache diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md index 8308eabbe..f1e624806 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md @@ -38,8 +38,8 @@ confidence: high | tokenizer/processor、`trust_remote_code` | MCPMO-1a | pipeline/config factory → `model_executor/models/minicpmo_4_5/` loader | | TTS extra、backend 初始化、空音频 | MCPMO-1b | `minicpmo_4_5_omni_tts.py::MiniCPMO45OmniTTSForConditionalGeneration`、`minicpmo_4_5_token2wav.py::MiniCPMO45Token2wav` | | Code2Wav TensorRT、DiT/Campplus、engine cache/profile | MCPMO-1c | `minicpmo_4_5_code2wav.py::MiniCPMO45Code2Wav` → `batched_token2wav.py::BatchedToken2Wav._estimator_step`;共享实现 `step_audio2/step_audio2_dit_trt.py` | -| HiFT CUDA Graph、chunk bucket、lazy capture、iSTFT | [`MCPMO-1d`](rules-cuda-graphs.md#mcpmo-1e-legacy-step-level-cfm-dit-graph-必须按-shape-整代退休并保持-eager-parity) | `cuda_graph_wrapper.py::HiFTGraphWrapper` → `BatchedToken2Wav._hift_inference` → shared `HiFTGenerator` | -| CFM DiT CUDA Graph、shape cache、generation retirement、eager fallback | [`MCPMO-1e`](rules-cuda-graphs.md#mcpmo-1e-legacy-step-level-cfm-dit-graph-必须按-shape-整代退休并保持-eager-parity) | `cuda_graph_wrapper.py::CFMGraphWrapper` → `BatchedToken2Wav._estimator_step` | +| HiFT CUDA Graph、chunk bucket、lazy capture、iSTFT | [`MCPMO-1d`](rules-cuda-graphs.md#mcpmo-1d--hift-graph-只捕获稳定-pre-istft-子图并限界-shape-cache) | `cuda_graph_wrapper.py::HiFTGraphWrapper` → `BatchedToken2Wav._hift_inference` → shared `HiFTGenerator` | +| CFM DiT CUDA Graph、shape cache、generation retirement、eager fallback | [`MCPMO-1e`](rules-cuda-graphs.md#mcpmo-1e--legacy-step-level-cfm-dit-graph-必须按-shape-整代退休并保持-eager-parity) | `cuda_graph_wrapper.py::CFMGraphWrapper` → `BatchedToken2Wav._estimator_step` | | batch、`runtime_info`、stage handoff | MCPMO-3a/3b | `stage_input_processors/minicpmo_4_5_omni.py` → `minicpmo_4_5_omni.py::MiniCPMO45OmniForConditionalGeneration` → TTS/code2wav | | Seed-TTS、chat `ref_audio`、runtime-ref、Code2Wav handoff | [MCPMO-3e](rules-code2wav-batching.md#mcpmo-3e-minicpm-o-45-reference-audio-必须经过私有-prompt-到-code2wav-handoff) | serving chat MediaConnector → original prompt private key → `llm2tts` buffer → Code2Wav | | Talker codec sampling、repetition penalty、request RNG/compaction | MCPMO-3c | `minicpmo_4_5_omni_tts.py::{make_omni_output,_sample_audio_codes,_apply_batched_repetition_penalty}` → `test_talker_batching.py` | From a497d1789fcfcfe34be9033658effba243407adf Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Thu, 26 Nov 2026 02:11:58 -0500 Subject: [PATCH 5/5] docs(knowledge): use headings compatible with both anchor resolvers --- .../components/configuration/rules-topology-profiles.md | 2 +- .../models/minicpm-o-4-5/rules-code2wav-runtime.md | 2 +- .../vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md | 6 +++--- knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md index bcd86b594..408a13158 100644 --- a/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md +++ b/knowledge/repos/vllm-omni/components/configuration/rules-topology-profiles.md @@ -67,7 +67,7 @@ confidence: high ## CONF-5g — MiniCPM-o NPU Code2Wav 开关必须按 Stage 2 传递 - 触发:修改 MiniCPM-o 4.5 bundled deploy YAML 或调整 `code2wav_enable_npu_graph`、`code2wav_max_npu_graphs`。 -- 强制:Ascend 通过 Stage 2 的 `additional_config` 投影这两个 key,并保持最终 runner outer eager;encoder/CFM/HiFT 子图边界见 [MCPMO-1f](../../models/minicpm-o-4-5/rules-code2wav-runtime.md#mcpmo-1f--ascend-code2wav-保持-outer-eager按实际-inner-graph-路径验收)。用 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 核对实际 profile,包括替换而非深合并的 `additional_config` 和继承的 connector 设置。 +- 强制:Ascend 通过 Stage 2 的 `additional_config` 投影这两个 key,并保持最终 runner outer eager;encoder/CFM/HiFT 子图边界见 [MCPMO-1f](../../models/minicpm-o-4-5/rules-code2wav-runtime.md#mcpmo-1f-ascend-code2wav-保持-outer-eager-按实际-inner-graph-路径验收)。用 `_apply_platform_overrides` 与 `merge_pipeline_deploy` 核对实际 profile,包括替换而非深合并的 `additional_config` 和继承的 connector 设置。 - 禁止:把这两个 key 放进 shared connector extra、全局配置或其他 stage;用全局 eager 改变 Stage 0/1;对所有 revision 和 profile 硬编码 `PIECEWISE` 或统一 graph cap。 - 验收:按 revision 断言最终 Stage 0/1 runner 模式、Stage 2 outer eager、开关及 cap,覆盖关闭和 cap 0。含 #10595 的配置见[基底 YAML](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5.yaml#L253-L376)与[双卡 overlay](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/vllm_omni/deploy/minicpmo_4_5_2gpu.yaml#L25-L91):Stage 0/1 为 `FULL_DECODE_ONLY`;Stage 2 基底 cap=32,双 NPU overlay cap=96,Talker/Code2Wav 各两副本。断言继承后的五步 CFM 与副本/设备映射,参照[部署配置测试](https://github.com/vllm-project/vllm-omni/blob/94de758f0678bb8d5e770349c463f1f267a91f20/tests/config/test_minicpmo_4_5_duplex_mrv2_deploy.py#L84-L117)。配置解析只证明投影,不是硬件资格。 ^[PR #5604] ^[PR #10595] diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md index ad60af31d..0cea8bf4b 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-code2wav-runtime.md @@ -12,7 +12,7 @@ confidence: high 入口与其他规则见 [共享规则](rules.md)。 -## MCPMO-1f — Ascend Code2Wav 保持 outer eager,按实际 inner graph 路径验收 +## MCPMO-1f Ascend Code2Wav 保持 outer eager 按实际 inner graph 路径验收 - 触发:MiniCPM-o 4.5 在 Ascend 上修改 Code2Wav、CFM estimator、NPUGraph 开关、图缓存或 bundled deploy profile。 - 强制:Stage 2 的 runner 保持 `enforce_eager: true`;这不关闭模型内部的设备 graph。早期 #5604 的 platform exact-step 路径只捕获 `blocks_forward_chunk`,cached/uncached shape 分桶;含 #10595 的 runtime 可在 NPU 上使用共享 CFM Whole-Euler/step wrapper,也可分别启用 Flow encoder 和 HiFT 子图。按当前 dispatch 区分这些路径:支持时在模型内部捕获有界子图,请求解析、request-owned state 提交和未捕获部分留在外层。带 capture 的 NPU runtime 仍需在 Token2Wav 加载前配置 `allow_internal_format=False`、`jit_compile=False` 并拒绝 `ASCEND_LAUNCH_BLOCKING=1`;SDPA 限制按实际路径验证;启用且设备为 NPU 时,缺少所需 graph API 可使加载报错,不是未命中 bucket 时的 eager 回退。 diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md index 88973d444..3bb3e91bd 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules-cuda-graphs.md @@ -11,9 +11,9 @@ confidence: high # MiniCPM-o 4.5 Code2Wav CUDA graph 规则 本页的 MCPMO-1d/1e 记录 CUDA HiFT 与 legacy CFM step 实现的合同,不是非 CUDA 的能力矩阵。 -支持的 Ascend 内部 graph、启动门禁与 fallback 查 [Code2Wav 运行时合同(MCPMO-1f)](rules-code2wav-runtime.md#mcpmo-1f--ascend-code2wav-保持-outer-eager按实际-inner-graph-路径验收)。 +支持的 Ascend 内部 graph、启动门禁与 fallback 查 [Code2Wav 运行时合同(MCPMO-1f)](rules-code2wav-runtime.md#mcpmo-1f-ascend-code2wav-保持-outer-eager-按实际-inner-graph-路径验收)。 -## MCPMO-1d — HiFT graph 只捕获稳定 pre-iSTFT 子图并限界 shape cache +## MCPMO-1d HiFT graph 只捕获稳定 pre-iSTFT 子图并限界 shape cache - 触发:CUDA HiFT 路径的 `enable_hift_graph`、capture batch/chunk 配置、HiFT inference 分段或 streaming cache shape。 - 强制:#5869 的 CUDA-only 实现仅接受 CUDA parameter device,其非 CUDA 分支回 eager;不要把这个历史门禁当作后续共享 wrapper 的设备白名单。CUDA capture bucket 由 codec chunk、left context、Flow lookahead、token→mel ratio 与 mel/source cache 推导;新版在首个 forward 的预捕阶段准备 uncached/cached、initial 和配置的 exact shape;只有合法 capture buckets 的缺失 graph 可 lazy capture(默认上限 8),未知 final shape、超限或无法容纳 batch 时回 eager。active stream capture 中禁止嵌套 capture/replay并回 eager;静态输入先清零再复制真实 batch,输出 slice 后 clone。 @@ -21,7 +21,7 @@ confidence: high - 禁止:无 connector 配置、非正 chunk、负 left context、source/mel cache 不整除时静默 capture;不核对新版 exact initial/continuation 配置就将 `initial_codec_chunk_frames` 当已预捕(旧版仅 lazy capture,新版预捕合同见 MCPMO-GRAPH-1e);把 lazy graph limit 说成总显存上界,因为启动 graphs、global pool、static tensors 与其他 graph owners 仍驻留。active-capture 分支虽绕过 nested replay,却调用完整 eager decode(native ISTFT 或 cached envelope 首次 miss 仍可能 NOLA sync);未做真实 outer-graph 测试前,不能把日志中的 “fallback” 当成可捕获保证。custom `capture_batch_sizes` 也尚未校验正数/去重。 - 验收:CUDA test 比较 cached/uncached graph 与 eager,CPU/mock 覆盖 lazy capture/limit fallback,deploy test 固定默认开关;回归 #5869 CUDA-only 实现时验证其非 CUDA disable;当前设备路径按相应 backend 验证。另测 invalid config、unsupported batch、nested capture 和 variable final chunk。static input/output 与 lazy graph map 为无锁可变状态;并发 replay/capture 需先证明被上层串行化或增加互斥与重叠调用测试。PR 的单 A800 profile 约 30→5 ms/chunk、250→43 ms/request,只绑定部分 graph、单 prompt/commit `8fa28d88`,无 repeats/端到端质量,不能泛化为稳定 speedup。^[PR #5869] ^[PR #8443] ^[PR #8222] -## MCPMO-1e — legacy step-level CFM DiT Graph 必须按 shape 整代退休并保持 eager parity +## MCPMO-1e legacy step-level CFM DiT Graph 必须按 shape 整代退休并保持 eager parity - 触发:修改 MiniCPM-o 4.5 Code2Wav legacy CUDA step-level CFM DiT estimator 的 `blocks_forward_chunk` graph target、按 shape 捕获/重放、cache retirement 或 eager fallback;Whole-Euler 的完整 solver capture 另见 MCPMO-GRAPH-1a/1b。 - 强制:对 #6082/#6587 的 legacy CUDA wrapper,仅在 CUDA 且显式启用时捕获 `estimator.blocks_forward_chunk`;`t_embedder`、`torch.cat`、`expand`、buffer 准备和 10-step Euler loop 保持 eager。graph key 必须包含所有输入的 shape、dtype 和 device;`cnn_cache=None` 与 `att_cache=None` 转为 graph 可接受的零值时,必须保持与 eager `[None] * depth` 的首 chunk 数值语义,重放结果和 cache 输出需 clone。 diff --git a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md index f1e624806..16bfd37fe 100644 --- a/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md +++ b/knowledge/repos/vllm-omni/models/minicpm-o-4-5/rules.md @@ -38,8 +38,8 @@ confidence: high | tokenizer/processor、`trust_remote_code` | MCPMO-1a | pipeline/config factory → `model_executor/models/minicpmo_4_5/` loader | | TTS extra、backend 初始化、空音频 | MCPMO-1b | `minicpmo_4_5_omni_tts.py::MiniCPMO45OmniTTSForConditionalGeneration`、`minicpmo_4_5_token2wav.py::MiniCPMO45Token2wav` | | Code2Wav TensorRT、DiT/Campplus、engine cache/profile | MCPMO-1c | `minicpmo_4_5_code2wav.py::MiniCPMO45Code2Wav` → `batched_token2wav.py::BatchedToken2Wav._estimator_step`;共享实现 `step_audio2/step_audio2_dit_trt.py` | -| HiFT CUDA Graph、chunk bucket、lazy capture、iSTFT | [`MCPMO-1d`](rules-cuda-graphs.md#mcpmo-1d--hift-graph-只捕获稳定-pre-istft-子图并限界-shape-cache) | `cuda_graph_wrapper.py::HiFTGraphWrapper` → `BatchedToken2Wav._hift_inference` → shared `HiFTGenerator` | -| CFM DiT CUDA Graph、shape cache、generation retirement、eager fallback | [`MCPMO-1e`](rules-cuda-graphs.md#mcpmo-1e--legacy-step-level-cfm-dit-graph-必须按-shape-整代退休并保持-eager-parity) | `cuda_graph_wrapper.py::CFMGraphWrapper` → `BatchedToken2Wav._estimator_step` | +| HiFT CUDA Graph、chunk bucket、lazy capture、iSTFT | [`MCPMO-1d`](rules-cuda-graphs.md#mcpmo-1d-hift-graph-只捕获稳定-pre-istft-子图并限界-shape-cache) | `cuda_graph_wrapper.py::HiFTGraphWrapper` → `BatchedToken2Wav._hift_inference` → shared `HiFTGenerator` | +| CFM DiT CUDA Graph、shape cache、generation retirement、eager fallback | [`MCPMO-1e`](rules-cuda-graphs.md#mcpmo-1e-legacy-step-level-cfm-dit-graph-必须按-shape-整代退休并保持-eager-parity) | `cuda_graph_wrapper.py::CFMGraphWrapper` → `BatchedToken2Wav._estimator_step` | | batch、`runtime_info`、stage handoff | MCPMO-3a/3b | `stage_input_processors/minicpmo_4_5_omni.py` → `minicpmo_4_5_omni.py::MiniCPMO45OmniForConditionalGeneration` → TTS/code2wav | | Seed-TTS、chat `ref_audio`、runtime-ref、Code2Wav handoff | [MCPMO-3e](rules-code2wav-batching.md#mcpmo-3e-minicpm-o-45-reference-audio-必须经过私有-prompt-到-code2wav-handoff) | serving chat MediaConnector → original prompt private key → `llm2tts` buffer → Code2Wav | | Talker codec sampling、repetition penalty、request RNG/compaction | MCPMO-3c | `minicpmo_4_5_omni_tts.py::{make_omni_output,_sample_audio_codes,_apply_batched_repetition_penalty}` → `test_talker_batching.py` |