Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
404 commits
Select commit Hold shift + click to select a range
a867199
[None][feat] modeling_v2 Kimi K3 target: its DSpark drafter on the dr…
vsabavat Oct 3, 2026
b79745b
[None][test] modeling_v2 Kimi K3 target: the DSpark drafter against t…
vsabavat Oct 3, 2026
592ea1a
[None][test] Kimi K3 drafter attention: the R x 7 splits
vsabavat Oct 3, 2026
31b6275
[None][test] Kimi K3 drafter attention tests: name the splits they run
vsabavat Oct 3, 2026
18f1edd
[None][doc] modeling_v2 catalog: the Kimi K3 drafter attention certif…
vsabavat Oct 3, 2026
0d16d09
[None][feat] modeling_v2 Kimi K3 target: the DSpark drafter takes R x…
vsabavat Oct 3, 2026
706cf2d
[None][test] Kimi K3 kernel lints: the KDA, MLA and drafter kernels' …
vsabavat Oct 3, 2026
f0e7d4c
[None][test] Kimi K3 SiTU MoE: the TP16 shard (192 values, padded to …
vsabavat Oct 3, 2026
ea84b23
[None][perf] Mamba state metadata: skip unchanged per-step uploads
vsabavat Oct 3, 2026
77be712
[None][test] Kimi K3 MLA decode view test: list it in l0_cpu, not l0_…
vsabavat Oct 3, 2026
87c7e70
[None][test] modeling_v2 MNNVL op matrices: run on sm_100 only
vsabavat Oct 3, 2026
52ca9fa
[None][test] Kimi K3 MLA decode view test: list it in l0_cpu, not l0_…
vsabavat Oct 3, 2026
8e852d2
[None][test] modeling_v2 Kimi K3 routing and claims tests: list them …
vsabavat Oct 3, 2026
543ebb3
[None][test] modeling_v2 Kimi K3 construction and drift tests: list t…
vsabavat Oct 3, 2026
871ef64
[None][test] modeling_v2 Kimi K3 routing and claims tests: list them …
vsabavat Oct 3, 2026
8806ae3
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry C4 into the …
vsabavat Oct 3, 2026
32a581a
[None][feat] Kimi K3 DSpark decode: k3_spec_accept, k3_ctx_kv and k3_…
vsabavat Oct 3, 2026
aaef4b7
[None][doc] k3_markov: state the co-residency assumption
vsabavat Oct 3, 2026
a1d336d
[None][feat] DFlash / DSpark worker: Kimi K3 decode kernels behind k3…
vsabavat Oct 3, 2026
e85d7a6
[None][feat] modeling_v2 Kimi K3 tp16_moetp4ep4: the speculative work…
vsabavat Oct 3, 2026
4166788
[None][doc] modeling_v2 Kimi K3 tp16_moetp4ep4: the spec-worker gate'…
vsabavat Oct 3, 2026
2b465f6
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the speculat…
vsabavat Oct 3, 2026
32d419b
[None][feat] DFlash metadata: capture_view, a captured layer's slot o…
vsabavat Oct 3, 2026
1447397
[None][perf] DFlash: the draft block's rows as a view where its slots…
vsabavat Oct 3, 2026
33d3586
[None][test] Kimi K3 DSpark decode kernel tests: list them in l0_b200…
vsabavat Oct 3, 2026
5c193ac
[None][test] Kimi K3 Markov chain test: run its checks under pytest o…
vsabavat Oct 3, 2026
490f289
[None][test] Kimi K3 sharded k3_spec_accept test: run under pytest on…
vsabavat Oct 3, 2026
f85b709
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: split the DSpark dra…
vsabavat Oct 3, 2026
135ab0c
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: the DSpark drafter's…
vsabavat Oct 3, 2026
00e4394
[None][perf] DFlash / Kimi K3 DSpark drafter: the gen requests' page-…
vsabavat Oct 3, 2026
ac6e287
[None][doc] modeling_v2 Kimi K3 tp16_moetp4ep4: the drafter gate requ…
vsabavat Oct 3, 2026
147b87d
[None][test] k3_ctx_kv test: drop the base-port identity cases, zero …
vsabavat Oct 3, 2026
b7ea3f6
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the DSpark d…
vsabavat Oct 3, 2026
19ef779
[None][test] Kimi K3 kernel tests: make their pool workers' functions…
vsabavat Oct 3, 2026
428f6f2
[None][perf] modeling_v2 Kimi K3 tp16_moetp4ep4: the DSpark tap from …
vsabavat Oct 3, 2026
fe9eaf5
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the sandwich…
vsabavat Oct 3, 2026
4bf3512
[None][perf] modeling_v2 Kimi K3 target: the decode MoE's latent all-…
vsabavat Oct 3, 2026
41b2245
[None][test] Kimi K3 k3_moe push test: route A's expert layout
vsabavat Oct 3, 2026
aed1c94
[None][chore] modeling_v2 Kimi K3 tp16_moetp16ep1: carry the latent p…
vsabavat Oct 3, 2026
d6613a1
[None][feat] modeling_v2 Kimi K3 tp16_moetp16ep1: the MoE decode path…
vsabavat Oct 3, 2026
3656bcd
[None][perf] Kimi K3 generic MoE path: the fused route + MXFP8 quant …
vsabavat Oct 3, 2026
74839d1
[None][perf] Kimi K3 targets: route the generic MoE outside the TRTLL…
vsabavat Oct 3, 2026
4657c20
[None][test] Kimi K3 decode-comm matrix: route A's shared-expert slic…
vsabavat Oct 3, 2026
0da8a02
[None][fix] Kimi K3 decode MoE warm-up: no back-to-back k3_moe calls …
vsabavat Oct 3, 2026
546e567
[None][perf] DFlash: skip unchanged slot-buffer copies on decode steps
vsabavat Oct 3, 2026
a9938c2
[None][fix] KV cache manager V2: count the live-floor KDA token-state…
vsabavat Oct 4, 2026
54b87a2
[None][fix] KV cache manager V2: refuse per-token KDA states off the …
vsabavat Oct 4, 2026
459e446
[None][doc] Kimi K3 sandwich: polled input and fold store before the …
vsabavat Oct 4, 2026
c954d6a
[None][test] Kimi K3 noaux_tc MXFP8 quant graph test: free each captu…
vsabavat Oct 4, 2026
1e6eb67
[None][fix] KV cache manager V2: keep a suspended request's KDA repla…
vsabavat Oct 4, 2026
10fd5cf
[None][fix] KV cache manager V2: refuse a KV pool rebalance with the …
vsabavat Oct 4, 2026
c48e85e
[None][test] Kimi K3 decode-comm matrix: free a graph's outputs befor…
vsabavat Oct 4, 2026
2f25c1d
[None][fix] DSpark K3 Markov path: release the step's acceptance and …
vsabavat Oct 4, 2026
3411d48
[None][test] Kimi K3 DSpark drafter test: give the one-rank drafter's…
vsabavat Oct 4, 2026
b3b4e27
[None][test] Kimi K3 k3_ctx_kv: back-to-back calls share the arrival …
vsabavat Oct 4, 2026
ae6e9a9
[None][test] Kimi K3 k3_spec_accept and k3_markov: arrival counters a…
vsabavat Oct 4, 2026
b521431
[None][test] MNNVL catalog matrices: armed checks wait for every rank
vsabavat Oct 4, 2026
13b26f4
[None][doc] Kimi K3 k3_spec_accept and k3_ctx_kv: calls on a device a…
vsabavat Oct 4, 2026
50ac9d6
[None][fix] kda_prefill: release evicted scratch with its cache entry
vsabavat Oct 4, 2026
a0509b3
[None][fix] LoRA overlap: leave the output record to maybe_execute_in…
vsabavat Oct 6, 2026
77a450e
[None][doc] multi_stream_utils: note the compiled path and the error'…
vsabavat Oct 6, 2026
c3ced8d
[None][test] test_multi_stream_utils: bound the capture's block count
vsabavat Oct 6, 2026
f39f875
[None][perf] Kimi K3 attn_res_fwd online kernel: double-buffer ws_sta…
vsabavat Oct 6, 2026
b2a6af4
Kimi K3 KDA prefill: K1 warps finish reading sPartialLast before the …
vsabavat Oct 2, 2026
2e598e1
[None][feat] One-model speculative decoding: the worker produces the …
vsabavat Oct 1, 2026
b12bfad
DFlash: empty the dummy slot in the drafting step, not in prepare()
vsabavat Oct 6, 2026
ce1ae63
[None][feat] KDA: commit pending accepted drafts into the live pools
vsabavat Oct 6, 2026
f9d32b4
[None][fix] KV cache manager V2: commit a suspended request's KDA rep…
vsabavat Oct 6, 2026
93c0b28
MNNVL all-reduce: remove LamportFlags' unused cluster-arrival mode
vsabavat Oct 7, 2026
0c9ab14
Merge main 70193ec43b into k3-up/u1-engine-host-gap
vsabavat Oct 7, 2026
eda9db2
[None][fix] DSpark GQA drafter: check the kept mask row at load and c…
vsabavat Oct 7, 2026
a0fa306
[None][fix] Mamba2 metadata: upload CPU-tensor state indices through …
vsabavat Oct 7, 2026
fd37763
[None][test] copy_to_device_if_changed: check skipped copies in debug…
vsabavat Oct 7, 2026
bea6002
[None][perf] spec_step_copies: run on the SM 100 family (SM 100, 103,…
vsabavat Oct 7, 2026
0e29964
[None][perf] spec_step_copies: drop the staged host-to-device copies,…
vsabavat Oct 7, 2026
0cbb559
[None][fix] DSpark GQA drafter: keep no mask row for DFlash's default…
vsabavat Oct 7, 2026
b83f960
[None][fix] DSpark GQA drafter: keep the trained row of the worker's …
vsabavat Oct 7, 2026
d0c47c2
[None][chore] Merge #19827's head b12bfad22c: DFlash empties the dumm…
vsabavat Oct 7, 2026
25fd87a
[None][fix] Kimi K3 DSpark drafter: empty the dummy slot after k3_ctx_kv
vsabavat Oct 7, 2026
2c331d5
[None][fix] Kimi K3 KDA verify: kda_state_tok holds the drafts' records
vsabavat Oct 7, 2026
c95eac1
[None][fix] KDA suspend: read the drafts' records as [slots, 3, num_s…
vsabavat Oct 7, 2026
dc903ae
[None][fix] KDA verify: size kda_state_tok for the drafts' records
vsabavat Oct 7, 2026
c05a0c3
[None][fix] KDA verify: drop the replay caches the drafts' records re…
vsabavat Oct 7, 2026
44a06db
Merge main a1f562a696 into k3-up/u1-engine-host-gap
vsabavat Oct 7, 2026
003f8d0
[None][fix] KDA suspend: commit and relocate without the replay caches
vsabavat Oct 7, 2026
de2f7e1
[None][fix] KV cache manager V2: count every live-floor SSM slot in t…
vsabavat Oct 7, 2026
04c6f56
[None][doc] Kimi K3: kda_state_tok holds the last verify's draft records
vsabavat Oct 7, 2026
fd476e7
Merge main 4a36c5b2fb into k3-up/u4-g3-stateful
vsabavat Oct 7, 2026
3f54e9d
Merge main 4a36c5b2fb into k3-up/k3-rest
vsabavat Oct 7, 2026
547f6bf
Merge #19831 (P1) at c3ced8d8c1 into the main fixes branch
vsabavat Oct 8, 2026
70bb2a3
Merge #19828 (P2) at 0102a35eea into the main fixes branch
vsabavat Oct 8, 2026
0778b55
Merge #19836 (P3) at 93c0b28bbd into the main fixes branch
vsabavat Oct 8, 2026
adce84a
Merge #19829 (P4) at f39f875fa8 into the main fixes branch
vsabavat Oct 8, 2026
cb4a371
Merge #19826 (P5) at b2a6af4680 into the main fixes branch
vsabavat Oct 8, 2026
2cc72d5
Merge #19827 (P7) at b12bfad22c into the main fixes branch
vsabavat Oct 8, 2026
21462e1
Merge #19840 (P8) at adb66182fa into the main fixes branch
vsabavat Oct 8, 2026
ddff9e8
Merge #19835 (P9) at 5e238440d7 into the main fixes branch
vsabavat Oct 8, 2026
ca4918f
Merge #19837 (P10) at 936f38fbe7 into the main fixes branch
vsabavat Oct 8, 2026
67a3ad5
Merge #19842 (P11) at b83f960a1d into the main fixes branch
vsabavat Oct 8, 2026
989766a
Merge #19846 (P12a) at f9d32b4c4d into the main fixes branch
vsabavat Oct 8, 2026
347d22f
Merge #19854 (P13) at 50ac9d64e4 into the main fixes branch
vsabavat Oct 8, 2026
dc76338
Merge #19816 (U1) at 44a06db574 into the runtime branch
vsabavat Oct 8, 2026
8002879
Merge #19814 (U3) at 2e598e10cb into the runtime branch
vsabavat Oct 8, 2026
a0712cb
Merge #19846 (P12) at 003f8d088d into the runtime branch: its two com…
vsabavat Oct 8, 2026
fa41a16
Merge #19817 (U2) at de2f7e12ef into the runtime branch
vsabavat Oct 8, 2026
bbd3d04
Merge #19833 (G2) at b28044256d into the specialized kernels branch
vsabavat Oct 8, 2026
d67d88e
Merge #19832 (G3) at fd476e7662 into the specialized kernels branch
vsabavat Oct 8, 2026
b803497
Merge #19834 (G5) at c954d6ad6f into the specialized kernels branch
vsabavat Oct 8, 2026
d586d7e
Merge #19839 (U5) at 8e852d2da2 into the Kimi K3 model branch
vsabavat Oct 8, 2026
864a430
Merge #19841 (k3rest) at 3f54e9d96d into the Kimi K3 model branch
vsabavat Oct 8, 2026
84dfe86
Merge k3-cons/b-runtime (format fix) into k3-cons/c-kernels
vsabavat Oct 8, 2026
0d83ef5
Runtime branch: the blank line ruff-format wants between two merged t…
vsabavat Oct 8, 2026
9ba3b3d
Merge k3-cons/c-kernels (format fix) into k3-cons/d-model
vsabavat Oct 8, 2026
e4b9968
modeling_v2 catalog: count G5's sm_100 receipts in the receipt status
vsabavat Oct 8, 2026
e69dacd
Merge k3-cons/c-kernels (receipt count) into k3-cons/d-model
vsabavat Oct 8, 2026
35433fb
[None][fix] thop_attention catalog test: do not probe a context lengt…
vsabavat Oct 8, 2026
eedff8c
Merge k3-cons/a-main-fixes (thop_attention test fix) into k3-cons/b-r…
vsabavat Oct 8, 2026
c9d0cd4
Merge k3-cons/b-runtime (thop_attention test fix) into k3-cons/c-kernels
vsabavat Oct 8, 2026
0bbf728
Merge k3-cons/c-kernels (thop_attention test fix) into k3-cons/d-model
vsabavat Oct 8, 2026
bcef591
Merge main f891b3d9ba into k3-cons/a-main-fixes
vsabavat Oct 8, 2026
338f9d0
Merge k3-cons/a-main-fixes (main f891b3d9ba) into k3-cons/b-runtime
vsabavat Oct 8, 2026
73a9e90
Merge k3-cons/b-runtime (main f891b3d9ba) into k3-cons/c-kernels
vsabavat Oct 8, 2026
65ddf59
Merge k3-cons/c-kernels (main f891b3d9ba) into k3-cons/d-model
vsabavat Oct 8, 2026
c53ffc8
Merge main 3beeef3a5f into k3-cons/b-runtime
vsabavat Oct 8, 2026
3ac75a7
Merge k3-cons/b-runtime (main 3beeef3a5f) into k3-cons/c-kernels
vsabavat Oct 8, 2026
28cfb12
Merge k3-cons/c-kernels (main 3beeef3a5f) into k3-cons/d-model
vsabavat Oct 8, 2026
bdadd40
[None][test] List the MNNVL capture-guard test in l0_dgx_b200.yml
vsabavat Oct 9, 2026
305118f
Merge k3-cons/a-main-fixes (l0_dgx_b200 move) into k3-cons/b-runtime
vsabavat Oct 9, 2026
b395762
Merge k3-cons/b-runtime (l0_dgx_b200 move) into k3-cons/c-kernels
vsabavat Oct 9, 2026
9e19e8a
Merge k3-cons/c-kernels (l0_dgx_b200 move) into k3-cons/d-model
vsabavat Oct 9, 2026
cd21be6
[None][fix] Enable the spec step-copy kernels on SM 100 only
vsabavat Oct 9, 2026
54ff61f
[None][fix] Make the attn_res decode kernels' early PDL trigger opt-in
vsabavat Oct 9, 2026
97f7072
[None][fix] Reject linear_beta=0.0 in trtllm::k3_situ_mul
vsabavat Oct 9, 2026
4aa7153
Merge k3-cons/c-kernels (attn_res early_trigger opt-in, k3_situ_mul l…
vsabavat Oct 9, 2026
b16c3c2
[None][fix] Opt the Kimi K3 targets' fused attn_res calls into the ea…
vsabavat Oct 9, 2026
55f0635
Merge k3-cons/b-runtime (SM 100 step-copy fix) into k3-cons/c-kernels
vsabavat Oct 9, 2026
4c1439a
Merge k3-cons/c-kernels (SM 100 step-copy fix) into k3-cons/d-model
vsabavat Oct 9, 2026
c14508c
[None][chore] Move k3_mla_decode_view into the Kimi K3 MLA kernel pac…
vsabavat Oct 9, 2026
f5c3ae3
Merge k3-cons/c-kernels (k3_mla_decode_view in cute_dsl_kernels/k3_ml…
vsabavat Oct 9, 2026
1bc8d8b
[None][chore] Keep main's route + quant op in the TRTLLM-Gen W4A8 MXF…
vsabavat Oct 9, 2026
b330f1c
[None][refactor] Move the Kimi K3 MNNVL ops out of the stock MNNVL al…
vsabavat Oct 9, 2026
06d34b7
[None][refactor] Kimi K3 targets own their DFlash / DSpark worker and…
vsabavat Oct 9, 2026
3a990dc
Merge main 24d0f2716f into k3-cons/b-runtime
vsabavat Oct 9, 2026
4612146
Merge k3-cons/b-runtime (main 24d0f2716f) into k3-cons/c-kernels
vsabavat Oct 9, 2026
9190f8b
Merge k3-cons/b-runtime (main 24d0f2716f) into k3-cons/c-kernels
vsabavat Oct 9, 2026
deb3d65
Merge k3-cons/c-kernels (main 24d0f2716f) into k3-cons/d-model
vsabavat Oct 9, 2026
4552c8d
[None][feat] DSpark: load speculators-format drafter checkpoints
vsabavat Oct 6, 2026
c6cd921
Merge main (01a3a967a9) into k3-cons/a-main-fixes
vsabavat Oct 9, 2026
c44c900
Merge k3-cons/a-main-fixes (speculators DSpark loader, main 01a3a967a…
vsabavat Oct 9, 2026
edc6351
Merge k3-cons/b-runtime (new A c6cd921256) into k3-cons/c-kernels
vsabavat Oct 9, 2026
2a91b19
Merge k3-cons/c-kernels (new A c6cd921256) into k3-cons/d-model
vsabavat Oct 9, 2026
0fd5a3a
[None][fix] Ragged spec sampler tests: give the stub sampler B's stor…
vsabavat Oct 9, 2026
4c8533c
[None][test] Kimi K3 MNNVL comm test: reach the ops through _trtllm()…
vsabavat Oct 9, 2026
6157fb8
Merge k3-cons/b-runtime (ragged sampler test fix) into k3-cons/c-kernels
vsabavat Oct 9, 2026
657aa25
Merge k3-cons/c-kernels (ragged sampler test fix) into k3-cons/d-model
vsabavat Oct 9, 2026
d639ec5
Merge main fcc4432bef into k3-cons/b-runtime
vsabavat Oct 10, 2026
bca86ba
Merge k3-cons/b-runtime (main fcc4432bef) into k3-cons/c-kernels
vsabavat Oct 10, 2026
47a20a2
Merge k3-cons/c-kernels (main fcc4432bef) into k3-cons/d-model
vsabavat Oct 10, 2026
145def6
Merge main 16df7eaf25 into k3-cons/a-main-fixes
vsabavat Oct 11, 2026
0ed2dfd
Merge k3-cons/a-main-fixes (main 16df7eaf25) into k3-cons/b-runtime
vsabavat Oct 11, 2026
23a02c1
Merge k3-cons/b-runtime (main 16df7eaf25) into k3-cons/c-kernels
vsabavat Oct 11, 2026
b648542
Merge k3-cons/c-kernels (main 16df7eaf25) into k3-cons/d-model
vsabavat Oct 11, 2026
42ff681
[None][refactor] Kimi K3 route targets: one decode/generic dispatch p…
vsabavat Oct 12, 2026
6d9951a
[None][test] Kimi K3 path test: compare against each target's own Dec…
vsabavat Oct 12, 2026
6a95a9e
[None][fix] KV cache manager V2: do not commit an unseeded disagg gen…
vsabavat Oct 12, 2026
6b07622
Merge k3-cons/a-main-fixes (unseeded disagg KDA replay suspend fix) i…
vsabavat Oct 12, 2026
ee481ee
Merge k3-cons/b-runtime (unseeded disagg KDA replay suspend fix) into…
vsabavat Oct 12, 2026
856a455
Merge k3-cons/c-kernels (unseeded disagg KDA replay suspend fix) into…
vsabavat Oct 12, 2026
6514585
Merge k3-cons/d-model (unseeded disagg KDA replay suspend fix) into t…
vsabavat Oct 12, 2026
63aa7a2
[None][chore] KV cache manager V2: separate KDA draft-record accounti…
vsabavat Oct 12, 2026
83becf9
Merge k3-cons/b-runtime (KDA draft-record accounting review follow-up…
vsabavat Oct 12, 2026
b646dca
Merge k3-cons/c-kernels (KDA draft-record accounting review follow-up…
vsabavat Oct 12, 2026
b984e33
Merge main d7882af43f into k3-cons/d-model
vsabavat Oct 12, 2026
a486e00
Merge main fced9ff984 into k3-cons/a-main-fixes
vsabavat Oct 13, 2026
52a3283
Merge k3-cons/a-main-fixes latest-main compatibility into k3-cons/b-r…
vsabavat Oct 13, 2026
520ae9c
Merge branch 'mr11/b' into mr11/c
vsabavat Oct 13, 2026
379cdf6
Preserve K3 numeric contracts through model-owned operation migration
vsabavat Oct 13, 2026
9024a43
Merge latest-main kernel migration into k3-cons/d-model
vsabavat Oct 13, 2026
1695372
Propagate preserved K3 numeric contracts into k3-cons/d-model
vsabavat Oct 13, 2026
2ede9d6
Preserve phase-target presence coverage for phase-dispatched models
vsabavat Oct 13, 2026
cdbba03
test: isolate MNNVL workspace lifecycle from CUDA capture state
vsabavat Oct 13, 2026
0202519
test: align hybrid fixtures and CUDA requirements with main
vsabavat Oct 13, 2026
40df45e
Merge commit 'cdbba03f749f6012d8288d71c915c7af7f863ea6' into mr11/b
vsabavat Oct 13, 2026
be9f0e4
Merge commit '40df45e324fdeb290aa058d4a0af4e571d729bb5' into mr11/c
vsabavat Oct 13, 2026
8bdeec3
Merge commit 'be9f0e4a1008d35641f7e176309a460099b76e1c' into mr11/d
vsabavat Oct 13, 2026
72bb8ca
test: remove obsolete MNNVL workspace dictionary assertion
vsabavat Oct 13, 2026
951048b
Merge commit '72bb8ca0b8ad4f5086f6fe4e1162afc6de533f61' into mr11/b
vsabavat Oct 13, 2026
1cf3ae6
Merge commit '951048b17591f880cf89bd63161cf70dd0ec4921' into mr11/c
vsabavat Oct 13, 2026
ae7c7a9
Merge commit '1cf3ae64e76cc753212b3f34494a0310aedd2af1' into mr11/d
vsabavat Oct 13, 2026
a1fb5ba
Merge upstream after A #19988 while preserving B runtime records
vsabavat Oct 14, 2026
44c31f6
Merge repaired B predecessor after A #19988
vsabavat Oct 14, 2026
78b3e1d
Merge repaired C predecessor after A #19988
vsabavat Oct 14, 2026
9afa851
Merge current upstream main for K3 B CI
vsabavat Oct 14, 2026
fd2bb56
Merge updated predecessor for K3 C CI
vsabavat Oct 14, 2026
991a6e3
Merge updated predecessor for K3 D CI
vsabavat Oct 14, 2026
1f94ed5
Own cached host-to-device copies and share metadata buffer snapshots
vsabavat Oct 14, 2026
15d5054
Merge reviewed B buffer ownership into C kernel stack
vsabavat Oct 14, 2026
b279e48
Admit K3 MLA spin barriers using the actual stream SM resources
vsabavat Oct 14, 2026
d29c672
Merge reviewed B ownership and C stream-admission fixes into D
vsabavat Oct 14, 2026
597e23a
Reject malformed DSpark auxiliary layer IDs before translation
vsabavat Oct 14, 2026
3a51287
Merge strict B DSpark config validation into C
vsabavat Oct 14, 2026
daa25a2
Merge B DSpark config validation through the C stack into D
vsabavat Oct 14, 2026
f1d74e3
Merge main Qwen catalog additions into K3 kernels
vsabavat Oct 15, 2026
f1e009f
Merge repaired K3 kernels and main routing into K3 target
vsabavat Oct 15, 2026
3261a6f
Address speculative runtime review nits
vsabavat Oct 15, 2026
97d8936
Merge speculative runtime review nits into K3 kernels
vsabavat Oct 15, 2026
46cbb85
Merge inherited runtime review nits into K3 model
vsabavat Oct 15, 2026
1f8cdd7
Merge main to retain K3 and MiniMax CPU test coverage
vsabavat Oct 16, 2026
6b3d878
[None][fix] Align Kimi cache test fixture with upstream mapping fields
vsabavat Oct 16, 2026
28d1e2a
[None][chore] Merge current main after the Kimi fixture correction
vsabavat Oct 16, 2026
6b38abc
[None][chore] Propagate the Kimi fixture correction through the K3 stack
vsabavat Oct 16, 2026
ae04264
[None][chore] Propagate the Kimi fixture correction through the K3 stack
vsabavat Oct 16, 2026
413ee68
[None][chore] Merge current main dac84b01a6 into the K3 runtime branch
vsabavat Oct 16, 2026
3e46156
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 16, 2026
425d8ef
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 16, 2026
14a76b0
[None][fix] Refresh serving configuration schemas (By Agent)
VALLIS-NERIA Oct 16, 2026
cb9aa92
[None][chore] Merge current main c226e2d77c into the K3 runtime branch
vsabavat Oct 16, 2026
97811d8
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 16, 2026
7b203f8
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 16, 2026
7bc9de8
[None][chore] Merge latest main into K3 runtime branch (By Agent)
VALLIS-NERIA Oct 19, 2026
27a60ad
[None][test] Fix KDA admission fixture indices (By Agent)
VALLIS-NERIA Oct 19, 2026
cd4d74c
[None][chore] Merge decoder refactor from main (By Agent)
VALLIS-NERIA Oct 19, 2026
7487caf
[None][test] Initialize decoder input preparer fixture config (By Agent)
VALLIS-NERIA Oct 19, 2026
9595d2f
[None][chore] Propagate the latest K3 runtime branch into the K3 kern…
vsabavat Oct 20, 2026
be8488e
[None][chore] Merge current main d6bb0609df into the K3 kernels branch
vsabavat Oct 20, 2026
3b073dc
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 20, 2026
423c804
[None][chore] Merge current main 66ff20f205 into the K3 kernels branch
vsabavat Oct 20, 2026
c5b7617
[None][chore] Propagate the current-main merge through the K3 stack
vsabavat Oct 20, 2026
b42b37f
[None][fix] Accept the KV-cache algorithm in the Kimi K3 modeling_v2 …
vsabavat Oct 20, 2026
18ea5cb
[None][test] Route the Kimi K3 off-architecture case as sm 10.3 expli…
vsabavat Oct 20, 2026
0f9ee92
[None][chore] Merge main kernel directory reorganization (By Agent)
VALLIS-NERIA Oct 20, 2026
45aabf9
[None][chore] Merge the K3 runtime branch with the kernel directory s…
vsabavat Oct 20, 2026
b19dcdb
[None][chore] Propagate the kernel directory split through the K3 stack
vsabavat Oct 20, 2026
ea00015
[None][chore] Apply ruff to the relocated Kimi K3 kernel imports
vsabavat Oct 20, 2026
407b4da
[None][chore] Propagate the ruff fixes for the relocated K3 kernel im…
vsabavat Oct 20, 2026
6f7c142
[None][chore] Apply ruff to the relocated Kimi K3 kernel imports
vsabavat Oct 20, 2026
8144424
[None][test] Load the K3 spec-accept timing baseline from either kern…
vsabavat Oct 20, 2026
c7b667d
[None][test] Account for generation KV cache events (By Agent)
VALLIS-NERIA Oct 20, 2026
996bb14
[None][chore] Merge main KV cache retention updates (By Agent)
VALLIS-NERIA Oct 20, 2026
653a47a
[None][chore] Merge the K3 runtime branch with the KV cache retention…
vsabavat Oct 20, 2026
d67d9cd
[None][chore] Propagate the KV cache retention update through the K3 …
vsabavat Oct 20, 2026
c60ee69
[None][feat] Express the Kimi K3 catalog entries as #19977 OpWrapper …
vsabavat Oct 21, 2026
4c9d1ce
[None][chore] Propagate the K3 catalog OpWrapper conversion through t…
vsabavat Oct 21, 2026
61e4b0c
[None][feat] Express the Kimi K3 DSpark, MoE and MNNVL catalog entrie…
vsabavat Oct 21, 2026
a43e651
[None][chore] Merge main kernel test relocations (By Agent)
VALLIS-NERIA Oct 22, 2026
f5d9d73
[None][chore] Merge the K3 runtime branch with the kernel test reloca…
vsabavat Oct 22, 2026
4dc6f91
[None][chore] Propagate the kernel test relocations through the K3 stack
vsabavat Oct 22, 2026
8c2cefa
[None][chore] Merge main speculative decoding cleanup (By Agent)
VALLIS-NERIA Oct 22, 2026
a688df8
[None][chore] Merge the K3 runtime branch with main 53edc7d4b1 into t…
vsabavat Oct 22, 2026
a44934d
[None][chore] Propagate main 53edc7d4b1 through the K3 stack
vsabavat Oct 22, 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
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ struct MnnvlAllReduceKernelParams
uint32_t* bufferFlags;
bool waitForResults;
QuantizationSFLayout layout;
bool earlyTrigger;

@WeiHaocheng WeiHaocheng Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the new kernels, please move them to the kimi directory under modeling_v2 (you can add a csrc/ folder for the C++/CUDA sources). Shared kernels for TP16/TP4 belong in models/kimi_k3_vl, while target-specific kernels should reside in their respective target folders. In short, new ops should be scoped to the level where they take effect rather than dumped into generic modules.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The K3 C++ kernels are already isolated under cpp/tensorrt_llm/kernels/kimiK3Mnnvl/; the remaining shared earlyTrigger option is default-off. Moving the sources under models/kimi_k3_vl/csrc/ would also need explicit build wiring, since the current kernel build discovers them under cpp/.

Do you want that model-local C++/CUDA build-layout change as well, or is keeping the K3-specific compiled kernels in cpp/ acceptable while moving the Python ops and CuTe DSL kernels into the K3 family/target directories under modeling_v2?

};

template <typename PackedType, typename T>
Expand Down Expand Up @@ -590,6 +591,10 @@ __global__ void __launch_bounds__(1024) oneshotAllreduceFusionKernel(MnnvlAllRed
int threadOffset = token * params.tokenDim + packedIdx * kELTS_PER_THREAD;

cudaGridDependencySynchronize();
if (params.earlyTrigger)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the changes to these communication kernels only add a single parameter, they could potentially impact all existing models that rely on them. My recommendation is not to make incremental changes to this shared kernel in this PR, but instead copy it over to kimi_k3_vl's own directory to modify it there.
@litaotju , what do you think? This seems like a pretty representative case.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the principle in general.

For this specific case, I think the existing allreduce kernel shall already supported the PDL, I am not sure why do we need this new parameter? Can existing PDL infra support this? @vsabavat

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

{
cudaTriggerProgrammaticLaunchCompletion();
}
#else
int packedIdx = blockIdx.y * blockDim.x + threadIdx.x;
int token = blockIdx.x;
Expand Down Expand Up @@ -843,7 +848,7 @@ void oneshotAllreduceFusionOp(AllReduceFusionParams const& params)
MnnvlAllReduceKernelParams<T> kernelParams{output, residualOut, input, residualIn, gamma, ucPtrs,
reinterpret_cast<T*>(params.bufferPtrLocal), mcPtr, params.quantOut, params.scaleOut, params.scaleFactor,
numTokens, tokenDim, params.nRanks, params.rank, static_cast<float>(params.epsilon), params.bufferFlags,
false, params.layout};
false, params.layout, params.earlyTrigger};

switch (params.nRanks)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct AllReduceFusionParams
void* scaleOut = nullptr; //!< NVFP4 scale-factor output (used by NVFP4 fusion patterns)
float const* scaleFactor = nullptr; //!< Quantization scale factor
QuantizationSFLayout layout = QuantizationSFLayout::SWIZZLED; //!< NVFP4 scale-factor layout
bool earlyTrigger = false;
cudaStream_t stream; //!< CUDA stream for asynchronous kernel execution

//! @}
Expand Down
58 changes: 44 additions & 14 deletions cpp/tensorrt_llm/kernels/kimiK3AttnRes/attnResFwd.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1046,12 +1046,18 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16
bf16_t const* __restrict__ layer_res, bf16_t const* __restrict__ layer_res_add, bf16_t const* __restrict__ res_w,
bf16_t const* __restrict__ rms_w, bf16_t const* __restrict__ output_rms_w, bf16_t* __restrict__ updated_layer_res,
bf16_t* __restrict__ output, float* __restrict__ rsigma_out, float* __restrict__ probs_out,
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens)
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens, bool early_trigger)
{
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 1000
if constexpr (ENABLE_PDL)
{
cudaGridDependencySynchronize();
// The dependent grid still waits for this one to complete before reading its
// output; triggering here lets it launch and stream its weights while this kernel runs.
if (early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}

constexpr int H = 7168;
Expand Down Expand Up @@ -1321,7 +1327,10 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16

if constexpr (ENABLE_PDL)
{
cudaTriggerProgrammaticLaunchCompletion();
if (!early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
#else
if (cute::thread0())
Expand All @@ -1331,11 +1340,17 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_single_cta_kernel(bf16
#endif
}

// Decode handoff options for the s1 kernels (see AttnResFwdParams).
struct S1Handoff
{
bool early_trigger = false;
};

template <int N, bool FUSE_OUTPUT_RMS_NORM = false, bool FUSE_LAYER_ADD = false>
static void launch_s1_single_cta(bf16_t const* block_residual, bf16_t const* layer_residual,
bf16_t const* layer_residual_add, bf16_t const* res_weight, bf16_t const* rms_weight,
bf16_t const* output_rms_weight, bf16_t* updated_layer_residual, bf16_t* output, float* rsigma, float* probs,
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream)
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream, S1Handoff handoff = {})
{
if (tensorrt_llm::common::getEnvEnablePDL())
{
Expand All @@ -1351,14 +1366,14 @@ static void launch_s1_single_cta(bf16_t const* block_residual, bf16_t const* lay
config.numAttrs = 1;
cudaLaunchKernelEx(&config, kernel, block_residual, layer_residual, layer_residual_add, res_weight, rms_weight,
output_rms_weight, updated_layer_residual, output, rsigma, probs, logits, rms_eps, output_rms_eps,
num_tokens);
num_tokens, handoff.early_trigger);
}
else
{
attn_res_fwd_s1_single_cta_kernel<N, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, false>
<<<num_tokens, 256, 0, stream>>>(block_residual, layer_residual, layer_residual_add, res_weight, rms_weight,
output_rms_weight, updated_layer_residual, output, rsigma, probs, logits, rms_eps, output_rms_eps,
num_tokens);
num_tokens, false);
}
}

Expand All @@ -1380,13 +1395,22 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c
bf16_t const* __restrict__ layer_res, bf16_t const* __restrict__ layer_res_add, bf16_t const* __restrict__ res_w,
bf16_t const* __restrict__ rms_w, bf16_t const* __restrict__ output_rms_w, bf16_t* __restrict__ updated_layer_res,
bf16_t* __restrict__ output, float* __restrict__ rsigma_out, float* __restrict__ probs_out,
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens)
float* __restrict__ logits_out, float rms_eps, float output_rms_eps, int num_tokens, bool early_trigger)
{
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 1000
if constexpr (ENABLE_PDL)
auto const wait_for_previous_grid = [&]
{
cudaGridDependencySynchronize();
}
if constexpr (ENABLE_PDL)
{
cudaGridDependencySynchronize();
// See attn_res_fwd_s1_single_cta_kernel.
if (early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
};
wait_for_previous_grid();

namespace cg = cooperative_groups;
constexpr int H = 7168;
Expand Down Expand Up @@ -1439,6 +1463,7 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c

float sq[N] = {};
float dot[N] = {};
// Every candidate in one pass, so all loads are in flight together.
#pragma unroll
for (int ki = tid; ki < K_PER_CTA; ki += THREADS)
{
Expand Down Expand Up @@ -1638,7 +1663,10 @@ __global__ void __launch_bounds__(256, 1) attn_res_fwd_s1_splitk_kernel(bf16_t c

if constexpr (ENABLE_PDL)
{
cudaTriggerProgrammaticLaunchCompletion();
if (!early_trigger)
{
cudaTriggerProgrammaticLaunchCompletion();
}
}
#else
if (cute::thread0())
Expand All @@ -1652,13 +1680,14 @@ template <int N, int GROUPS = 8, bool FUSE_OUTPUT_RMS_NORM = false, bool FUSE_LA
static void launch_s1_splitk(bf16_t const* block_residual, bf16_t const* layer_residual,
bf16_t const* layer_residual_add, bf16_t const* res_weight, bf16_t const* rms_weight,
bf16_t const* output_rms_weight, bf16_t* updated_layer_residual, bf16_t* output, float* rsigma, float* probs,
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream)
float* logits, float rms_eps, float output_rms_eps, int num_tokens, cudaStream_t stream, S1Handoff handoff = {})
{
constexpr int K_PER_CTA = 7168 / GROUPS;
constexpr int WARPS = 8;
constexpr size_t smem_size
= (size_t) N * K_PER_CTA * sizeof(float) + (size_t) WARPS * N * sizeof(float2) + (size_t) N * sizeof(float);
bool const enable_pdl = tensorrt_llm::common::getEnvEnablePDL();
bool early_trigger = enable_pdl && handoff.early_trigger;
auto kernel = enable_pdl ? &attn_res_fwd_s1_splitk_kernel<N, GROUPS, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, true>
: &attn_res_fwd_s1_splitk_kernel<N, GROUPS, FUSE_OUTPUT_RMS_NORM, FUSE_LAYER_ADD, false>;
static std::once_flag attrs_set[2][64];
Expand All @@ -1678,7 +1707,7 @@ static void launch_s1_splitk(bf16_t const* block_residual, bf16_t const* layer_r
void* args[] = {const_cast<bf16_t**>(&block_residual), const_cast<bf16_t**>(&layer_residual),
const_cast<bf16_t**>(&layer_residual_add), const_cast<bf16_t**>(&res_weight), const_cast<bf16_t**>(&rms_weight),
const_cast<bf16_t**>(&output_rms_weight), &updated_layer_residual, &output, &rsigma, &probs, &logits, &rms_eps,
&output_rms_eps, &num_tokens};
&output_rms_eps, &num_tokens, &early_trigger};
cudaLaunchConfig_t config{};
// One cluster per token. clusterDim stays GROUPS, so clusters are contiguous
// spans of the grid and each token's DSM exchange stays within its own.
Expand Down Expand Up @@ -1887,18 +1916,19 @@ static void launchAttnResDecodeRmsNorm(AttnResFwdParams const& params, cudaStrea

auto const* layer_residual_add = FUSE_LAYER_ADD ? params.layerResidualAdd : nullptr;
auto* updated_layer_residual = FUSE_LAYER_ADD ? params.updatedLayerResidual : nullptr;
S1Handoff const handoff{params.earlyTrigger};

if constexpr (N <= 4)
{
launch_s1_single_cta<N, true, FUSE_LAYER_ADD>(params.blockResidual, params.layerResidual, layer_residual_add,
params.resWeight, params.rmsWeight, params.outputRmsWeight, updated_layer_residual, params.output, nullptr,
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream);
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream, handoff);
}
else
{
launch_s1_splitk<N, 8, true, FUSE_LAYER_ADD>(params.blockResidual, params.layerResidual, layer_residual_add,
params.resWeight, params.rmsWeight, params.outputRmsWeight, updated_layer_residual, params.output, nullptr,
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream);
nullptr, nullptr, params.rmsEps, params.outputRmsEps, params.seqLen, stream, handoff);
}
}

Expand Down
1 change: 1 addition & 0 deletions cpp/tensorrt_llm/kernels/kimiK3AttnRes/attnResFwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct AttnResFwdParams
int hiddenSize; // H
float rmsEps;
float outputRmsEps;
bool earlyTrigger = false;
};

//! Launches the fused attention-residual forward on the supplied stream.
Expand Down
165 changes: 165 additions & 0 deletions cpp/tensorrt_llm/kernels/kimiK3Mnnvl/mnnvlAllGatherKernels.cu
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/*
* Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "tensorrt_llm/kernels/kimiK3Mnnvl/mnnvlAllGatherKernels.h"

#include "tensorrt_llm/common/cudaUtils.h"
#include "tensorrt_llm/common/envUtils.h"
#include "tensorrt_llm/common/lamportUtils.cuh"

TRTLLM_NAMESPACE_BEGIN

namespace kernels::kimiK3Mnnvl
{

using tensorrt_llm::common::isLamportDirty;
using tensorrt_llm::common::LamportFlags;
using tensorrt_llm::common::loadPackedVolatile;
using tensorrt_llm::common::VolatilePackedLoad;

namespace
{

constexpr int kThreads = 256;

// Payload vectors (16 bytes) of one rank's slot for one token: the bf16 part, then the fp32 part.
__host__ __device__ inline int slotVectors(int bf16Columns, int fp32Columns)
{
return bf16Columns / 8 + fp32Columns / 4;
}

// No payload word may equal the Lamport sentinel (the fp32 -0.0 word): -0.0 halves of a bf16
// pair and -0.0 fp32 words become +0.0.
__device__ inline uint32_t sanitizeBf16Pair(uint32_t word)
{
if ((word & 0xffffu) == 0x8000u)
{
word &= 0xffff0000u;
}
if ((word >> 16) == 0x8000u)
{
word &= 0x0000ffffu;
}
return word;
}

__device__ inline uint32_t sanitizeFp32(uint32_t word)
{
return word == 0x80000000u ? 0u : word;
}

__device__ inline uint32_t packBf16Pair(float lo, float hi)
{
__nv_bfloat162 const pair = __floats2bfloat162_rn(lo, hi);
return sanitizeBf16Pair(*reinterpret_cast<uint32_t const*>(&pair));
}

// One CTA per token: broadcast this rank's slot of the token, then poll every rank's slot and
// scatter it to the outputs.
__global__ void __launch_bounds__(kThreads) mnnvlAllGatherSplitKernel(AllGatherSplitParams const p)
{
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900)
cudaGridDependencySynchronize();
// Dependents read the outputs (and the Lamport flags) only after their own wait for this grid.
cudaTriggerProgrammaticLaunchCompletion();
#endif
int const token = blockIdx.x;
int const bf16Vectors = p.bf16Columns / 8;
int const vectors = slotVectors(p.bf16Columns, p.fp32Columns);
int const inputColumns = p.bf16Columns + p.fp32Columns;

LamportFlags<float4> flag(p.bufferFlags, 1);
auto* lamportMcast = reinterpret_cast<uint4*>(flag.getCurLamportBuf(p.multicastPtr, 0));
auto* lamportLocal = reinterpret_cast<uint4*>(flag.getCurLamportBuf(p.bufferPtrsDev[p.rank], 0));

float const* row = p.input + static_cast<int64_t>(token) * inputColumns;
for (int v = threadIdx.x; v < vectors; v += blockDim.x)
{
uint4 packed;
if (v < bf16Vectors)
{
float4 const a = reinterpret_cast<float4 const*>(row)[2 * v];
float4 const b = reinterpret_cast<float4 const*>(row)[2 * v + 1];
packed = make_uint4(
packBf16Pair(a.x, a.y), packBf16Pair(a.z, a.w), packBf16Pair(b.x, b.y), packBf16Pair(b.z, b.w));
}
else
{
uint4 const words = reinterpret_cast<uint4 const*>(row + p.bf16Columns)[v - bf16Vectors];
packed = make_uint4(
sanitizeFp32(words.x), sanitizeFp32(words.y), sanitizeFp32(words.z), sanitizeFp32(words.w));
}
lamportMcast[(static_cast<int64_t>(token) * p.nRanks + p.rank) * vectors + v] = packed;
}

flag.ctaArrive();
flag.clearDirtyLamportBuf(p.bufferPtrsDev[p.rank], -1);

for (int i = threadIdx.x; i < p.nRanks * vectors; i += blockDim.x)
{
int const r = i / vectors;
int const v = i % vectors;
VolatilePackedLoad<float4> value;
do
{
value
= loadPackedVolatile<float4>(&lamportLocal[(static_cast<int64_t>(token) * p.nRanks + r) * vectors + v]);
} while (isLamportDirty(value));
uint4 const words = make_uint4(value.words[0], value.words[1], value.words[2], value.words[3]);
if (v < bf16Vectors)
{
reinterpret_cast<uint4*>(
p.bf16Output + static_cast<int64_t>(token) * p.nRanks * p.bf16Columns + r * p.bf16Columns)[v]
= words;
}
else
{
reinterpret_cast<uint4*>(p.fp32Output + static_cast<int64_t>(token) * p.nRanks * p.fp32Columns
+ r * p.fp32Columns)[v - bf16Vectors]
= words;
}
}

flag.waitAndUpdate({static_cast<uint32_t>(p.numTokens * p.nRanks * vectors * sizeof(uint4)), 0, 0, 0});
}

} // namespace

int64_t mnnvlAllGatherSplitFootprint(int numTokens, int bf16Columns, int fp32Columns, int nRanks)
{
return static_cast<int64_t>(numTokens) * nRanks * slotVectors(bf16Columns, fp32Columns) * sizeof(uint4);
}

void mnnvlAllGatherSplitOp(AllGatherSplitParams const& params)
{
TLLM_CHECK_WITH_INFO(params.bf16Columns % 8 == 0 && params.fp32Columns % 4 == 0,
"[mnnvlAllGatherSplit] needs bf16 columns in multiples of 8 and fp32 columns in multiples of 4");
TLLM_CHECK_WITH_INFO(params.numTokens > 0, "[mnnvlAllGatherSplit] needs at least one token");
cudaLaunchAttribute attrs[1];
attrs[0].id = cudaLaunchAttributeProgrammaticStreamSerialization;
attrs[0].val.programmaticStreamSerializationAllowed = tensorrt_llm::common::getEnvEnablePDL() ? 1 : 0;
cudaLaunchConfig_t config{};
config.gridDim = dim3(params.numTokens);
config.blockDim = dim3(kThreads);
config.stream = params.stream;
config.attrs = attrs;
config.numAttrs = 1;
TLLM_CUDA_CHECK(cudaLaunchKernelEx(&config, mnnvlAllGatherSplitKernel, params));
}

} // namespace kernels::kimiK3Mnnvl

TRTLLM_NAMESPACE_END
Loading