Repository navigation
Conversation
…key on UMA GPUs `load_expert_w3_w1_weight` and `load_expert_w3_w1_weight_scale_nvfp4` in the CUTLASS NVFP4 fused-MoE path key a per-expert accumulator dict by `(dst.storage().data_ptr(), expert_idx)`. The `.storage()` call constructs a (deprecated) `TypedStorage` Python wrapper around the underlying ATen storage. On integrated GPU with UMA-backed CUDA storage (e.g. NVIDIA GB10/sm_121), that wrapper construction calls into NVRM to query device properties for the storage; the call enters a memory handshake ioctl loop that does not terminate. Cold-start hangs at "Loading weights concurrently: 0/1288" with one worker thread at 100% CPU spinning on `ioctl(_, _IOC(R|W, 0x46, 0x2a, 0x20), …) = 0`. The TypedStorage deprecation warning is logged immediately above the hang site, confirming the trip is in wrapper construction. Switch the key value to `tensor.data_ptr()`. This returns the same disambiguating value -- different storage allocations (regular vs shared experts pointing at different dst buffers) have different data pointers -- without going through the Storage wrapper. The consumer in `process_weights_after_loading()` iterates the dict via `.values()` and never looks up by key, so the key only needs to correctly partition calls into `setdefault`, both choices satisfy that. End-to-end validated on GB10 / sm_121a by the issue reporter (zentradev-rabih in NVIDIA#14500): rc15 + this patch cold-starts in ~5 min (parity with rc12), serves a 20-minute soak at 10-concurrent/8-slot-batch with 15 % cancellation, zero engine deaths, zero cancel hangs. Signed-off-by: Samaresh Kumar Singh <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR fixes a TypedStorage deprecation issue in NVFP4 fused-MoE weight loading that was causing hangs on integrated GPUs (sm_121). The cache key derivation is updated from ChangesNVFP4 Cache Key Derivation Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #51677 [ run ] triggered by Bot. Commit: |
|
PR_Github #51677 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #52123 [ run ] triggered by Bot. Commit: |
|
PR_Github #52123 [ run ] completed with state
|
|
@ssam18 this pull request has had no activity for more than 120 days and currently has merge conflicts. Is it still active? Please resolve the conflicts or post an update. Otherwise, it will be closed after another 60 days of inactivity. |
Summary
load_expert_w3_w1_weightandload_expert_w3_w1_weight_scale_nvfp4in the CUTLASS NVFP4 fused-MoE path key a per-expert accumulator dict by(dst.storage().data_ptr(), expert_idx). The.storage()call constructs a (deprecated)TypedStoragePython wrapper around the underlying ATen storage.On integrated GPU with UMA-backed CUDA storage (NVIDIA GB10 / sm_121, Grace-Blackwell), that wrapper construction calls into NVRM to query device properties for the storage. The call enters a memory-handshake ioctl loop that does not terminate. Cold-start hangs at
Loading weights concurrently: 0/1288with one worker thread at 100 % CPU spinning onioctl(_, _IOC(R|W, 0x46, 0x2a, 0x20), …) = 0. TheTypedStorage is deprecatedwarning is logged immediately above the hang site, confirming the trip is in the wrapper construction.Change
Two-line swap at the two affected sites in
tensorrt_llm/_torch/modules/fused_moe/quantization.py:tensor.data_ptr()returns the same disambiguating value — different storage allocations (regular vs shared experts pointing at different dst buffers) have different data pointers — without going through the Storage wrapper. The consumer inprocess_weights_after_loading()iterates the dict via.values()and never looks up by key, so the key only needs to correctly partition calls intosetdefault; both choices satisfy that.Added an explanatory comment above the first site (with the second referring back to it) so a future reviewer understands why this isn't just stylistic preference.
End-to-end validation
The issue reporter (@zentradev-rabih) validated this patch on GB10 / sm_121a hardware in issue #14500:
I don't have GB10 hardware myself; the validation above is the reporter's. The change is a two-line swap that is reversible if any unforeseen issue surfaces in CI.
Notes for reviewers
Scope: Only the CUTLASS NVFP4 MoE path is touched. Discrete-GPU NVFP4 loading and all other backends are unaffected —
tensor.data_ptr()works identically on discrete-GPU CUDA tensors and was always a cheaper call thantensor.storage().data_ptr().Why this happens specifically on integrated GPU: the
Skipping device transfer from cpu to cuda on integrated GPU to conserve shared memorylog immediately above the hang site indicatesdst_w3_w1_weightstays host/UMA-backed. TheTypedStoragewrapper construction on UMA-backed CUDA storage is what trips NVRM; on discrete GPU the same wrapper construction completes quickly because the device-property query is cached differently.Bisect: the per-expert dict-accumulation pattern was introduced between rc12 and HEAD (likely
f15af81EPLB host memory reduction or1f5339fshared-expert index fix). The fix doesn't depend on which commit introduced the pattern — both call sites swap independently.Companion issue: the reporter found a second, separate failure mode when re-enabling MTP on rc15 + this patch (CUTLASS sm_120 grouped-GEMM init → SMEM shortfall → Triton fallback emits
.rsPTX rejected by PTXAS on sm_121a). Tracked at1.3.0rc15on sm_121a / GB10: MTP path fails — CUTLASS sm_120 grouped-GEMM init → SMEM shortfall → Triton fallback emits.rsPTX rejected by PTXAS #14575, out of scope for this PR. Fixes1.3.0rc15: trtllm-serve hangs in fused_moe/quantization.py during cold-start on GB10 / sm_121 —1.3.0rc12works with identical config #14500.Summary by CodeRabbit
Release Notes