fix(mla): use packaged compact KV cache writer - #129
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe MLA backend now uses the packaged b12x FP8 RoPE KV-cache writer when enabled, while preserving the stock path otherwise. New tests cover argument forwarding, dtype and empty-cache behavior, missing APIs, and initialization failures. ChangesFP8 RoPE writer integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant B12xMLASparseImpl
participant b12x_writer as b12x FP8 RoPE writer
participant KVCache as KV cache tensors
B12xMLASparseImpl->>b12x_writer: invoke concat_and_cache_nvfp4_mla_fp8_rope
b12x_writer->>KVCache: update NVFP4 cache
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
CI note: |
80a725f
into
local-inference-lab:dev/gilded-gnosis
Dependency
Requires local-inference-lab/b12x#37, which adds the public compact-cache writer API.
Summary
KV_FP8_ROPE=1external shared-library loader withb12x.attention.mla.kv_cache.concat_and_cache_nvfp4_mla_fp8_ropeB12xMLASparseImplconstruction only when the compact 368-byte cache format is enabledKV_FP8_ROPE=0stockops.concat_and_cache_mlapath without importing the new b12x submodulek_scaleobject to the package APIThis removes the deployment-only
KV_FP8_ROPE_WRITER_LIBandtorch.ops.load_librarydependency. The ordinary 432-byte writer and allKV_FP8_ROPE=0behavior remain unchanged.Compatibility and rollout
This PR must land with a b12x revision containing b12x#37. With an older b12x package,
KV_FP8_ROPE=1raises a targeted startup error rather than silently falling back to the stock 432-byte writer. Disabled deployments do not import the new submodule and continue through the existing stock writer.This is a package-boundary correction, not a new performance candidate; no serving-throughput claim is made. The writer bytes and both production reader families are covered in b12x#37.
Test plan
pytest tests/v1/attention/test_b12x_mla_fp8_rope_writer.py -vv— 6 passed in the gg-v18 Python 3.12 / torch environmentruff check vllm/v1/attention/backends/mla/b12x_mla_sparse.py tests/v1/attention/test_b12x_mla_fp8_rope_writer.py— passed with the repository-pinned ruff 0.14.0ruff format --check vllm/v1/attention/backends/mla/b12x_mla_sparse.py tests/v1/attention/test_b12x_mla_fp8_rope_writer.py— passedSummary by CodeRabbit
New Features
Bug Fixes
Tests