fix(mla): keep DCP outputs head-major for safe BMM - #147
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6a2edcf
into
local-inference-lab:dev/gilded-gnosis
Summary
Fixes the GLM MLA DCP output layout so the V up-projection BMM no longer consumes a strided view backed by tight DCP/A2A allocation memory.
This is the vLLM side of the fix. It depends on
local-inference-lab/sparkinfer#54, which teaches the PCIe DCP pool and sparse MLA scratch planner to accept/write head-major BHD views.Root Cause
A guarded repro showed that cuBLAS can read ahead to the next 64 KiB boundary for the
_v_up_projstridedtorch.bmmpattern. That is normally safe with PyTorch caching allocator segments, but unsafe when the DCP producer returns a tight custom/IPC allocation with no mapped tail page.The rejected alternatives were:
_v_up_proj: correct, but adds decode-copy overhead;This PR keeps the logical tensor contract as BHD, but makes DCP outputs physically head-major.
_v_up_projthen gets the same logical shape while its head-major transpose is backed by safe contiguous storage, without adding a hot-path clone.Changes
reduce_scatter_head_majorto the DCP group coordinator and CUDA communicator.cp_lse_ag_out_rsfor MLA DCP merge output.Validation
Targeted tests:
tests/distributed/test_dcp_a2a.py::test_b12x_lse_reduce_preserves_supported_layouts,tests/v1/attention/test_b12x_mla_dcp_workspace.py::test_cp_lse_ag_out_rs_requests_head_major_output-> passedvllm._C_stable_libtorchextension; the same test passed earlier in the overlay image built from this patch stack.E2E overlay validation on 8x RTX PRO 6000 Blackwell, GLM 5.2 Luke NVFP4, TP8, MTP0, A16,
MAX_NUM_SEQS=1,GRAPH=6, InstantTensor:Kernel/server log checks after long-context smoke found no
Xid,FAULT,illegal,CUBLAS,CUDA error, or traceback entries.