[None][chore] Core: MoE backend enum, deepgemm JIT warmup, postproc metrics, cleanup - #19186
reasonsolo wants to merge 4 commits into
Conversation
…etrics, cleanup Ports the non-Rubin-specific core changes from the internal Rubin branch. Public API / config: - Add "CUTEDSL_FC12" to MoeConfig.backend. The backend implementation (CuteDslFc12FusedMoE + moe_resolution registration) lands separately; this only opens the config gate. llm_args_golden_manifest.json is updated to match. Autotune / JIT warmup: - Add deep_gemm_jit_warmup_buckets() and use it for the two DeepGemm runners whose only purpose is to drive JIT warmup. A step-16 M grid over the whole range is required: the SM100 layout heuristic selects on ceil_div(m, block_m) with every candidate block_m a multiple of 16, and the last-wave-utilization tie-break keeps oscillating at high M, so a coarse high-M band silently skips layouts that then compile mid-inference (nvcc fork under the GIL, stalling every attention-DP rank). Fp8BlockScalingGemmRunner also gets exclude_from_cache so a warm disk cache cannot short-circuit the warmup. Executor: - Propagate decoding_iter, avg_decoded_tokens_per_iter and cached_tokens through PostprocWorker.Output, so a result served by a postproc worker reports the same metrics as the in-process path. - When TRTLLM_WORKER_DISABLE_GC=1, also disable dynamo's post-compile gc.collect(1): with automatic GC off it walks every object allocated since the previous compile, costing seconds per recompile. Models: - Kimi K2.5: replicate the vision tower whenever cp_size > 1. Helix carries its parallelism in cp with tp_size=1, so the existing tp-only check never fired and the folded world size collapsed below the rank range. - dwdp: resolve the MoE wrapper model-agnostically, so Kimi K3's block_sparse_moe/routed_experts spelling is handled alongside DeepSeek's mlp/experts. Misc: - CuTe DSL compatibility shim for legacy cute.core.ThrCopy/ThrMma and cute.make_fragment, needed by QuACK and Transformer Engine against the pinned CUTLASS DSL. - Drop the unused <ATen/native/cuda/Resize.h> include from six thop GEMM translation units. - Do not fail collection of tests/integration/defs when torch._inductor is unavailable. - Unit test for submit.py's replace_env_in_file. Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
…ackend
PR5 adds `CUTEDSL_FC12` to the `MoeConfig.backend` literal, but
`create_moe_backend` matched the CuteDSL branch by class identity:
elif moe_cls in (CuteDslFusedMoE, CuteDslB12xFusedMoE):
`CuteDslFc12FusedMoE` subclasses `CuteDslFusedMoE` and takes the same
argument set, so selecting the newly-legal backend string would fall
through to the `Unsupported moe backend` raise.
Match by `issubclass`, as the DeepGEMM and MegaMoE branches below
already do for the same reason. Every class dispatched after this
branch derives from `MoEImplBase` / `MoE`, so the wider match steals
nothing; with no CuteDSL subclass on this branch the change is inert
until the FC12 backend lands.
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
f7f9889 to
ec8d259
Compare
The pre-quantized FP8 path in Linear.apply selects
torch.ops.trtllm.fp8_prequantized_swap_ab_gemm whenever the activation
scale is int32 on SM100f with deep_gemm enabled, but no registration for
that op exists. Without it every DeepSeek V4 run on GB200/GB300 aborts
during executor init:
AttributeError: '_OpNamespace' 'trtllm' object has no attribute
'fp8_prequantized_swap_ab_gemm'
Unlike fp8_swap_ab_gemm, the activation and its packed scale both carry the
M dimension, so the tuning config ties input 1 dim 0 to input 0 dim 0, and
the runner restores the MN-major packed-scale stride that DeepGemm requires
after the autotuner recreates the constrained integer tensor contiguously.
Verified on GB300: the DeepSeek V4 DSpark disaggregated accuracy guard
(1p1d, DEP4) reaches GSM8K 96.21 with this op present and fails at executor
init without it.
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
|
Added Why this PR: Two details that differ from the sibling Validated on GB300 (oci-jhb): the DeepSeek V4 DSpark disaggregated accuracy guard (1p1d DEP4, 2 nodes) reaches GSM8K 96.21 with this op present, and fails at executor init without it. |
…eries The CuteDslFc12FusedMoE backend has been removed from the MoE PR: the custom op it drives was lost in the rebase, so it could never be selected. Nothing in this series consumes the backend string, so the enum value would be a `MoeConfig.backend` literal that resolves to an empty candidate list. Removes "CUTEDSL_FC12" from the literal and from the golden manifest, and reverts ec8d259 -- the `issubclass` dispatch in create_moe_backend existed only so the FC12 subclass would not fall through to the "Unsupported moe backend" raise. With no CuteDSL subclass in the tree the identity check is exact again. Both come back with the backend and its op. Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
|
Closing — the content of this PR is now consolidated into #19183, which also carries the sibling core/runtime work. Everything here that upstream had not already absorbed survives there: the disagg and KV-cache-v2 regression tests and the V2 draft-KV |
Description
Core/shared changes from the Rubin merge-back series.
MoeConfig.backendgains"CUTEDSL_FC12"plus the regeneratedllm_args_golden_manifest.json. Its consumer,moe_resolution.py→CuteDslFc12FusedMoE, lands in the MoE PR of this series.deep_gemm_jit_warmup_bucketsin_torch/utils.pyand both call sites intorch_custom_ops.py. The pre-existingdeep_gemm_gen_tuning_bucketsis untouched.executor/result.py) and a dynamo-GC fix (executor/worker.py).main's own code:dwdp/setup.py(K3 does useblock_sparse_moe/routed_experts) andmodeling_kimi_k25.py(_get_vision_tp_mappingignoredcp_size).tensorrt_llm/__init__.py.Scope: 18 of 30 candidate files
Twelve were dropped after verification. The notable ones:
compilation/patterns/residual_add_norm.pyandcompilation/utils.py—mainalready has the fix.compilation/patterns/__init__.py:24defines_make_pattern_example_inputswith the same Torch 2.13+_trace_args_for_initial_tracerationale, and derives arity fromsignature(search_fn)rather than hardcoding dummies. Strictly better than the Rubin version; nothing to port.uses_spcompresswould raiseTypeError—SkipSoftmaxParamsis a frozen dataclass whose only fields arealgorithmandscheduler, onmainand on the Rubin branch.use_lamport_synchas no reader anywhere on either branch.enable_ugpuhas no consumer on either branch.test_py_executor.py— six new cases callPyExecutor._terminate_attention_dp_dummy_requests, which does not exist onmain; they would fail at collection.accuracy_core.py— thecreate_evaluator/prepared_evaluatorrefactor has zero callers even on the Rubin branch.main.A new
allowed_valuesmember on a telemetry-captured categorical field is a manifest change, so telemetry/privacy CODEOWNER review applies.tests/unittest/api_stability/references/llm.yamlrecords only the annotation, not the Literal members, so no api_stability reference update is needed.Known limitations
tensorrt_llm/__init__.pyruns at import time for every install. It is guarded bytry: import cutlass.cute / except ImportError: returnplushasattrchecks and should be inert when the pinned DSL already exposes the modern names, but that could not be confirmed here and it is on the hot path for all users.dwdp/setup.pyandmodeling_kimi_k25.pyare multi-GPU paths that could not be exercised.PR Checklist
MoeConfig.backendenum member) —api-compatible, additive only🤖 Generated with Claude Code