Skip to content

flint metal: a shared round's sampled rows draw in one launch - #4780

Merged
ashhart merged 3 commits into
mainfrom
lead/flint-sampled-batch
Nov 24, 2026
Merged

ashhart merged 3 commits into
mainfrom
lead/flint-sampled-batch

Conversation

@ashhart

@ashhart ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Refs #3396.

Flint drew each sampled row of a shared round with its own serial launch on one GPU core. Consecutive sampled rows that write consecutive token slots now draw in one launch, one threadgroup a row, so they run side by side.

Each threadgroup reads only its own logits row, settings, seed and position, and writes only its own slot, so every token is what that row's own launch would draw. Greedy rows, one-row launches and the lone pipelined step bind the same bytes as main.

Host checks: test-lanes-sampler-launch-host compares the one-row bindings with main's byte for byte and checks grouped rows at 1 to 32 rows, with a planted control that fails. zig fmt, AST and lean are clean.

Not yet proven: this has not run on a Mac with Flint. Token equality and speed on an M5 Max are the open check before landing.

…p a row (#3396)

Flint's encoder is serial, and each drawn row of a shared round was its own one-threadgroup launch,
so a round's sampled rows ran one after another on one GPU core each. The keyed samplers
(tf_gpu_sample and tf_sample_full) already index the logits, settings and token slot by threadgroup,
as Nemotron launches them, so consecutive sampled rows writing consecutive slots now share one launch.
Each threadgroup reads only its own row and writes only its own slot, so every row's token is the one
its launch alone draws. Greedy rows and the lone step are unchanged; a one-row launch binds the same
bytes as before.

gpu_rule.Launch packs the per-row settings. test-lanes-sampler-launch-host checks that a one-row
launch binds byte for byte what Flint's pick bound on main, and that a launch of 1 to 32 rows binds
each row's settings at its own index, zeros past the last row.
@ashhart
ashhart force-pushed the lead/flint-sampled-batch branch from 83f95b2 to 39fc23b Compare November 24, 2026 01:06
@ashhart
ashhart merged commit cfd907f into main Nov 24, 2026
2 of 12 checks passed
@ashhart
ashhart deleted the lead/flint-sampled-batch branch November 24, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant