Repository navigation
[fly][qsa] add QSA prefill(attention+indexer) for 308 - #57
Merged
Merged
Conversation
Preserve dense2051, packed direct with the 64 MiB budget, and pad1.7/raw-rho4 routing while keeping QSA 3D-only. Bound compact membership scans and replace the scratch-using Torch validation reduction without weakening async input checks. Extend boundary, graph and actual-ELF resource regressions; document performance, rollback history and limitations. Validated 63 normal QSA tests and 54 full-chain resource cases (570 dispatches), plus 72 standalone-package dispatches. All 53 valid full-call performance cases remain within the predeclared 3% threshold; one timing gate and the kernel-share profile gate remain failed and unretired.
luocheng25
force-pushed
the
luocheng/qsa-308
branch
from
September 30, 2026 09:03
a04b9ba to
d780b7d
Compare
apinge
reviewed
Oct 7, 2026
sammysun0711
reviewed
Oct 8, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Fresh-cache attention calls skip execution, and the documented SGLang decode integration does not match the exported API.
4 open findings
What changed in this PR
Adds gfx942/MI308 QSA prefill attention and prefill/decode indexing, with D256 MHA support, validation, tests, and benchmarking utilities.
Changes:
- Adds sparse QSA attention and indexer kernels.
- Introduces shared D256 FlyDSL MHA infrastructure.
- Adds correctness, graph-replay, and performance coverage.
| File | Description |
|---|---|
| README.md | Documents QSA and MHA operators. |
| benchmarks/README.md | Links QSA benchmarks. |
| benchmarks/qsa/__init__.py | Defines benchmark package. |
| benchmarks/qsa/_synthetic.py | Generates synthetic QSA workloads. |
| benchmarks/qsa/readme.md | Documents benchmark usage. |
| benchmarks/qsa/test_attention.py | Benchmarks attention branches. |
| benchmarks/qsa/test_indexer.py | Benchmarks indexer operations. |
| experiments/attention/flydsl/flash_attn_api/README.md | Documents D256 varlen API. |
| experiments/attention/flydsl/mha/README.md | Records D256 design and results. |
| experiments/attention/flydsl/mha/_common.py | Bridges shared installed helpers. |
| experiments/attention/flydsl/mha/mha_pa_bf16_256_linear_942.py | Bridges linear D256 implementation. |
| experiments/attention/flydsl/mha/mha_pa_bf16_256_paged_942.py | Adds paged D256 kernel. |
| experiments/attention/flydsl/mha/mha_pa_bf16_942.py | Exposes D256 paged/linear APIs. |
| experiments/attention/flydsl/mha/mha_pa_fp8_942.py | Adds MFMA hazard wait. |
| experiments/attention/flydsl/mha/test_mha_pa.py | Expands D256 coverage. |
| src/pyhip/ops/mha/__init__.py | Defines MHA package. |
| src/pyhip/ops/mha/flydsl/__init__.py | Defines FlyDSL MHA package. |
| src/pyhip/ops/mha/flydsl/_common.py | Adds shared device helpers. |
| src/pyhip/ops/mha/flydsl/mha_pa_bf16_256_linear_942.py | Implements linear D256 attention. |
| src/pyhip/ops/qsa/__init__.py | Defines QSA package. |
| src/pyhip/ops/qsa/flydsl/__init__.py | Defines FlyDSL QSA package. |
| src/pyhip/ops/qsa/flydsl/attention.py | Provides public sparse attention. |
| src/pyhip/ops/qsa/flydsl/attention_direct.py | Implements direct attention planning. |
| src/pyhip/ops/qsa/flydsl/attention_direct_packed.py | Implements packed direct attention. |
| src/pyhip/ops/qsa/flydsl/attention_prepare.py | Prepares sparse attention plans. |
| src/pyhip/ops/qsa/flydsl/attention_union.py | Implements union attention. |
| src/pyhip/ops/qsa/flydsl/indexer.py | Provides indexer APIs. |
| src/pyhip/ops/qsa/flydsl/indexer_decode.py | Implements decode logits. |
| src/pyhip/ops/qsa/flydsl/indexer_logits.py | Implements prefill logits. |
| src/pyhip/ops/qsa/flydsl/indexer_topk.py | Implements top-k selection. |
| src/pyhip/testing/qsa_reference.py | Adds independent attention reference. |
| tests/README.md | Documents QSA tests. |
| tests/ops/qsa/__init__.py | Defines QSA test package. |
| tests/ops/qsa/_attention.py | Supplies attention fixtures. |
| tests/ops/qsa/_benchmark.py | Supplies benchmark infrastructure. |
| tests/ops/qsa/_indexer.py | Supplies indexer fixtures. |
| tests/ops/qsa/test_attention.py | Tests attention correctness and replay. |
| tests/ops/qsa/test_indexer.py | Tests indexer correctness and replay. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
decode_indexer now runs the prefill input checks (shared _check_shared) plus decode shape/dtype/device checks before any launch; add negative tests. Note that flyc.compile already launches the first call on a cache miss.
Merged
5 tasks
sammysun0711
approved these changes
Oct 12, 2026
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.


Add QSA prefill(attention+indexer) for 308, indexer also covers decoding stage (CUDA-graph decode and MTP verify).
Example of integrated into sglang (
c3c4bc8...001c0cf; usesattention,prefill_indexeranddecode_indexer).