Repository navigation
Conversation
Signed-off-by: Yuxian Qiu <142763828+yuxianq@users.noreply.github.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
This branch has not been deployed
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.
📌 Description
Moves general PrimTS functionality out of TensorRT-LLM's persistent compatibility patch and into FlashInfer:
The prepared fast path is restricted to native D512, fixed single-token queries, host scales, caller-provided BF16 output, and no returned/caller-provided LSE or output quantization. Other configurations retain the full run path. Existing kernel math and public signatures are unchanged.
Measured on a B300 PCIe allocation (SM103; the driver reports
NVIDIA Graphics Device), BF16, one KV pool, Q length 1.benchmarks/bench_prims_ts_sparse_mla_host.pyuses preallocated output, 20 warm-ups, and the median of five sets of 500 calls. Baseline:9da5a602ae4cd6bd0823fd77abafa65f96136adc.These are host submission/completed eager measurements, not pure GPU kernel times or model throughput. Reproduce by running the script with
PYTHONPATHselecting each checkout, using--rows 4 --heads 16 --topk 128and--rows 16 --heads 64 --topk 256.🔍 Related Issues
Extracted from TensorRT-LLM
3rdparty/vendor_patches/flashinfer-prims-ts.patch. The companion consumer PR NVIDIA/TensorRT-LLM#21337 pins a backport onto its existing source revision, avoiding an unrelated full vendor refresh.🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commitby runningpip install pre-commit(or used your preferred method).pre-commit install.pre-commit run --all-filesand fixed any reported issues.🧪 Tests
unittest, etc.).Reason:
Validated:
--all-fileswas not run; the full test suite was not run.Suggested CI targets:
tests/cpu/attention/test_prims_ts_cache.py tests/attention/test_attention_ts_cache_lifecycle.py tests/attention/test_attention_ts_features.py tests/attention/test_attention_ts_sparse_mla.py🔬 Experimental Track
flashinfer/experimental/and/or an@flashinfer_experimental_api. Tracking issue: #tests/experimental/and were validated on the intended hardware; a runnable example is included.flashinfer/aot.py, and no experimental backend is reachable frombackend="auto"withoutFLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1. (Calling an@flashinfer_experimental_apior naming a backend explicitly is itself the opt-in and needs no environment variable.)Reviewer Notes
This uses the normal review path for existing PrimTS code and adds no public API or automatic backend selection. The companion backport retains TRT-LLM's older sparse MLA argument names and scalar ABI. The positional output-quantization launch fix is already on main (see #6774); it is retained only in that backport.
The forced D576 split test clears the geometry memo around its policy override so each requested split remains exercised.