[DSA] Support group-scaled FP8 NoPE KV reads for CUDA TileLang - #39349
Draft
HanHan009527 wants to merge 3 commits into
Draft
HanHan009527 wants to merge 3 commits into
HanHan009527 wants to merge 3 commits into
Conversation
Extend the existing full and paged readers to 528-byte rows, bound sparse dequantization by the smaller of the physical pool and selected rows, and connect the BF16 TileLang consumer. Permit only matching TileLang phases with BF16 latent512/RoPE0 queries and DCP size 1 through the production backend validation entry point. Extract the reader and consumer slice from the GLM integration at abd9742 onto upstream main ad5af53. Retain HIP backend constraints and the existing 656-byte format. Add scale, index mapping, graph replay, consumer, and startup validation coverage. Review scope: invalid-index attention masking, variable KPool width, cached-prefix dispatch, and full GLM PD serving validation remain separate dependencies. No standalone performance gain is claimed.
Place the test under kernel/attention and propagate pytest exit status when invoked by the registered test runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
CUDA TileLang DSA cannot currently consume group-scaled FP8 NoPE KV rows: the existing dequantization helpers require the 656-byte RoPE layout, and startup validation rejects FP8 TileLang on CUDA. This draft adds a reader and BF16 consumer path for the 528-byte layout already produced by the upstream writer: 512 FP8 values and four FP32 scales per token.
Related to #36830. This is one consumer capability toward GLM NoPE FP8 support; complete model-serving support is not established by this draft.
Modifications
min(physical_tokens, selected_entries) * 1024bytes, with no data-dependent unique operation or host synchronization._check_dsa_backend_constraintsentry point only for BF16 latent512/RoPE0 queries, both DSA phases using TileLang, and DCP size 1. Preserve HIP restrictions and reject mixed backend pairs and HiSparse FP8 TileLang.This reuses upstream storage and writer code. It does not add a new cache-layout option, change backend defaults, or include raw512, native FP8 attention, H16, or HIP kernels.
Accuracy Tests
Validated source
9a576563fd880a550fcfa1fcd90dbafd72b5ae10, based on mainad5af539cd39e9af10ef318d3f8a50f5d6f9c153, in a Kubernetes Pod with one NVIDIA H20 (SM90). The Pod checked out the pushed commit and installed that checkout as an editable package. Python 3.12.3, PyTorch 2.13.0+cu130, Triton 3.7.1, TileLang 0.1.12.24 tests and 15 subtests passed. Coverage includes both layouts, scale words, duplicate indices, empty selection, invalid-mask preservation in the selected reader, startup constraints, and fixed-width valid-index reader→TileLang execution. CUDA Graph replay tests change indices, queries, and scale data. Configured pre-commit checks and
git diff --checkpass.This remains a draft for review:
4c71d14fbab6864a0dd7d3c77c5326ccc708baddis conflict-free, but this branch has not been rebased or runtime-validated on that base.Speed Tests and Profiling
No standalone speedup is claimed. The bounded BF16 payload allocation above describes the reader's allocation strategy; it is not an end-to-end memory or latency measurement.
Checklist
Developed with AI assistance.
CI States
Latest PR Test (Base): ❌ Run #34802586908
Latest PR Test (Extra): ❌ Run #34802586726
Latest PR Test (AMD ROCm 10): ❌ Run #34802586929