Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
ae91c3f
Ignore inactive hybrid A4 planning controls
lukealonso Oct 8, 2026
ef044dc
Document and test the packed NVFP4 scale boundary
lukealonso Oct 8, 2026
36046c7
Decode packed NVFP4-CSF scales inside explicit A4 MoE launches
lukealonso Oct 8, 2026
a9b4c43
Consume prefetched packed A4 scales above the CSF stage limit
lukealonso Oct 8, 2026
2f5210d
Support 64-channel intermediate widths in packed NVFP4 A4 MoE
lukealonso Oct 8, 2026
98fb87a
fix(triton): preserve assembler selection across imports
lukealonso Oct 8, 2026
fef1dd7
Add prepared paged KV writes and reusable short convolution
lukealonso Oct 9, 2026
93c41e8
Support prepared QSA partition policy and speculative ring capacity
lukealonso Oct 9, 2026
f845af0
Honor deterministic MoE routing and prepared router signatures
lukealonso Oct 9, 2026
0606348
Expose explicit GDN recurrence and intermediate precision policies
lukealonso Oct 9, 2026
c409f02
Add explicit BF16 attention arithmetic for reference diagnostics
lukealonso Oct 9, 2026
f1cd7bb
Parallelize AIR top-p normalization across vocabulary tiles
lukealonso Oct 9, 2026
c691c68
Accept probability-one chain drafts at the uniform endpoint
lukealonso Oct 9, 2026
9779d0a
Support FP32 gains and caller-owned outputs in hyperconnection combin…
lukealonso Oct 10, 2026
d67eb4a
Accept row-strided projections in prepared short convolution
lukealonso Oct 10, 2026
fd651db
Expose prepared GDN prefill through a mutating custom operator
lukealonso Oct 10, 2026
1463a3a
Keep prepared expert routing opaque during full-graph compilation
lukealonso Oct 10, 2026
fd3969a
Preserve compressed MoE scale and reduction launches in operator graphs
lukealonso Oct 10, 2026
bb0b052
Retain sampling CUDA launches in traced operator graphs
lukealonso Oct 10, 2026
d3d64a6
Retain paged KV writes during full-graph compilation
lukealonso Oct 10, 2026
86dea59
Retain chain speculative sampling in compiled graphs
lukealonso Oct 10, 2026
07323a5
Evict PCIe launcher planning artifacts before in-process compilation
lukealonso Oct 10, 2026
4d926a1
Slice NVFP4 compressed checkpoint scales for tensor parallel loading
lukealonso Oct 10, 2026
e844e35
Retain prepared KDA prefill launches and state mutations through torc…
lukealonso Oct 10, 2026
497bd28
Preserve fully bound mHC launches and mutations through torch compile
lukealonso Oct 10, 2026
baf286f
Support sigmoid top-k routing with correction bias and normalized FP3…
lukealonso Oct 10, 2026
4152791
Preserve prepared sparse MLA and cache writes through torch compile
lukealonso Oct 10, 2026
8633b4c
Prepare GLM C4 index pooling and query rotation for compiled graphs
lukealonso Oct 10, 2026
cc45b75
Preserve prepared FP8 sparse selection through compilation and scratc…
lukealonso Oct 10, 2026
923c4ef
Extend native MXFP8 BMM to GLM head partitions and chunked prefill
lukealonso Oct 10, 2026
d019c06
Pass E8M0 BMM scales as byte views across the compiler boundary
lukealonso Oct 10, 2026
17fcea2
Order A16 shared-stage reuse across consumer threads and TMA
lukealonso Oct 10, 2026
f8c3948
Capture dense benchmark graphs after kernel preparation
lukealonso Oct 10, 2026
fd7bc1c
Fuse single-token short convolution decode and history updates
lukealonso Oct 10, 2026
2664230
Preserve min-p sampling launches through ATen tracing
lukealonso Oct 10, 2026
37dde9c
Autotune SIMT projection block width for decode
lukealonso Oct 10, 2026
56cfc6b
Expose traced RMSNorm with optional rounding before weighting
lukealonso Oct 10, 2026
f2a6828
fix(b12x): reuse FlashInfer CUDA toolkit discovery in loader
lukealonso Oct 10, 2026
b264202
feat(b12x): update loading byte counts independently of shard routing
lukealonso Oct 10, 2026
7cf928e
Preserve packed nibble pairs when preparing native NVFP4 scales
lukealonso Oct 10, 2026
f88c6d3
Batch inline NVFP4 exception indexing across experts
lukealonso Oct 10, 2026
6c148a4
Expose complete prepared MoE execution and scratch mutations to tracing
lukealonso Oct 10, 2026
8dba618
Reuse immutable MoE scratch requirements without constructing executi…
lukealonso Oct 10, 2026
d34acfd
Track prepared plans with constant-time identity lookups
lukealonso Oct 10, 2026
9d67192
Allow prepared QSA transactions to update caches without attention
lukealonso Oct 10, 2026
aa661e9
Prepare compressed NVFP4 scale layouts entirely on CUDA
lukealonso Oct 10, 2026
7c4fcfd
Resolve PCIe DCP graph launchers during plan materialization
lukealonso Oct 10, 2026
683390d
Support transient b12x panels on a shared Rich console
lukealonso Oct 11, 2026
b779705
Pass explicit query alignment to sparse MLA metadata compilation
lukealonso Oct 11, 2026
97fde4b
[b12x] Expand compact CSF blocks into native scale layouts
lukealonso Oct 11, 2026
7807f2b
Support packed MXFP4 weights through the standard blockscaled GEMM API
lukealonso Oct 11, 2026
fb1ee5e
[b12x] Materialize compressed checkpoint inputs directly on CPU
lukealonso Oct 11, 2026
7e5a142
[b12x] Prepare compressed FP4 checkpoint scales on CUDA
lukealonso Oct 11, 2026
499d6bd
Deduplicate CSF expansion tuning across layer payload sizes
lukealonso Oct 11, 2026
d032273
Pack head all-gather copies into full-warp transfers
lukealonso Oct 11, 2026
accc563
Scale PCIe pull all-reduce parallelism with payload size
lukealonso Oct 11, 2026
e683461
Prepare QSA benchmarks with the operand invocation contract
lukealonso Oct 11, 2026
7da3c36
Use split sparse attention through 128 query rows
lukealonso Oct 11, 2026
ca05e43
Size sparse-attention split capacity by local KV head count
lukealonso Oct 11, 2026
b6b1f73
Cover shared NVFP4 input packing under graph replay
lukealonso Oct 11, 2026
bf56ccb
Publish NVFP4 tasks without an extra resident grid barrier
lukealonso Oct 11, 2026
2b71ba9
Run tensor-core GEMV with K-aligned warp groups
lukealonso Oct 11, 2026
a027606
Reduce BF16 GEMV row tiles with one block barrier
lukealonso Oct 11, 2026
38a24c3
Use four compute warps for small-row MXFP8 A16 GEMM
lukealonso Oct 11, 2026
3a7a4db
Autotune small-row MXFP8 and NVFP4 compute warps
lukealonso Oct 11, 2026
0ed882a
Allow caller-owned shared storage in b12x PCIe collectives
lukealonso Oct 11, 2026
ae3a205
Allow caller-owned shared storage in b12x PCIe DMA all-reduce
voipmonitor Oct 11, 2026
d38edea
Publish multi-row TP2 all-reduces as Simple peer pushes
voipmonitor Oct 12, 2026
241d979
Push two-rank DCP head gathers and LSE combines into peer staging
voipmonitor Oct 12, 2026
299e10e
Tile prefill short convolutions over tokens
original-el8 Oct 12, 2026
0d6cd21
Score QSA representatives with tiles of query rows
original-el8 Oct 12, 2026
13d2774
Let callers attend QSA selections themselves
original-el8 Oct 12, 2026
cbb56c0
Let chain speculative sampling draw each row's stream independently o…
original-el8 Oct 12, 2026
6a460f6
Key A16 dense GEMM programs by their compute-warp count
original-el8 Oct 12, 2026
ed8005a
Run speculative-decode short convolutions in one launch
original-el8 Oct 12, 2026
d4f2289
Support DeepSeek V4 cache writes and 64-head retrieval
lukealonso Oct 13, 2026
425fb6b
Pipeline large RoCEnante all-reduces as chunked two-shot reductions
original-el8 Oct 13, 2026
64916e8
Let RoCEnante run over a caller's pinned region and describe itself f…
original-el8 Oct 13, 2026
b2fe573
Let RoCEnante gather contributions whose lengths the device decides
original-el8 Oct 13, 2026
396d37d
Expect a variable-length gather's failure from its own launch as well
original-el8 Oct 13, 2026
8f76075
List the variable-length all-gather among RoCEnante's surfaces
original-el8 Oct 13, 2026
98ad7ee
Check the variable-length benchmark's rows against regenerated contri…
original-el8 Oct 13, 2026
b19720a
Format RoCEnante's variable-length all-gather with the repository's h…
original-el8 Oct 13, 2026
6d7f238
Derive uncapped DSA selection width from page-table metadata
lukealonso Oct 14, 2026
9873d7a
Support Windows checkpoint loading and JIT preparation
lukealonso Oct 14, 2026
8d65eb2
b12x dense GEMM: fence TMA stage refills after generic-proxy reads (#16)
original-el8 Oct 15, 2026
08529e4
b12x W4A16 fused MoE: publish CTA writes before grid-barrier arrival …
original-el8 Oct 15, 2026
37f5c4c
b12x DSA indexer: synchronize publishing warps before grid-barrier ar…
original-el8 Oct 15, 2026
ecad1e4
b12x: accept caller-supplied IPC in hierarchical all-reduce
lukealonso Oct 15, 2026
2e73231
b12x: split large GEMV row grids across Y and Z dimensions
lukealonso Oct 15, 2026
5b30a1a
b12x: forward kernel configuration options through SITU MoE
lukealonso Oct 15, 2026
97a2425
b12x: preserve FP32 short-convolution weight precision
lukealonso Oct 15, 2026
71a01e5
b12x: replay kernels bit-exactly under SM contention to catch races (…
original-el8 Oct 15, 2026
34eb648
b12x dynamic MoE: fence stage reuse before TMA refills (#24)
original-el8 Oct 15, 2026
dacd732
b12x BF16 prefill projection: fence stage reuse before TMA refills (#25)
original-el8 Oct 15, 2026
c9b29c9
b12x GDN decode: synchronize the CTA between persistent work items (#26)
original-el8 Oct 15, 2026
a49edaf
b12x paged attention: fence stage reuse before TMA refills (#28)
original-el8 Oct 15, 2026
30f367d
b12x: remove standalone persistent DSA top-k
lukealonso Oct 15, 2026
29206f3
Offer cuBLAS for BF16 projections with FP32 outputs
voipmonitor Oct 13, 2026
c4e241a
Accept row-strided inputs in ordinary affine RMS normalization
voipmonitor Oct 13, 2026
4b36ac9
Skip AIR threshold search when top-p retains full probability support
voipmonitor Oct 13, 2026
5a894af
b12x: run long A16 MXFP8 calls as a BF16 GEMM over the expanded weigh…
voipmonitor Oct 15, 2026
baa81b6
b12x: compress native FP4 expert scales during weight preparation
voipmonitor Oct 15, 2026
4b964e8
b12x: fix tiled short-convolution row alignment
lukealonso Oct 16, 2026
4b4589c
b12x: support noncausal dense MLA
lukealonso Oct 16, 2026
5e2e9f6
b12x: add CPU encoder for CSF expert scales
lukealonso Oct 16, 2026
6a61066
Add Step-5 kernel support and checkpoint MoE benchmark to b12x
lukealonso Oct 16, 2026
9eac39b
Fuse per-head sigmoid gating into selected attention output
lukealonso Oct 16, 2026
e072445
b12x: fuse BF16 projection and hyperconnection stream gating
original-el8 Oct 16, 2026
a706c3b
Support FP8 circular attention history with BF16 candidates
lukealonso Oct 16, 2026
b1f081e
Merge remote-tracking branch 'lil/main' into dev/lil-main
lukealonso Oct 16, 2026
f3bbd1c
fix(b12x): wait for two-shot sends before reusing pipe_send
original-el8 Oct 16, 2026
14ba719
feat(b12x): add experimental neighbor-ring RoCE transport
original-el8 Oct 16, 2026
40c7a24
b12x: spread dense MLA chunks over every launched split
voipmonitor Oct 16, 2026
468feed
b12x: retune dense MLA splits after spreading chunks over every split
voipmonitor Oct 16, 2026
c6eca58
b12x: let island reduce-scatter and vocabulary argmax use a caller IP…
Oct 16, 2026
02cb642
b12x: memoize the dense MLA wave-balanced split search
Oct 16, 2026
7e20380
b12x: load every KDA verification token before the recurrence
voipmonitor Oct 16, 2026
3372e2d
Add prepared Mamba SSD and Bolt routing support to b12x
lukealonso Oct 17, 2026
0213747
b12x: autotune inline CSF scales across routing mixtures
lukealonso Oct 17, 2026
d3afbb7
b12x: align untuned CSF MoE defaults with routing regimes
lukealonso Oct 17, 2026
a6b096f
b12x: accelerate compact MXFP4 decode and prefill
lukealonso Oct 17, 2026
582bf2c
b12x: apply SiTU in the micro kernel's gated W4A16 activation
Oct 16, 2026
c46a0b5
Use transitive source dependencies for b12x compiler and tuning caches
lukealonso Oct 17, 2026
969eaf9
Fix Trellis lookup allocation for non-Trellis W4A16 MoE
eugr Oct 17, 2026
fd29310
Bound RoCE generations and model source-buffer ownership
original-el8 Oct 17, 2026
c637412
Enumerate bounded ring ownership with equivalent QP helpers
original-el8 Oct 17, 2026
312f389
Share BF16 projection compile identities across device ordinals
voipmonitor Oct 18, 2026
5b065ab
b12x: remove automatic MoE activation precision racing
lukealonso Oct 18, 2026
b8d4272
Allow BF16 arithmetic constraints in V4.1 MLA preparation
voipmonitor Oct 18, 2026
ab8f0b9
Rename compressed MLA arithmetic constraint to compute_mode
lukealonso Oct 19, 2026
a38aacd
Memoize b12x callable source discovery during preparation
lukealonso Oct 19, 2026
dbd4635
Accept disjoint mHC views in shared scratch storage
lukealonso Oct 19, 2026
622cec1
Avoid redundant copies in in-place top-k masking
voipmonitor Oct 19, 2026
d51d1b0
perf(b12x): keep eight relayed packets in flight per sender and rail
FujitsuPolycom Oct 19, 2026
4092b28
formal(b12x): model the relay window in the ring ownership checks
FujitsuPolycom Oct 18, 2026
03de0b6
Route serialized TP4 BF16 reductions through single-rounding two-shot
lukealonso Oct 21, 2026
f95c59c
Reuse compressed-scale metadata and reconstruct FC2 warp rows
lukealonso Oct 21, 2026
82d2ab1
Push DCP all-gather segments into receiver-local staging
lukealonso Oct 21, 2026
d4907da
Push TP4 BF16 all-reduces through reduce-scatter and all-gather
lukealonso Oct 21, 2026
0079595
fix(b12x): honor declared MoE precision when tuning CSF (#42)
original-el8 Oct 21, 2026
325aa26
Fix PCIe collective setup and prepared dispatch contracts
lukealonso Oct 21, 2026
7b9b49d
Cover NVFP4 compressed scale reader tails and pointer strides
lukealonso Oct 21, 2026
7364364
feat(b12x): add graduated autotune effort and correct candidate pruning
lukealonso Oct 22, 2026
dc7493c
Parallelize candidate program discovery during preparation
lukealonso Oct 22, 2026
c18261d
Reject unsliceable mHC TF32 projection layouts at every tuning effort
lukealonso Oct 22, 2026
4eebbe1
Reclaim losing autotune executables between race batches
lukealonso Oct 22, 2026
16e0240
Persist b12x tuning progress and device-independent program discovery
lukealonso Oct 22, 2026
3602ebe
Preserve singleton weight rows in BF16 prefill TMA descriptors
lukealonso Oct 22, 2026
0765eaf
Read F8_E8M0 scale storage in the CSF MXFP4 encoder
lukealonso Oct 22, 2026
cb41087
fix(b12x): forward relayed ring packets in serial order
FujitsuPolycom Oct 20, 2026
ed2a68a
feat(b12x): open-chain mode for the neighbor ring transport
FujitsuPolycom Oct 20, 2026
ff6f0e8
Defer cyclic collection until autotune job cleanup
lukealonso Oct 22, 2026
3563f33
Break CuTe executor self-references during runtime initialization
lukealonso Oct 22, 2026
26154f4
fix(b12x): declare delta-prefill factory source dependencies
lukealonso Oct 23, 2026
afea2aa
Support prepared MiniMax M3.1 attention and token-scaled experts
lukealonso Oct 23, 2026
9c9e94e
Share delta-prefill compile identities across device ordinals
lukealonso Oct 23, 2026
85bb716
Experiment with payload-ready PCIe one-shot and fused reduce-scatter …
lukealonso Oct 23, 2026
673113b
Tune prepared PCIe collectives jointly across ranks
lukealonso Oct 23, 2026
9f06b6f
Add MXFP4 fused indexer benchmark and staged controls
lukealonso Oct 23, 2026
7ba63a5
Support captured warm-cache tuning and resource eligibility rejection
lukealonso Oct 23, 2026
03d2cbb
Fuse MXFP4 indexing with bounded exact selection and tunable CUDA sch…
lukealonso Oct 23, 2026
4696cd6
Use fused MXFP4 plans in production and remove split selection
lukealonso Oct 23, 2026
1e7f9e3
Preserve broadcast page-table ABI in prepared MXFP4 indexing
lukealonso Oct 23, 2026
e361345
Integrate prepared PCIe collective transports and group autotuning
lukealonso Oct 24, 2026
027616d
fix(b12x): tune MXFP8 GEMMs across activation precision choices
lukealonso Oct 24, 2026
7ec1c19
fix(b12x): preserve full searches in activation precision races
lukealonso Oct 24, 2026
68388ae
feat(b12x): make selected-plan priming optional
lukealonso Oct 24, 2026
259648d
fix(b12x): separate verify schedule from physical query capacity
lukealonso Oct 25, 2026
78bf6ba
bench(b12x): add Flare TP4 DeepSeek V4.1 MLA profile
lukealonso Oct 25, 2026
74e33ec
perf(b12x): accelerate packed compressed MLA decode
lukealonso Oct 25, 2026
43eaf93
perf(b12x): accelerate native MXFP4 MoE decode
lukealonso Oct 25, 2026
652ca79
perf(b12x): pipeline autotuning preparation and record per-race ledgers
lukealonso Oct 25, 2026
211293b
feat(b12x): collapse autotune effort tiers to off, default and audit
lukealonso Oct 25, 2026
46dc944
perf(b12x): fit default-tier searches and heuristic defaults to race …
lukealonso Oct 25, 2026
62203fb
fix(b12x): bound concurrent discovery lock descriptors
lukealonso Oct 25, 2026
344e483
fix(b12x): hash candidate program identities by value
lukealonso Oct 25, 2026
5a071cd
Fuse lagged mHC projection and normalization with compensated TF32
lukealonso Oct 26, 2026
cb941b6
Expand lagged mHC with optional normalization and row-tile tuning
lukealonso Oct 26, 2026
ff802a2
Include fused row tiles in mHC tuning test assignments
lukealonso Oct 26, 2026
fbc859f
Select fused lagged mHC below the TMA prefill crossover
lukealonso Oct 26, 2026
d6f18b6
Prefetch compact FC1 CSF metadata per task (#46)
voipmonitor Oct 26, 2026
9b9ed3b
Omit unused prepared compressed-MLA control fills (#47)
voipmonitor Oct 26, 2026
b34e2c5
Measure the mHC native/TF32 crossover instead of scaling it (#52)
original-el8 Oct 27, 2026
4b3f45d
Race compact W4A8 inline scales instead of hardcoding a band (#53)
original-el8 Oct 27, 2026
2870678
Expose prepared outputs and mutable scale storage to the compiler
lukealonso Oct 27, 2026
ea22a36
Optimize Qwen decode kernels and generalize PCIe collectives
lukealonso Oct 27, 2026
b486d23
Extend close collective tuning races within explicit sampling bounds
lukealonso Oct 27, 2026
ad7027c
Skip inter-block arrivals for single-block RoCE collectives
lukealonso Oct 27, 2026
20fc8d3
Prepare caller-owned MXFP8 rows and split MLA normalization (#54)
voipmonitor Oct 27, 2026
30a56c4
Preserve FP32 MXFP8 split-K and dependent CuTe launches (#55)
voipmonitor Oct 27, 2026
7447085
Autotune combinations of prepared kernels (#56)
voipmonitor Oct 27, 2026
634ebe1
Fuse V4.1 window snapshots with prepared cache appends (#57)
voipmonitor Oct 27, 2026
a9188a3
Exclude CUDA ordinals from prepared hyperconnection program keys
lukealonso Oct 27, 2026
60b4ea9
Test prepared PCIe calls and concurrent TP4 graph channels
lukealonso Oct 27, 2026
e871660
Retain measured collective candidates in preparation progress totals
lukealonso Oct 27, 2026
f91f257
Time collective reductions with token-scaled CUDA graph chains
lukealonso Oct 27, 2026
4aa874b
Prune extremely serialized PCIe reduction grids from default tuning
lukealonso Oct 27, 2026
4fd566c
Reuse collective benchmark fixtures across tuning candidates
lukealonso Oct 27, 2026
830427a
WIP: add fused BF16 router projection experiments
lukealonso Oct 27, 2026
6627379
Add BF16 PCIe pull RSAG with acquire-ordered peer barriers
lukealonso Oct 27, 2026
aef364f
Add runtime-selectable BF16 PCIe collective kernels
lukealonso Oct 27, 2026
19b7936
Capture startup mode selection over prepared PCIe collective finalists
lukealonso Oct 27, 2026
74fcf4e
Make joint collective planning and workspace allocation opt-in
lukealonso Oct 27, 2026
d591bda
Expose the DMA channel capture lifetime context (#59)
voipmonitor Oct 28, 2026
035b7fb
Support BF16 head64 paged decode with legal even KV MMA tiles
lukealonso Oct 28, 2026
c9b664b
Support unweighted NVFP4 routes and independent FC1 half gains
lukealonso Oct 28, 2026
f3616c0
Screen clearly slower collective challengers after one round
lukealonso Oct 27, 2026
bb75270
Revert "Screen clearly slower collective challengers after one round"
lukealonso Oct 27, 2026
b22ea63
Calibrate collective transfer buckets before tuning two retained fami…
lukealonso Oct 27, 2026
637c469
Document collective calibration and exercise audit effort in host fix…
lukealonso Oct 27, 2026
f2eb880
Keep collective calibration scoped to builtin independent benchmarks
lukealonso Oct 27, 2026
8d6c936
Encode invocation metadata in collective bucket keys
lukealonso Oct 27, 2026
733c284
Separate bucket calibration by two-shot staging geometry
lukealonso Oct 27, 2026
d402f9c
Cover launch-grid retention within calibrated collective families
lukealonso Oct 27, 2026
c7402c0
Scope collective family buckets to contract versions
lukealonso Oct 27, 2026
f034125
Support Muse FP8 attention and fixed-order NVFP4 route outputs
lukealonso Oct 28, 2026
46bb038
Add offline joint collective ladder search and per-report plots
lukealonso Oct 28, 2026
c8b37d0
Preserve early collective bucket exclusions and finalist coverage
lukealonso Oct 28, 2026
9e08169
Tune small PCIe gathers with sequenced payload words
voipmonitor Oct 28, 2026
0b61788
Support offline joint collective profiles and reduce latency ownershi…
lukealonso Oct 28, 2026
443d8fa
Merge offline collective preparation into sequenced gather support
voipmonitor Oct 28, 2026
f5f5341
Prevent dense split-K output offsets from overflowing 32 bits
lukealonso Oct 28, 2026
c37d2d9
b12x fused MoE: TrellisMX (procedural NPK) source format with an in-t…
brandonmmusic-max Oct 31, 2026
a7f94e2
Support device-selected PCIe column gathers
lukealonso Nov 1, 2026
361e45f
Measure and recommend PCIe gather profiles
lukealonso Nov 1, 2026
e94faff
Add explicit clustered phased PCIe all-reduce profiles (#70)
voipmonitor Nov 3, 2026
fd19f00
b12x paged attention: ignore unused V-tail elements in the PV MMA (#43)
Maxrio9 Nov 3, 2026
97a5b90
Adapt captured verification attention to live context lengths
lukealonso Oct 30, 2026
0543090
Stage paired circular KV windows directly into FP8 buffers
lukealonso Oct 30, 2026
ff795bc
Remove unused tensor FP8 scale staging from TMA GEMM
lukealonso Oct 30, 2026
0c3bea9
Fuse rounded SwiGLU into prepared NVFP4 activation packing
lukealonso Oct 30, 2026
6d77b22
Prepare packed NVFP4 dense projections with BF16 activations
lukealonso Oct 30, 2026
5664624
Remove packed NVFP4 dense projections
lukealonso Nov 2, 2026
e61e942
Support NHD paged FP8 prefill and fused output gates on SM12x
lukealonso Nov 2, 2026
3f4711d
Improve blockscaled staging and persistent tile reuse on SM12x
lukealonso Nov 2, 2026
08d24bc
Support paged attention query blocks through sixteen tokens
lukealonso Nov 2, 2026
18c742c
Bound MXFP8 weight-only staging by split-K iteration count
lukealonso Nov 2, 2026
93f5999
Allow native MXFP8 split-K through sixteen rows
lukealonso Nov 2, 2026
42ba2f1
Optimize SM12x dense decode kernels and split-K execution
lukealonso Nov 3, 2026
dc37404
Declare calibrated A4 prefill for packed NVFP4 experts
lukealonso Nov 4, 2026
3c2729e
Fix moe sfb double reshape (#71)
mark-yong Nov 4, 2026
e977747
Share storage across PCIe startup tuning races (#72)
voipmonitor Nov 4, 2026
1f8ed8a
Mask unused KV operands across attention kernels
lukealonso Nov 4, 2026
ae3494d
Mask KV below the window start in paged PV paths (#73)
mark-yong Nov 5, 2026
f7e6730
Keep paged MSA extend loads within the visible extent (#74)
mark-yong Nov 5, 2026
42b221d
Add pipelined reduce-scatter and shard gather to RoCEnante (#75)
original-el8 Nov 5, 2026
0bd028f
Describe the TrellisMX P8 runtime in present-state comments
brandonmmusic-max Nov 5, 2026
057e6d1
[b12x] Register bounce slots with io_uring before CUDA (#76)
original-el8 Nov 6, 2026
7b0d0f2
Merge local-inference-lab/flashinfer main into b12x-trellismx-p8-runtime
brandonmmusic-max Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,63 @@ kernel-source SHA256 wipes and lazily rebuilds the module. Reference usage:
`flashinfer/quantization/kernels/nvfp4_quantize.py`. Disable with
`FLASHINFER_CUTE_DSL_DISABLE_CACHE=1`.

The experimental b12x backend uses
`flashinfer/experimental/b12x/_lib/compiler.py` and stores compiled objects in
`$B12X_COMPILE_CACHE_DIR`, or `$XDG_CACHE_HOME/b12x/compile` (defaulting to
`~/.cache/b12x/compile`). Its disk identity includes the callable's transitive
local source files, compiler support files, resolved specialization, effective
code-generation options, toolchain, and device architecture. AST import tracing
includes nested and conditional imports, inherited callables, decorators, and
callable defaults. External packages participate through toolchain identity.
Raw environment variables and diagnostic output destinations do not participate;
environment-selected code generation must be represented by resolved kernel
parameters or compiler options. Computed imports in implementation modules
declare local targets in `__b12x_source_dependencies__`. Shared helpers live in
leaf modules under `_lib/intrinsics/`, `_lib/utils/`, `_lib/dense_gemm/`, and
`moe/_shared/kernels/`; consumers import the defining module to keep dependency
closures narrow. Callable source discovery is cached by function or class,
including the owner class for bound methods, and cleared by
`clear_compile_cache()`. Source and compiler configuration are process-immutable:
restart after editing code or changing compiler defaults. Warm in-memory hits
and prepared CUDA graph replay do not read or parse source files.

b12x autotuning selection keys include the actual compile keys of every eligible
candidate, including previously losing candidates. Preparation describes their
programs without lowering or launching kernels and reuses those descriptions for
compilation. Changes to relevant source, specialization, compiler options, or
toolchain require a fresh race. Unrelated kernels retain their saved selections.
The tuning contract's schema versions and `B12X_TUNING_CACHE_VERSION` remain
explicit controls for changes to tuning semantics and manual retuning.

Experimental b12x preparation requests can opt into `FinalistPolicy` to retain
measured configurations by tuning-parameter family, independently of the
standalone winner. The policy has a separate selection-cache identity. Sharded
finalist requests pass every rank's contribution, including empty shards, to
`PreparationJob.advance(tuning=...)` in rank order; ordinary requests pass one
consolidated winner per key. Callers
prepare alternative plans and capture complete computations as
`ContextCandidate` objects, then call `PreparationSession.race_contexts` before
freezing the session. The returned contextual winner does not replace standalone
selections. Input reset and production occur outside the timed replay; producer
work that belongs in the measurement must be captured inside the graph. Cold
cache eviction follows input production. Multi-rank contexts agree on candidate
catalogs, rank membership, sample schedules, producer counts, and cache policy
before replay, and score each sample by its slowest rank. Trial graph cleanup
callbacks run after synchronization; callers release losing plans before final
capture. Contextual races require an unfrozen session with preparation drained.

Every completed b12x tuning race appends a self-describing record to the
`ledger_v1` table of the race-progress database beside the selection cache:
component, encoded query, effort, coverage, measurement protocol, and for every
candidate its assignment, lowered config, program keys, the lowest
autotune effort that admits it, and per-round timings, plus the batches raced,
rejected candidates, and wall seconds per phase. Records are append-only, so
retuning accumulates replications. `python -m b12x.tools.tuning_ledger
[--root DIR] [--records] [--replications]` merges tensor-parallel shard records
into runs and reports default regret, pruning regret (the default tier's best
candidate against an audit winner), runner-up margins, round-to-round noise,
and replication agreement.

### Dispatch Macros

Handle combinatorial parameter spaces:
Expand Down
65 changes: 65 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,71 @@ the sample count to stay within the rotating-state capacity and set
iterations fit. `--dry-run-iters` and `--repeat-iters` request fixed iteration
counts; they are not duration targets.

## Prepared DeepSeek V4.1 MLA on SM120/SM121

The experimental [V4.1 MLA benchmark](experimental/b12x/benchmark_deepseek_v41_mla.py)
runs rank-local Flare TP4 attention shapes on one selected GPU:

```sh
python benchmarks/experimental/b12x/benchmark_compressed_sparse_mla.py \
--preset flare-dsv41-tp4 \
--model-config /path/to/DeepSeek-V4.1-Flash-1017/config.json \
--device 4 --output-csv /tmp/v41-mla.csv
```

The profile uses BF16 arithmetic, 16 query heads, a 1M-token context capacity,
8192-column indexed page tables, and a 512-token live context. It covers SWA,
C2, C1, and draft SWA through prepared plans and captured CUDA graph replay.
`--verify-shapes BxWxP` keeps the per-request query ceiling `W` separate from
the physical packed query rows `P`. A 4096-row prefill uses 128 suffix rows
for C1 attention. `--describe` prints the resolved contracts without importing
GPU libraries; use `--preset flare-dsv41-tp4 --help` for all profile options.

Queries, cache values, sinks, and selections are synthetic. The indexed cache
view has 895489 rows, requiring about 33 GB for C1; ordinary PyTorch backing
differs from Flare's virtual-memory residency. `--cache-pages` explicitly
overrides that descriptor for smaller fixtures. Timing includes attention and
logical-to-physical page mapping, excluding projections, index selection,
cache writes, and communication. L2 eviction runs outside timed replay by
default; `--no-flush-l2` disables it. CSV results retain actual layouts,
selected configurations, numerical errors, cache policy, and raw timings.

## Prepared BF16 router projection and top-k

The experimental [router benchmark](experimental/b12x/benchmark_router_projection.py)
compares tuned b12x projection plus top-k with a CuTe DSL single-launch prototype.
Both round projection logits to BF16, break ties by descending expert ID, and
return selected logits and normalized softmax weights in FP32. The fused kernel
uses caller-owned logit scratch and completion counters; it is not selected by
the serving runtime. Four warps cooperate on each expert by default, with eight
warps per CTA. This SIMT kernel targets small decode batches; wider batches can
be slower than the split path.

```sh
python -m benchmarks.experimental.b12x.benchmark_router_projection \
--device 10 --checkpoint /path/to/Qwen3.8-Flash-Next-FP4-Local \
--layers 0 23 47 mtp --rows 1 2 3 4 5 6 --output /tmp/router.json
```

Activations are synthetic. Without `--checkpoint`, weights are synthetic too.
The default geometry is 2560 inputs, 512 experts, and top-10 routing. Correctness
checks require exact expert IDs against BF16 projection and stable sorting,
check selected logits and weights, and replay changed inputs and all-zero ties
with poisoned scratch and fixed allocations. A failed check prevents timing.
The reference disables reduced-precision BF16 partial reductions for its matmul,
then restores the setting before executing either measured implementation.
The preparation session remains alive and frozen through measurement.

Timings cover the complete operation and counter recycling in captured graphs,
using balanced rounds from `b12x.testing.benchmark.measure_calls`. The default
128 MiB L2 eviction runs outside timing; `--eviction-mib 0` measures warm-cache
replay. JSON retains per-layer/per-shape timings, raw samples, the selected split
projection configuration, and the fused `--rows-per-tile`, `--warps`, and
`--warps-per-expert` geometry.
Use `--implementations split` for the control alone or `--check-only` to validate
without timing. These component timings do not measure expert overlap or model
throughput.

## Overview

This framework provides tools to:
Expand Down
7 changes: 4 additions & 3 deletions benchmarks/experimental/b12x/autotune_dense_fp4_tile_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
make_nvfp4_operand,
)
from benchmarks.experimental.b12x.common import make_l2_flush_fn, resolve_l2_flush_bytes
from b12x._lib.dense_gemm import _select_default_dense_gemm_plan, dense_gemm
from b12x._lib.dense_gemm import DenseGemmKernel
from b12x._lib.utils import get_num_sm
from b12x._lib.dense_gemm.policy import _select_default_dense_gemm_plan
from b12x._lib.dense_gemm.execution import dense_gemm
from b12x._lib.dense_gemm.kernel import DenseGemmKernel
from b12x._lib.utils.device import get_num_sm


@dataclass(frozen=True)
Expand Down
10 changes: 4 additions & 6 deletions benchmarks/experimental/b12x/autotune_dense_mxfp8_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
cosine_similarity,
make_mxfp8_operand,
)
from b12x._lib.dense_gemm import (
DenseGemmKernel,
_select_default_dense_gemm_plan,
dense_gemm,
)
from b12x._lib.utils import get_num_sm
from b12x._lib.dense_gemm.kernel import DenseGemmKernel
from b12x._lib.dense_gemm.policy import _select_default_dense_gemm_plan
from b12x._lib.dense_gemm.execution import dense_gemm
from b12x._lib.utils.device import get_num_sm


BASELINE_COSINE_THRESHOLD = 0.9999
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/experimental/b12x/autotune_dense_mxfp8_split_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
make_mxfp8_operand,
)
from benchmarks.experimental.b12x.common import make_l2_flush_fn, resolve_l2_flush_bytes
from b12x._lib.dense_gemm import (
from b12x._lib.dense_gemm.policy import (
_select_default_dense_gemm_plan,
_select_mxfp8_tile_k,
dense_gemm,
)
from b12x._lib.utils import get_num_sm
from b12x._lib.dense_gemm.execution import dense_gemm
from b12x._lib.utils.device import get_num_sm


BASELINE_COSINE_THRESHOLD = 0.9999
Expand Down
164 changes: 164 additions & 0 deletions benchmarks/experimental/b12x/benchmark_block_fp8_gemv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#!/usr/bin/env python3
"""Small-row serialized block-FP8: GEMV regime vs the dense GEMM plan.

Times fixed ``expected_m`` plans (the decode shape vLLM declares per CUDA graph
size) through ``blockscaled.mm_block_fp8``, once with the GEMV regime and once
with it disabled, using the preparation engine's GPU sampler. ``--cold`` flushes L2 before
every call, which is what a decode step sees for weights larger than L2.

python benchmarks/experimental/b12x/benchmark_block_fp8_gemv.py [--cold] [--rows 1,2,4,8]
[--shapes 3712x4096,1024x7168]
"""

from __future__ import annotations

import argparse
import contextlib

import torch

from b12x.gemm import blockscaled
from b12x.gemm.blockscaled import _block_fp8_gemv
from b12x.preparation import PreparationSession, PreparedCall
from b12x.testing.benchmark import measure_calls

DEFAULT_SHAPES = [
(n, k)
for k in (1536, 4096, 7168)
for n in (256, 512, 1024, 2048, 3712, 4096, 6144, 8192, 16384)
]


@contextlib.contextmanager
def _gemv_enabled(enabled: bool):
original = _block_fp8_gemv.supports
if not enabled:
_block_fp8_gemv.supports = lambda *args: False
try:
yield
finally:
_block_fp8_gemv.supports = original


def _prepare(lhs, lhs_scale, rhs, rhs_scale, rows):
query = blockscaled.FixedBlockscaledQuery(
recipe="block_fp8",
call_kind="serialized",
max_rows=rows,
in_features=rhs.shape[1],
padded_in_features=rhs.shape[1],
out_features=rhs.shape[0],
input_dtype="float8_e4m3fn",
output_dtype="bfloat16",
expected_m=rows,
)
plan = blockscaled.plan(query)

def call(state):
return PreparedCall(
run=lambda: state.run_serialized(
lhs,
lhs_scale,
rhs,
rhs_scale,
None,
ab_dtype="float8_e4m3fn",
sf_dtype="float32",
c_dtype="bfloat16",
sf_vec_size=128,
block_fp8=True,
stream=None,
)
)

session = PreparationSession(device=lhs.device, autotune=False, compile_workers=4)
session.__enter__()
session.prepare((plan.request(name="bench", prepare_call=call),))
return session, plan


def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--rows", default="1,2,4,8")
parser.add_argument("--shapes", default=None, help="NxK list, e.g. 3712x4096")
parser.add_argument("--cold", action="store_true")
parser.add_argument("--iters", type=int, default=25)
args = parser.parse_args()
shapes = (
[tuple(int(v) for v in s.split("x")) for s in args.shapes.split(",")]
if args.shapes
else DEFAULT_SHAPES
)
rows_list = [int(r) for r in args.rows.split(",")]
device = torch.device("cuda")
flush = (
torch.empty(320 << 20, dtype=torch.uint8, device=device) if args.cold else None
)
print(
f"{'N':>6} {'K':>6} {'M':>2} {'dense_us':>9} {'gemv_us':>8} {'speedup':>7} eligible"
)
for n, k in shapes:
gen = torch.Generator(device=device).manual_seed(n * 131 + k)
rhs = torch.randn((n, k), generator=gen, device=device).to(torch.float8_e4m3fn)
rhs_scale = torch.rand(
((n + 127) // 128, k // 128), generator=gen, device=device
)
for rows in rows_list:
lhs = torch.randn((rows, k), generator=gen, device=device).to(
torch.float8_e4m3fn
)
lhs_scale = torch.rand((rows, k // 128), generator=gen, device=device)
lhs_ref = lhs.double() * lhs_scale.double().repeat_interleave(128, dim=1)
rhs_ref = rhs.double() * rhs_scale.double().repeat_interleave(128, dim=0)[
:n
].repeat_interleave(128, dim=1)
reference = lhs_ref @ rhs_ref.T
ulp = reference.abs().clamp_min(1e-30) * 2.0**-7
calls = {}
with contextlib.ExitStack() as stack:
for label, enabled in (("dense", False), ("gemv", True)):
with _gemv_enabled(enabled):
original_max = _block_fp8_gemv.MAX_OUT_FEATURES
_block_fp8_gemv.MAX_OUT_FEATURES = 1 << 30
try:
session, plan = _prepare(
lhs, lhs_scale, rhs, rhs_scale, rows
)
finally:
_block_fp8_gemv.MAX_OUT_FEATURES = original_max
stack.callback(session.close)

def fn(plan=plan):
return blockscaled.mm_block_fp8(
lhs, lhs_scale, rhs, rhs_scale, plan=plan
)

output = fn()
error = (output.double() - reference).abs()
assert torch.isfinite(output).all()
if enabled:
assert bool(
(error <= ulp + 1e-6 * reference.abs().max()).all()
), label
else:
# Dense split-K may round partial sums to BF16.
assert float(error.norm() / reference.norm()) < 4e-3, label
calls[label] = PreparedCall(
run=fn, produce=lambda: None, owners=(plan, session)
)
measured = measure_calls(
calls,
samples=args.iters,
eviction=(lambda: None) if flush is None else flush.zero_,
)
times = measured.latencies_us
eligible = _block_fp8_gemv.supports(rows, n, k)
print(
f"{n:6d} {k:6d} {rows:2d} {times['dense']:9.2f} {times['gemv']:8.2f} "
f"{times['dense'] / times['gemv']:7.2f} {'yes' if eligible else 'no'}",
flush=True,
)


if __name__ == "__main__":
main()
Loading
Loading