Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: foraxe <ningyunxiao.nyx@antgroup.com>
Signed-off-by: foraxe <ningyunxiao.nyx@antgroup.com>
Member
Author
|
Thanks @zyongye , appreciate it |
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.
Summary
Add independently optional
out_fp8andout_sfdestinations to the fused sparse prefill/decode wrappers and stable torch operator ABI. Existing callers retain allocating behavior. Supplied buffers are checked for device, dtype, shape, contiguous FP8 values, and the packed scale strides needed by the kernel; token slices of larger scale buffers are supported.This supplies the output-ownership contract needed when fused attention runs in an eager portion of a breakable CUDA graph and its FP8 consumer is captured afterwards. The kernel math and the other returned statistics are unchanged.
Related work
Extends the output-buffer support previously added for ordinary sparse/dense attention in #13 to the fused V4.1 APIs introduced by #20. No open fused-output-buffer PR was found in this repository or the DeepSeek upstream search. The vLLM consumer prototype builds on vllm-project/vllm#56344; this PR contains only the native API and its tests.
Validation
On GB200, Torch 2.13 / CUDA 13, with the inference extension built for SM100a:
27 passed. Coverage includes allocating/provided output equality, independently omitted destinations, head counts 64/128, sliced scale buffers and neighboring-row guards, invalid device/dtype/shape/strides, CUDA graph replay with changing inputs, and the FP4 secondary KV cache.
A separate vLLM integration prototype captures
wo_aafter the eager boundary using these destinations. Its TP4 A/B/B/A check preserved every generated token and mixed-request output; the 17-token piecewise-prefill TTFT median changed from 41.85 to 36.92 ms (11.8%). Default FULL decode already captureswo_a, and TPOT stayed within 0.21%; no decode or long-context speedup is claimed. This result belongs to the combined integration, not to the native API alone.Report, raw results, test log, reproducible drivers, and checksums. Measured vLLM prototype diff. The final follow-up also preserves the original direct-output split-KV fallback to avoid copy overhead.
AI assistance: implementation, tests, and investigation used OpenAI Codex.