Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
551 commits
Select commit Hold shift + click to select a range
24f8399
Fix SparsePagedAttention WGSL generation
Copilot Sep 15, 2026
5c0301d
Fix WebGPU plugin API initialization mismatch
Copilot Sep 15, 2026
a25b7cd
Merge remote-tracking branch 'origin/main' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 15, 2026
a9b3b69
Address SparseAttentionIndexer review feedback
Copilot Sep 15, 2026
2a42087
Gate XQA dispatch tests by CUDA architecture
Copilot Sep 15, 2026
4f7f255
Address SparsePagedAttention review cleanup and coverage
Copilot Sep 15, 2026
2f6bc3a
Ignore plugin EP NuGet build artifacts
Copilot Sep 15, 2026
4f8a7a5
Optimize single-source sparse paged attention
Copilot Sep 15, 2026
408cc68
Strengthen direct auxiliary output test
Copilot Sep 15, 2026
36821cb
Fix SparsePagedAttention WGSL generation
Copilot Sep 15, 2026
a67b414
Sync target and fix formatting
Copilot Sep 15, 2026
f9bd45a
Update generated contrib docs
Copilot Sep 15, 2026
6efcefd
Remove unused SparsePagedAttention binding limit
Copilot Sep 15, 2026
1a9a9c4
Merge remote-tracking branch 'origin/copilot/copilotadd-cuda-sparsepa…
Copilot Sep 15, 2026
c13bfc0
Fix WebGPU plugin logger definitions
Copilot Sep 15, 2026
d94ab7e
Use valid head size in SparsePagedAttention rotary test
Copilot Sep 15, 2026
dbaeb30
Initial plan
Copilot Sep 15, 2026
2e3693c
Apply remaining changes
Copilot Sep 15, 2026
879017f
Restore GatherBlockQuantized MLAS optimization
Copilot Sep 15, 2026
0d86780
Test GatherBlockQuantized batch boundary
Copilot Sep 15, 2026
3d2be52
Merge remote-tracking branch 'origin/main' into copilot/add-cuda-dyna…
Copilot Sep 15, 2026
e6e26ae
Fix SparsePagedAttention validation and indexing
Copilot Sep 15, 2026
2f4024f
Address DynamicSparseAttention review feedback
Copilot Sep 15, 2026
52c497e
Fix half-split rotary test alignment
Copilot Sep 15, 2026
3520cfb
Fix packed QKV validation test expectation
Copilot Sep 16, 2026
20ac107
Add CUDA host-pageable gather implementation
Copilot Sep 16, 2026
e879ff6
Harden CUDA gather fallback and tests
Copilot Sep 16, 2026
9d26367
Complete plugin and constant-input coverage
Copilot Sep 16, 2026
f039ff6
Support shared SparseAttentionIndexer caches
Copilot Sep 16, 2026
cf54693
Implement packed sparse attention indexer
Copilot Sep 16, 2026
6f8041c
Harden packed indexer state validation
Copilot Sep 16, 2026
5b9d10e
Validate packed indexer capacity bounds
Copilot Sep 16, 2026
de0e587
Fix packed indexer output-count test
Copilot Sep 16, 2026
5a37cb6
Consolidate SparseAttentionIndexer cache state
Copilot Sep 16, 2026
e2126e3
Enable host-pageable gather in CUDA Graphs
Copilot Sep 16, 2026
4d9c851
Strengthen direct host CUDA Graph coverage
Copilot Sep 16, 2026
76d6532
Fix SparseAttentionIndexer test narrowing warning
Copilot Sep 16, 2026
4eb6a08
Address CUDA gather review feedback
Copilot Sep 16, 2026
2651deb
Handle disabled prepacking in direct mode
Copilot Sep 16, 2026
c5dcbd1
Fix invalid-width shape inference test
Copilot Sep 16, 2026
00a7441
Merge remote-tracking branch 'origin/main' into copilot/add-cuda-dyna…
Copilot Sep 16, 2026
20776a3
Merge remote-tracking branch 'origin/copilot/add-cuda-dynamicsparseat…
Copilot Sep 16, 2026
0cb82f8
Fix GatedDeltaNet parameter dispatch
Copilot Sep 16, 2026
3de7958
Fix WebGPU provider test build
Copilot Sep 16, 2026
97d8f00
Merge main into copilot/implement-gated-delta-net-webgpu
kunal-vaishnavi Sep 16, 2026
bb02499
Optimize GatedDeltaNet recurrent WebGPU execution
Copilot Sep 16, 2026
b62c0a4
Cover optimized GatedDeltaNet recurrent path
Copilot Sep 16, 2026
c823868
Exercise vectorized GatedDeltaNet path on baseline adapters
Copilot Sep 16, 2026
1174fc7
Add effective WebGPU limit overrides
Copilot Sep 16, 2026
daf73e3
Update generated SparseAttentionIndexer docs
Copilot Sep 16, 2026
2652363
Merge remote-tracking branch 'origin/copilot/implement-sparse-attenti…
Copilot Sep 16, 2026
3d328b2
Adapt WebGPU indexer to shared cache ABI
Copilot Sep 16, 2026
2125b41
Merge remote-tracking branch 'origin/copilot/implement-sparse-attenti…
Copilot Sep 16, 2026
df26284
Address packed indexer review feedback
Copilot Sep 16, 2026
ebc6bdf
Optimize CUDA QSA scoring and selection
Copilot Sep 16, 2026
ecabf39
Add single-pass TopK coverage
Copilot Sep 16, 2026
8ece210
Fix packed indexer CI failures
Copilot Sep 16, 2026
49ade0c
Merge remote-tracking branch 'origin/copilot/copilotimplement-packed-…
Copilot Sep 16, 2026
8f506aa
Address CUDA QSA review feedback
Copilot Sep 16, 2026
80f4f66
Test BF16 sparse mixer routing
kunal-vaishnavi Sep 16, 2026
2aa61ae
Fix CUDA CI compilation and generated docs
Copilot Sep 16, 2026
b56a5d3
Merge remote-tracking branch 'origin/main' into kvaishnavi/qwen-38-flash
Copilot Sep 17, 2026
8619cb3
Merge remote-tracking branch 'origin/pr/32358' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
4ef561c
Merge remote-tracking branch 'origin/pr/32467' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
cbaddd9
Merge remote-tracking branch 'origin/pr/32480' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
cc5d018
Merge remote-tracking branch 'origin/pr/32512' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
1cb5545
Merge remote-tracking branch 'origin/pr/32621' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
7c05ac9
Merge remote-tracking branch 'origin/pr/32524' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
17807cf
Merge remote-tracking branch 'origin/pr/32525' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
9f1ff55
Merge remote-tracking branch 'origin/pr/32526' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
cfe7428
Merge remote-tracking branch 'origin/pr/32626' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
d131e8c
Merge remote-tracking branch 'origin/pr/32656' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
e7ee810
Merge remote-tracking branch 'origin/pr/32659' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
bea3fe7
Merge remote-tracking branch 'origin/pr/32529' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
86da2b4
Merge remote-tracking branch 'origin/pr/32533' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
783b40e
Merge remote-tracking branch 'origin/pr/32613' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
0863883
Merge remote-tracking branch 'origin/pr/32645' into kvaishnavi/qwen-3…
Copilot Sep 17, 2026
9950a03
Restore wrapped Engram hash addition
Copilot Sep 17, 2026
d0b6faf
Fix packed indexer schema validation
Copilot Sep 17, 2026
51b6403
Merge remote-tracking branch 'origin/copilot/copilotimplement-packed-…
Copilot Sep 17, 2026
fbb15f9
Optimize SparsePagedAttention workgroup softmax
Copilot Sep 17, 2026
87c6740
Merge remote-tracking branch 'origin/copilot/copilotadd-cuda-sparsepa…
Copilot Sep 17, 2026
e81906b
Reduce packed indexer WebGPU bindings
Copilot Sep 17, 2026
5b1566b
Merge remote-tracking branch 'origin/copilot/copilotadd-cuda-dynamics…
Copilot Sep 17, 2026
cfacbec
Parallelize CUDA DynamicSparseAttention
Copilot Sep 17, 2026
70fd72a
Harden fused attention synchronization
Copilot Sep 17, 2026
d158543
Scale DynamicSparseAttention to large contexts
Copilot Sep 17, 2026
3837ccf
Reduce large-context attention workspace
Copilot Sep 17, 2026
26b93ff
Merge remote-tracking branch 'origin/copilot/optimize-dynamic-sparse-…
Copilot Sep 17, 2026
24bccfd
Implement profile-driven QSA selection optimizations
Copilot Sep 17, 2026
1593b64
Fix and format QSA radix selection
Copilot Sep 17, 2026
5b77441
Include CUDA kernel scratch API
Copilot Sep 17, 2026
9c88191
Fix CUDA provider test option construction
Copilot Sep 17, 2026
9d906b1
Implement profile-driven QSA selection optimizations
Copilot Sep 17, 2026
2c03167
Fix and format QSA radix selection
Copilot Sep 17, 2026
7dd2fae
Include CUDA kernel scratch API
Copilot Sep 17, 2026
833faca
Bound sparse attention split workspace
Copilot Sep 17, 2026
b69c135
Bound DynamicSparseAttention split work
Copilot Sep 17, 2026
f8d960b
Optimize SparsePagedAttention workgroup softmax
Copilot Sep 17, 2026
d3645c1
Fix packed indexer schema validation
Copilot Sep 17, 2026
32f7fce
Reduce packed indexer WebGPU bindings
Copilot Sep 17, 2026
7d6428a
Fix GatedDeltaNet WebGPU CI compilation
Copilot Sep 17, 2026
7b6e195
Fix packed GatedDeltaNet WebGPU test setup
Copilot Sep 17, 2026
6a2cbd1
Fix generated contrib documentation whitespace
Copilot Sep 17, 2026
7a76fff
Fix sparse attention indexer CUDA kernel type
kunal-vaishnavi Sep 17, 2026
1f12360
Fix sparse attention indexer CUDA kernel type
kunal-vaishnavi Sep 17, 2026
082cde9
Fix CUDA gather block quantized tests
kunal-vaishnavi Sep 17, 2026
d2de258
Implement bounded exact QSA selection
Copilot Sep 17, 2026
a6c7873
Finalize bounded QSA decode path
Copilot Sep 17, 2026
3b5660c
Add HyperConnectionMix CUDA contrib operator
Copilot Sep 18, 2026
c12532d
Format HyperConnectionMix CUDA kernel
Copilot Sep 18, 2026
0be2808
Remove incorrect HyperConnectionMix operator
Copilot Sep 18, 2026
6ce8251
Add weightless hyper-connection fusion operators
Copilot Sep 18, 2026
e31e472
Split hyper-connection kernels by operator
Copilot Sep 18, 2026
f51ae49
Add dedicated hyper-connection shape inference
Copilot Sep 18, 2026
038a7ff
Merge remote-tracking branch 'origin/main' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 18, 2026
f216d45
Merge remote-tracking branch 'origin/pr/32687' into kvaishnavi/qwen-3…
kunal-vaishnavi Sep 18, 2026
ccda237
Allow flattened HyperConnection pre-mix gates
kunal-vaishnavi Sep 18, 2026
9e76e4c
Merge remote-tracking branch 'origin/pr/32687' into kvaishnavi/qwen-3…
kunal-vaishnavi Sep 18, 2026
abd4a3b
Export layer norm helpers for branchwise RMS norm
kunal-vaishnavi Sep 18, 2026
853b48a
Fix hyper-connection CI and review issues
Copilot Sep 18, 2026
6f00305
Fix provider build for branchwise RMS norm
kunal-vaishnavi Sep 18, 2026
b4eeea8
Fix provider build for branchwise RMS norm
kunal-vaishnavi Sep 18, 2026
dfbfacc
Merge remote-tracking branch 'origin/pr/32687' into kvaishnavi/qwen-3…
kunal-vaishnavi Sep 18, 2026
6700329
Fix optional SparsePagedAttention type resolution
Copilot Sep 18, 2026
15d73ba
Support shared rotary caches in sparse indexer
kunal-vaishnavi Sep 18, 2026
3d6bf1a
Accept padding masks in sparse attention indexer
kunal-vaishnavi Sep 18, 2026
ad5e934
Fix remaining CUDA test compilation
Copilot Sep 18, 2026
8ab1114
Support shared rotary caches in sparse indexer
kunal-vaishnavi Sep 18, 2026
445e7d3
Accept padding masks in sparse attention indexer
kunal-vaishnavi Sep 18, 2026
a9e357a
Address VarlenNGramHashMapping review feedback
Copilot Sep 18, 2026
ba39dc5
Fix optional SparsePagedAttention type resolution
Copilot Sep 18, 2026
3461e03
Fix CUDA conflicts in Qwen operator updates
kunal-vaishnavi Sep 18, 2026
c6efe24
Fuse query normalization into SparseAttentionIndexer
kunal-vaishnavi Sep 18, 2026
6a13c37
Merge branch 'stack-32526' into stack-32528
kunal-vaishnavi Sep 18, 2026
fe9d059
Fuse query normalization in WebGPU sparse indexer
kunal-vaishnavi Sep 18, 2026
a73ff17
Merge branch 'stack-32528' into stack-32618
kunal-vaishnavi Sep 18, 2026
f32b9bf
Fuse query normalization into PackedSparseAttentionIndexer
kunal-vaishnavi Sep 18, 2026
851cc44
Merge branch 'stack-32618' into stack-32656
kunal-vaishnavi Sep 18, 2026
eb63f12
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 18, 2026
efa7f56
Merge remote-tracking branch 'origin/main' into stack-32526
kunal-vaishnavi Sep 18, 2026
72d02b1
Merge branch 'stack-32526' into stack-32528
kunal-vaishnavi Sep 18, 2026
96f00c6
Merge branch 'stack-32528' into stack-32618
kunal-vaishnavi Sep 18, 2026
61e9e7a
Merge branch 'stack-32618' into stack-32656
kunal-vaishnavi Sep 18, 2026
3949037
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 18, 2026
9c8ed58
Restrict SparseAttentionIndexer to integer masks
kunal-vaishnavi Sep 18, 2026
7d485c8
Merge branch 'stack-32526' into stack-32528
kunal-vaishnavi Sep 18, 2026
bc922c2
Use integer masks in WebGPU sparse indexer
kunal-vaishnavi Sep 18, 2026
324128f
Merge branch 'stack-32528' into stack-32618
kunal-vaishnavi Sep 18, 2026
c007083
Merge branch 'stack-32618' into stack-32656
kunal-vaishnavi Sep 18, 2026
b65729f
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 18, 2026
a2288d3
Make DSA device validation opt-in
Copilot Sep 17, 2026
0c87280
Test default DSA validation mode
Copilot Sep 17, 2026
c3a106b
Fix segmented WebGPU test provider setup
Copilot Sep 17, 2026
608aa74
Exercise segmented aliased WebGPU state
Copilot Sep 17, 2026
0e649ff
Hoist QSA query preparation out of block scoring
kunal-vaishnavi Sep 19, 2026
75d6b8a
Merge branch 'stack-32526' into stack-32528
kunal-vaishnavi Sep 19, 2026
b150814
Merge branch 'stack-32528' into stack-32618
kunal-vaishnavi Sep 19, 2026
240f37a
Merge branch 'stack-32618' into stack-32656
kunal-vaishnavi Sep 19, 2026
c3f101c
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 19, 2026
04c7a92
Hoist packed QSA query preparation out of scoring
kunal-vaishnavi Sep 19, 2026
2d8c42e
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 19, 2026
cdbf1fe
Guard QSA decode performance in CUDA tests
kunal-vaishnavi Sep 19, 2026
02a0fce
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 19, 2026
7b9d8bc
Enforce QSA decode latency budgets
kunal-vaishnavi Sep 19, 2026
842a598
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 19, 2026
d944a2c
Optimize CUDA branchwise RMS normalization
kunal-vaishnavi Sep 19, 2026
712ec03
Optimize small inner-axis CUDA Split
kunal-vaishnavi Sep 20, 2026
1aec0ff
Support packed QK in CUDA sparse attention indexer
kunal-vaishnavi Sep 20, 2026
dbf7d34
Merge branch 'stack-32526' into stack-32528
kunal-vaishnavi Sep 20, 2026
01dc6e1
Support packed QK in WebGPU sparse attention indexer
kunal-vaishnavi Sep 20, 2026
7f41361
Merge branch 'stack-32528' into stack-32618
kunal-vaishnavi Sep 20, 2026
31dd38b
Merge branch 'stack-32618' into stack-32656
kunal-vaishnavi Sep 20, 2026
f959e1c
Merge branch 'stack-32656' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 20, 2026
bb4c28a
Fix packed GatedDeltaNet shape inference
kunal-vaishnavi Sep 20, 2026
56aabd0
Support packed QKV in CUDA GatedDeltaNet
kunal-vaishnavi Sep 20, 2026
44f2a1d
Support packed QKV in WebGPU GatedDeltaNet
kunal-vaishnavi Sep 20, 2026
59253d6
Optimize prefix-causal sparse attention indexing
kunal-vaishnavi Sep 21, 2026
98c77d8
Optimize prefix-causal sparse attention indexing
kunal-vaishnavi Sep 21, 2026
548ff66
Optimize QSA TopK and block scoring
kunal-vaishnavi Sep 21, 2026
a46ecd6
Optimize QSA TopK and block scoring
kunal-vaishnavi Sep 21, 2026
5a01fad
Test multi-row QSA partial TopK
kunal-vaishnavi Sep 21, 2026
726ee42
Fix multi-row QSA partial TopK stride
kunal-vaishnavi Sep 21, 2026
c095912
Distribute QSA TopK and cache block representatives
kunal-vaishnavi Sep 21, 2026
0d91053
Distribute QSA TopK and cache block representatives
kunal-vaishnavi Sep 21, 2026
cbc0463
Implement hierarchical exact QSA selection
kunal-vaishnavi Sep 22, 2026
1f1c1ea
Implement hierarchical exact QSA selection
kunal-vaishnavi Sep 22, 2026
b9699f1
Use Env for sparse attention test variables
kunal-vaishnavi Sep 22, 2026
9ba9d85
Use Env for sparse attention test variables
kunal-vaishnavi Sep 22, 2026
d415fdc
Extend EngramGate for packed batching
kunal-vaishnavi Sep 26, 2026
894ced5
Merge PR 32524 CUDA fixes into SparsePagedAttention WebGPU stack
kunal-vaishnavi Sep 26, 2026
40b460e
Merge updated SparsePagedAttention stack into WebGPU optimization
kunal-vaishnavi Sep 26, 2026
6d74144
Merge branch 'update-pr-32613' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 26, 2026
f955fdd
Merge remote-tracking branch 'origin/pr/32656' into kvaishnavi/qwen-3…
kunal-vaishnavi Sep 26, 2026
b22deb2
Merge commit 'd415fdc5ff' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 26, 2026
2240bc6
Merge remote-tracking branch 'origin/main' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 26, 2026
201fbfa
Remove duplicate QSA integration tests
kunal-vaishnavi Sep 26, 2026
db18f03
Fix WebGPU Qwen integration build
kunal-vaishnavi Sep 26, 2026
4da5794
Optimize packed QSA selection
kunal-vaishnavi Sep 27, 2026
5f468d5
Support packed QK indexer inputs
kunal-vaishnavi Sep 27, 2026
e93b8d2
Optimize CUDA SparsePagedAttention with split KV
kunal-vaishnavi Sep 28, 2026
1c35723
Merge branch 'optimize-sparse-paged-attention' into update-pr-32533
kunal-vaishnavi Sep 28, 2026
11a9d04
Merge branch 'update-pr-32533' into update-pr-32613
kunal-vaishnavi Sep 28, 2026
5161035
Merge branch 'update-pr-32613' into kvaishnavi/qwen-38-flash
kunal-vaishnavi Sep 28, 2026
5e186e8
Optimize packed QSA prefill scoring
kunal-vaishnavi Sep 28, 2026
c58e358
Optimize sparse paged attention prefill
kunal-vaishnavi Sep 28, 2026
838d0e3
Capture n-gram state updates for partial acceptance
kunal-vaishnavi Sep 28, 2026
30423f0
Gate variable-length convolution state capture
kunal-vaishnavi Sep 28, 2026
9f08e21
Capture packed indexer state updates
kunal-vaishnavi Sep 28, 2026
60c403f
Fix compact state capture validation regressions
kunal-vaishnavi Sep 28, 2026
15f3a9a
Honor deterministic compute for CUDA MatMulNBits tactics
kunal-vaishnavi Sep 29, 2026
73d7c8e
Fix FP4 GEMV expert-map fallback for unsupported fused prologues
kunal-vaishnavi Oct 2, 2026
6d4142c
Add CUDA QMoE block-scaled FP8 support with routed-expert compaction
apsonawane Sep 28, 2026
8a30344
Fix CUDA QMoE registration for independent FP8 scale types
apsonawane Oct 1, 2026
b8c3a21
Fix FP8 QMoE layout regression test and documentation
apsonawane Oct 1, 2026
0d419c8
Fix QMoE CI expectations and older PyTorch test handling
apsonawane Oct 1, 2026
8689050
Extend routed-expert compaction to NVFP4 QMoE fallback
kunal-vaishnavi Oct 2, 2026
2fd134e
Keep packed sparse indexer state-update gate on CPU for CUDA graphs
kunal-vaishnavi Oct 3, 2026
77294ac
Address QMoE block FP8 review
apsonawane Oct 2, 2026
94f10b3
Fix QMoE documentation whitespace
apsonawane Oct 2, 2026
27ab528
Fix QMoE dequant lambda return type
apsonawane Oct 2, 2026
01913e3
Fix QMoE packed-prefill tiling and CI review regressions
kunal-vaishnavi Oct 4, 2026
b1b8ab6
[CUDA] Avoid repacking NVFP4 QMoE decode weights (#32325)
tianleiwu Oct 2, 2026
0d765f9
Support offline NVFP4 QMoE weights through weights_prepacked
kunal-vaishnavi Oct 5, 2026
746b594
Fuse block-scaled FP8 QMoE GEMV and GEMM without weight scratch
kunal-vaishnavi Oct 5, 2026
bc02ae0
Preserve FP8 fused layouts and validate CUDA graph replay
kunal-vaishnavi Oct 5, 2026
3050a77
Keep shared FP8 fused routing independent of PR-only snapshots
kunal-vaishnavi Oct 5, 2026
52d0a73
Use native contiguous K-packed NVFP4 GEMV loads
kunal-vaishnavi Oct 6, 2026
d7177b6
Merge origin/main into kvaishnavi/qwen-38-flash
kunal-vaishnavi Oct 6, 2026
3e164d2
Support 80 expanded rows in native K-packed NVFP4 GEMV
kunal-vaishnavi Oct 6, 2026
41fe0ba
Add stable sparse selection merge for CUDA and WebGPU
kunal-vaishnavi Oct 7, 2026
55b790a
Implement flat IndexShare packed sparse indexer reuse
kunal-vaishnavi Oct 8, 2026
e0ffc27
Fix QMoE SM120 configuration dispatch on SM121 devices
kunal-vaishnavi Oct 9, 2026
092ec70
Merge latest ORT main into kvaishnavi/qwen-38-flash
kunal-vaishnavi Oct 9, 2026
f1f5355
Fix IndexShare plugin builds and WebGPU metadata validation
kunal-vaishnavi Oct 9, 2026
627568a
Fix duplicate CUDA graph option in plugin runtime config
kunal-vaishnavi Oct 9, 2026
d6dd481
Fix Qwen sparse indexer and CUDA provider build errors
kunal-vaishnavi Oct 10, 2026
72f58f3
Optimize grouped sparse attention and CUDA weight-only decode
kunal-vaishnavi Oct 10, 2026
642f403
Merge main and resolve Qwen NVFP4 profiler conflicts
kunal-vaishnavi Oct 10, 2026
6a624d3
Fix Qwen NVFP4 CI test APIs and review formatting
kunal-vaishnavi Oct 10, 2026
e483408
Optimize Qwen CUDA sparse attention, indexer, and quantized MoE kernels
apsonawane Oct 15, 2026
71ee3c9
Address CUDA QMoE review feedback
apsonawane Oct 15, 2026
19336e1
Restrict QMoE calibration capture permissions
apsonawane Oct 15, 2026
1cd94f8
Merge main and resolve Qwen CUDA optimization conflicts
apsonawane Oct 19, 2026
bb5d3e5
Preserve grouped sparse prefix hits and cover opt-in dispatch paths
apsonawane Oct 19, 2026
8f83777
Fix shared CUDA logging and sparse indexer test portability
apsonawane Oct 19, 2026
3a7dbc1
Fix Windows CUDA provider linkage and radix test flag handling
apsonawane Oct 19, 2026
f851671
Use schema-valid QSA batch for empty-row radix regression
apsonawane Oct 20, 2026
f4602fe
Enable child startup logging before CUDA plugin registration
apsonawane Oct 20, 2026
b7be0b3
Enable compatible packed NVFP4 prefill by default
apsonawane Oct 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions docs/contrib_ops/cuda/moe_qmoe.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,70 @@ When native CUTLASS is enabled, weights and scales are dual-prepacked (native la
raw e8m0 block scales for GEMV), so `ORT_FP4_PREFILL_MIN_TOKENS` selects per call between the
prefill and decode kernels with no extra conversion.

### Experimental large-expert INT2 execution

`ORT_QMOE_INT2_LARGE_EXPERTS=1` extends the packed INT2 grouped-GEMM
execution and matching runtime prepacking from at most 256 to at most 512
experts. It is disabled by default and requires the existing
`ORT_ENABLE_QMOE_INT2_PREFILL` path, symmetric INT2/INT4 weights with at
least one INT2 projection, raw initializers (`weights_prepacked=0`), fused
SwiGLU, supported block sizes, and aligned projection dimensions.
The packed grouped path also serves decode calls whose expanded row count
or routing is outside the GEMV eligibility limits, including top-10
routing. It does not expand GEMV eligibility or bypass the dense-fallback
scratch guard.

FP16 regression coverage compares 512-expert, top-10 calls at one, three,
and 32 rows against the dequantized fallback, with block sizes 64 and 128,
projection biases, and CUDA graph capture/replay. Full-model quality and
throughput must be evaluated separately; this flag is not a claim of
speedup or lossless quantization.

### Experimental INT4 activation quality simulation for INT2 experts

For local calibration diagnostics, `ORT_QMOE_CALIBRATION_CAPTURE_DIR`
can name an existing directory to capture NVFP4 QMoE inputs and router
logits. This is disabled when unset, is unavailable in plugin/minimal
builds, and requires CUDA graphs disabled. Each named node writes at
most sixteen invocations with at least sixteen rows, keeping the first
128 rows. Other quantization types are unaffected. Files are never
intentionally overwritten; missing directories, invalid shapes and I/O
failures are explicit errors. File names contain an encoded node name,
process ID, QMoE instance ID, and invocation index so concurrent sessions
do not collide; destination files are created exclusively. The binary
format is five int64 values `[version=1, rows, hidden, experts,
ONNX_activation_dtype]`, followed by
row-major input and router tensors in their original FP16/BF16 storage.
Capture synchronizes the stream and is **not suitable for performance
measurement**. Captured activations are local model data; keep them in
the experiment directory and leave the option unset in production.

`ORT_QMOE_INT2_FAKE_INT4_ACTIVATIONS=1` enables a default-off numerical
screen for integer QMoE nodes with at least one INT2 projection. It
quantizes/dequantizes both the expanded gate/up input and the post-SwiGLU
down input, independently for each row and contiguous group of 64 values.
The dynamic FP32 scale is `max(abs(group))/7`; codes are rounded to nearest
with ties to even in the symmetric range `[-7,7]`. Dequantized values are
rounded back to the existing FP16/BF16 activation dtype. All-zero groups
remain zero. Scales are recomputed at inference time; no calibration
dataset or model-weight change is required.

This is **fake quantization**, not packed INT4 activation storage or
integer tensor-core execution. Both GEMMs still consume FP16/BF16.
Additional QDQ launches may slow requests; do not interpret their
throughput or memory as native W2A4 performance. Routing probabilities,
residuals, attention, caches and non-INT2 nodes (including FP8 MTP) are
not quantized by this flag.

The flag requires `ORT_ENABLE_QMOE_INT2_PREFILL=1`, the supported packed
grouped path, fused interleaved SwiGLU and aligned dimensions; 512-expert
models additionally require `ORT_QMOE_INT2_LARGE_EXPERTS=1`. GEMV is
bypassed for affected nodes to apply QDQ at both projections consistently
in prefill and decode. Unsupported affected nodes fail explicitly rather
than silently executing an unquantized fallback. Flag values other than
zero or one are rejected. With the flag unset/zero existing dispatch and
arithmetic remain unchanged.

### 9.10 Interleaved GEMV layout + dtype-conditional accumulation

**Opt-in (`ORT_FP4_GEMV_INTERLEAVED=1`, default off).** The shipping MXFP4 decode GEMV uses a
Expand Down Expand Up @@ -1177,6 +1241,12 @@ full-model measurements and do not establish performance on other GPU architectu
Disabling GEMV entirely is not equivalent: the dense fallback dequantizes every expert,
which can be much slower for large expert counts.

Standalone FP4 GEMV and packed NVFP4 prefill bypass grouped-GEMM tactic profiling
because neither route consumes its tactics or workspace. The legacy
`ep.cuda.qmoe_skip_nvfp4_gemv_profiling` session setting and
`ORT_QMOE_SKIP_NVFP4_GEMV_PROFILING` environment variable remain accepted for
compatibility, but no longer control profiling on standalone FP4 GEMV.

Raw mode ignores `ORT_FP4_GEMV_AUTOTUNE`: the prepacked tiling candidates do not change
the raw kernel, so profiling them only adds synchronization and repeated work. With
`ORT_ENABLE_QMOE_KERNEL_DEBUG_INFO=1`, the routes are reported as `fp4_gemv_raw` and
Expand Down Expand Up @@ -1284,6 +1354,150 @@ gate: it applies a looser tolerance **only** to shapes that route native (SM120/
`num_rows >= ORT_FP4_PREFILL_MIN_TOKENS`) and keeps the strict bound for all decode/fallback shapes,
so a genuinely broken native kernel (error order ~1.0+) is still caught.

### 9b.6 Experimental packed weight-only prefill

The runtime automatically selects a memory-efficient W4A16
prefill route on SM80+ when NVFP4 weights already have the offline
row-major byte layout. `ORT_QMOE_NVFP4_PACKED_PREFILL=0` disables this route;
`1` explicitly selects the default. It requires fused interleaved
SwiGLU (`swiglu_fusion=1`), positive hidden/intermediate dimensions that
are multiples of 64, and supported integer routing sizes. Unsupported
shapes/layouts retain the existing fallback; eligible small decode
continues to use the unchanged FP4 GEMV path. Native block-scaled FP4
prefill is not replaced.

The persistent grouped WMMA kernel reads original E2M1 bytes, block-16
E4M3 scales and per-expert FP32 global scales. It dequantizes only a
64x128x64 shared-memory tile, retaining FP16/BF16 activations and FP32
accumulation. Eight-element loads reuse the existing `Fp4I2FConverter`;
scaled weights are rounded once to the activation dtype using paired
round-to-nearest conversion. The per-expert global scale is loaded once
per tile. Padded shared
strides and input/epilogue storage reuse reduce tile overhead. No full
FP16/BF16 expert-weight bank, requantization or expert offloading is
introduced.

The mainloop uses SM80 asynchronous global-to-shared copies to prefetch
the next input and packed-weight tile while computing the current tile.
Only input and packed-weight storage are double buffered; one
dequantized weight tile is reused after the block barrier. This bounds
dynamic shared memory to 44 KiB per block. Copy completion and block
barriers protect both tile reuse and the shared FP32 epilogue.

Expert sorting, input expansion, biased SwiGLU and routing finalization
reuse the packed integer-prefill pipeline. Its workspace is bounded by
a 384 MiB scratch policy for this NVFP4 route, using internal
row tiles when necessary. Integer prefill retains its 256 MiB bound.
The NVFP4 bound accommodates a full 4,096-row Qwen prefill chunk and
avoids a second read of expert weights. This is **not** a device-wide
memory cap. With
`ORT_ENABLE_QMOE_KERNEL_DEBUG_INFO=1`, the route is
`packed_nvfp4_prefill`.

Focused H200 tests cover FP16/BF16 reference and dense-path numerical
parity, row/column tails, biases, empty experts, multi-row tiling,
packed CUDA graph capture/replay, unsupported-shape/layout fallback and
unchanged decode routing. Dense comparison sessions are uncaptured;
exact capture/replay equality is asserted for the packed route.
Floating-point accumulation can differ from dense GEMM, so passing
these tolerances does not establish bit-identical full-model outputs.
Full-model Qwen3.8 experiments reached a sampled 79.80 GiB with
1,024-token scheduler chunks. A sequential same-GPU comparison of the
non-pipelined and pipelined builds improved independent E2E throughput
from 83.54 to 90.52 TPS; the 100 TPS target remains unmet in that experiment.
Those measurements are workload-specific, not a production throughput guarantee.

With a separately capacity-bounded Qwen indexer graph and 4,096-token
scheduling, ten independent requests subsequently reached 99.79 E2E /
133.33 decode TPS and a sampled peak of 79.95 GiB. That graph retains
only the indexer capacity needed by the candidate's existing 40 KV
blocks; it is not a 262K-context replacement. The measured Engine
request ceiling is 9,217 total tokens, and sampled memory headroom is
only about 56 MiB. This does not qualify actual 80 GiB hardware or
guarantee strict 100 TPS.

#### Optional fused gate/up epilogue

`ORT_QMOE_NVFP4_FUSED_SWIGLU=1` additionally fuses the eligible packed
NVFP4 gate/up GEMM epilogue with bias and interleaved SwiGLU. Its default
is `0`; it has no effect without the packed-prefill route and does not
change integer prefill, unsupported-layout fallback or decode GEMV.
The FP32 accumulators are still rounded to FP16/BF16 before adding bias
and applying the same alpha/beta/limit semantics. Each paired gate/up
channel belongs to the same tile.

The epilogue writes the activated down-projection input directly, avoiding
the gate/up output reservation and the separate activation launch. At
4,096 rows, top-10 and intermediate size 640 this removes exactly 100 MiB
from the packed workspace. H200 device-wide sampled peak fell from a
fresh 79.9432 GiB unfused control to 79.7498 GiB; allocator-pool effects
make this device-wide difference larger than the one workspace buffer.
Two five-request fused invocations reached 100.71 and 100.44 E2E TPS,
pooling to 100.58 E2E / 133.60 decode TPS and 1.266 s TTFT. Fresh
unfused controls pooled to 99.54 E2E TPS and 1.299 s TTFT.
All 128 paired quality token streams matched, preserving all 110
control-correct answers. This is workload-specific evidence, not a
throughput guarantee or qualification on actual 80 GiB hardware;
sampled headroom remains only about 256 MiB.

#### Optional routing scratch lifetime reuse

`ORT_QMOE_NVFP4_REUSE_ROUTING_SCRATCH=1` reuses the packed NVFP4 sorting
temporaries (counts, cumulative counts and blocked rows) for the expanded
input and later down-projection output. Default is `0`. The three sorting
kernels finish on the same stream before expansion starts; row maps,
expert offsets and tile offsets remain separate and live through
finalization. The shared reservation is the larger of the aligned sorting
scratch and expanded-input storage, so shapes with more sorting scratch
than input storage are also supported. Integer prefill is unchanged.

At 4,096 rows, 512 experts, top-10 and hidden size 2,560 this removes
8,404,992 bytes (about 8.02 MiB) of packed workspace. A fresh H200
flag-off/flag-on memory comparison with fused SwiGLU observed
79.7479 -> 79.7322 GiB, a 16 MiB device-wide sampled reduction.
Reversed-order ten-request pools measured 100.01 -> 100.28 E2E TPS;
that small timing difference does not establish an independent speedup.
Sampled headroom is about 274 MiB, still not actual 80 GiB qualification.

Direct input gathering into shared memory was also screened. Exact
numerical tests passed, but 4,096-token scheduling showed slower TTFT
(1.267 -> 1.289 seconds) and E2E (100.49 -> 99.95 TPS), with no workspace
reduction because expanded-input storage already aliases down output.
That implementation was rejected and is not present in the retained path.

#### Optional tiled down-projection output

`ORT_QMOE_NVFP4_TILED_DOWN_OUTPUT=1` enables a further default-off memory
tradeoff when both supported packed prefill and the fused SwiGLU epilogue
are active. Gate/up gathers original input rows into shared memory using
the unchanged sorted maps instead of materializing expanded input.
Down projection writes at most 1,024 columns of expanded output at a time;
each tile is reduced in original top-k rank order before its storage is
reused on the same stream. Bias addition, activation-dtype GEMM rounding,
FP32 routing accumulation and final rounding match the existing path;
there are no unordered atomic additions. Sorting-lifetime reuse can
still be enabled, with a reservation covering the larger live buffer.

For 4,096 rows, top-10, hidden size 2,560 this reduces the shared
expanded-input/down-output reservation from 200 to 80 MiB, saving exactly
120 MiB workspace. H200 sampled device-wide peak falls from 79.7322 to
79.5760 GiB, a 160 MiB reduction including allocator-pool effects. The
candidate has about 434 MiB sampled headroom, not a hard memory cap.

This is **not an established speed optimization**: final paired pools
observe TTFT rising from 1.271 to 1.295 seconds. Two five-request tiled
runs reach 100.02 and 104.46 E2E TPS, but decode variability accounts for
the high second result; another independent tiled screen reaches 99.996
TPS. Strict at-least-100 throughput and actual 80 GiB hardware remain
unqualified. A smaller 512-column screen saved more workspace but was
slower (99.81 versus 100.31 E2E TPS); it is not selected.

173 focused/regression tests pass, including exact tiled/untiled
FP16/BF16 output and workspace parity, biases, 512 experts, small hidden
dimensions, column tails, row tiling, empty experts, graph replay and
unaffected integer/decode/fallback routes. Fresh paired quality runs match
all 128 token streams and preserve all 110 control-correct answers.

---

## 10. FP8 (W8A16) Details
Expand Down
36 changes: 33 additions & 3 deletions docs/contrib_ops/cuda/sparse_paged_attention.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ The contiguous auxiliary cache has shape
| Attention sink | Supported in the joint softmax |
| CUDA Graphs | Fixed-capacity, device-resident counts; no host synchronization |

The functional kernel reads selected pages directly and performs an online joint
softmax. Selector fusion, paged auxiliary storage, auxiliary quantization, and
decode-specialized sparse kernels are deferred.
## CUDA dispatch

Eligible `selected_only`/`main` calls with matching activation/cache types, head
size 256, and query-to-KV head ratios divisible by four use tiled grouped-query
attention. Other geometries and quantized caches retain the general fallback.
All paths preserve suppressed-write prefix-cache reads; INT8 current rows are
read back from the quantized cache.

The older six-head FP16 grouped-prefill path remains opt-in through session
configuration `ep.cuda.sparse_paged_attention_grouped=1`, or environment variable
`ORT_SPARSE_PAGED_ATTENTION_GROUPED=1` when no session override is present.
`ep.cuda.sparse_paged_attention_grouped_vectorized=1` selects vectorized loads
within that path. Both session options accept only `0` or `1`.

`ORT_SPARSE_PREFILL_TENSOR_CORE_QK=1` enables experimental tensor-core query/key
scoring for eligible twelve-head prefill tiles. With that option enabled,
`ORT_SPARSE_PREFILL_TENSOR_CORE_PV=1` also permits the FP16 probability/value
path. These environment options default to off and are cached on first use.
Neither option establishes broad model-quality or throughput equivalence.

The CUDA Python regression `test_sparse_paged_attention_prefill_cuda.py` runs
scalar, QK-only, QK+PV, BF16 QK, and both grouped-load configurations in fresh
processes. Each compares to an independent reference with multiple/partial
tiles, invalid selections, suppressed-write prefix hits, and attention sinks.
Verbose dispatch messages are asserted so an unintended fallback cannot pass.
Run it against a build containing this change on SM80 or newer:

```bash
python -m pytest onnxruntime/test/python/transformers/test_sparse_paged_attention_prefill_cuda.py
```

Selector fusion, paged auxiliary storage, and auxiliary quantization remain
outside this operator's scope.
Loading
Loading