Repository navigation
gpu: Qwen3.8's step and verify skip the host leg on a layer the host serves nothing, and the hc norm loads a chunk before it uses it - #45
Conversation
|
Thanks — the per-launch numbers and the same-ids check are clear. This one touches kernels (hc_gated) and Qwen3.8's step, so it needs our box's ptx-scan and the A6000 A/B. It comes after the 0.3.0 tag, after #43; I will post the review here. |
|
Review done. The sum order in It does not apply to main any more: Asks:
After the rebase we run the box side: ptx-scan + spill gate, the Qwen3.8 owning gates, and one same-lease A6000 A/B for the skipped legs. |
… chunk of 16 values a thread before it uses them, so a pass's loads go out together; the sum of squares keeps its order and every value its bits Each of the norm's two passes walked its stream one value a thread at a time: a load (of the residual, and of y or gamma), its use, and in the first pass a store back to the residual, then the next value. norm_stream, now the one body of both entries, loads 16 values a thread first and then uses them in the same order, so the sum of squares adds the same terms in the same order and every stored value keeps its bits. gate_hc_gated: 60 PASS, as on main, the wide arm's norm the capped entry's bits; a mutant whose first pass walks each chunk in reverse order fails stages[xn] (max_ulps 3) and stages[head]. tools/unsafe-ratchet.txt pins gpu at 1731 blocks and 193 fns with the count. ptxas 13.3 gives each entry 63 registers at sm_86 and 62 at sm_121 (26 and 28 on main), with no stack frame and 0 bytes of spill stores and loads, and the driver JIT on a GB10 gives it 0 bytes of local memory. ptx-scan changes only these two entries; the two compile to the same PTX as each other, on main and on this branch.
…the load put every routed expert of it on the card and runs no residency machine and no route trace: no go, no wait, no row_enqueued, and zeros for the host's sum Such a layer still enqueued the go and the wait, two stream memory-operation batches, and told the host tier the row was enqueued, though the host serves it nothing. With every routed expert on the card (the whole plan on a DGX Spark) that is 96 batch_mem_op nodes in each captured step. The load now decides it once per layer (Card38::hostless, made in Card38::new): every routed expert of the layer is on the card, and keep_host is false. A residency machine moves card experts to the host after the load, and the host service writes the route trace, so either keeps every host leg: the load reads the machine from its residency glue and the trace from HostCfg::route_trace, which Levers::host sets when BLOOMERY_ROUTE_TRACE is set (the trace is attached after the load). On a load that runs a layer without its service (HostTier::mark_unserved, which Body38's load sets), the host tier refuses by name a route trace attached after the load, saying the load's HostCfg::route_trace was false, and a residency machine started after it (HostTier::start_swap), before any slot moves. BLOOMERY_ROUTE_TRACE's lever doc says that on a qwen4exp load it keeps every layer's host leg. On a hostless layer the handoff writes the row's image and the card's places and stops before the go, the back has no wait and no row_enqueued, and shared_add takes the host's sum as an Option: None reads Card38::zero_sum, a zeroed row a token (PASS_ROWS x HIDDEN f32, 81,920 bytes, counted in Card38::bytes), which is what the host writes for an empty list (out.fill(0.0)), so the sum keeps main's bits; it is allocated only on a load with a hostless layer. The prompt pass is unchanged. walk_launches and Body38::step_launches count the two memops only on a layer with a host leg, so generate_qwen3moe's capture check still holds the graph to the program. gate_qwen4exp_e2e's card clauses expect the memops and the host services of the plan they load (Shape::memops_card, hostless), and a new clause, card leg whole plan, loads the plan with no card budget, holds its step, eager and graph, and its verify to the same plan loaded with every host leg kept, bit for bit, and holds the load to both refusals by name. In the fixture tier that plan puts every routed expert on the card, which the clause requires (no memop, no host service); in the real tier the card's memory decides how many layers are whole, and the clause prints the count without requiring it. A load that fails is a named FAIL. Same output as main e8e32a3 (ids and the last logits row's fnv64), graph and eager: the whole plan (its captured step goes from 1391 nodes, 96 of them batch_mem_op, to 1295 and 0), a plan with 49 experts on the host, every expert on the host, the whole plan under BLOOMERY_RESIDENCY=mid-p500-s1, and the whole plan with a route trace (the same 94 positions over 48 layers, byte for byte); with the MTP draft the ids. bloomery-serve-qwen38 with a route trace on the whole plan writes main's trace byte for byte (101 positions over 48 layers). A build whose Levers::host leaves route_trace unset now stops both of them at the trace's attach with the tier's refusal, where the trace used to seal 0 positions. gate_qwen4exp_e2e's card clauses and the new one, run in the fixture tier from a build whose run() keeps only them (not committed; the whole run also reads the real file's ik sets), pass; mutants (not committed) fail them by name with the zero row swapped for the card's sum (the steps and the verify leave the kept host legs' bits), with every host leg kept (8 batch_mem_op, want 0), with the verify expecting a service on every layer, and with either refusal taken out. Before the residency and trace terms, the residency run stopped at its first decode pass (SwapMachine::end_pass: slots not noted) and the trace sealed with 0 positions. With main's step count, the whole plan's graph run fails the capture check by name. With the hc_gated_norm commit before it, Qwen3.8 decode on a DGX Spark reads 1.0458 ± 0.0065 on the p50 step (main_ms / PR_ms) and 1.0908 ± 0.0289 in tok/s(mean) (PR / main) against main e8e32a3, with an A/A of 0.9996 ± 0.0018 and 0.9996 ± 0.0017 (tools/ref/depth-qwen3moe.sh, six rounds in one lease, n = 160, draft off), the ids equal.
578f6c1 to
0bd19ed
Compare
|
@midagedev Thanks for the review. I rebased the branch onto main
The whole-plan clause also runs in both tiers now. It requires every layer to be whole only in the fixture tier, and a load that fails is a named FAIL instead of an abort. I also updated the PR body: a paragraph on why main's first steps are slow (under "The A/B"), the binary list, and the FAIL-firsts. |
|
Thank you for the rebase and the answers. I will review 0bd19ed after the 0.3.1 tag today. It moves a kernel, so it goes through the box gates and a ptx-scan then. |
|
Thank you for the rebase and for answering all five asks. The sum order, the ptxas table and the refusals read right. You do not need to rebase again. Main will move once more when the 0.3.2 train lands tonight. After that we merge main into this branch ourselves, which resolves the
Then it lands in the next train. I will post the numbers here. |
…ps on a layer the reference hosts nothing on The reference load runs a layer whose routed experts are all on the card without its go and wait (Card38::hostless); the tier load keeps the leg on every tier layer. The expected tier stage nodes are the reference's less one a tier layer plus HOST_LEG_NODES (2) a tier layer the reference's plan hosts nothing on, read per layer from that plan. On the fixture all four tier layers are unhosted (125 - 4 + 8 = 129); on the real file every layer is hosted and the clause reads ref - 48 as before. The clause stays exact. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What and why
Part of #13. On a DGX Spark, all of Qwen3.8-Flash-Next
UD-Q4_K_XLfits on the card, and these two commits make itsdecode step faster there. Over six rounds against main in one lease, the median step is 1.0458 ± 0.0065 times
main's speed (
main_ms / PR_msof the p50 step), and tok/s(mean) reads 1.0908 ± 0.0289 (PR / main). Every armgenerates the same ids. The sitting ran on main
e8e32a38, before the rebase ontob8d1ff06.thread at a time: the loads, their use, and in the first pass a store back to the residual, then the next value.
Now a thread loads 16 values and then uses them in the same order. The sum of squares adds the same terms in the
same order, so every value keeps its bits.
hc_gated_norm_4(the step, the verify and the pass) andhc_gated_norm_4w(the ubatch walk) now share that body,norm_stream, so the wide entry is the capped one'sbody again, as the module doc says.
enqueued the go and the wait (two stream memory-operation batches) and told the host tier that its row was
enqueued. With the whole plan that is 96
batch_mem_opnodes in each captured step. Now the load decides onceper layer whether the step and the verify run it without the host leg (
Card38::hostless). Three things musthold: every routed expert of the layer is on the card, no residency machine runs, and no route trace is recorded.
A residency machine moves card experts to the host after the load (
SwapMachine::layout), and the host serviceis where the route trace is written, so either one keeps every host leg. The trace is attached after the load, so
the load learns of it from a new
HostCfg::route_trace, whichLevers::hostsets whenBLOOMERY_ROUTE_TRACEisset, and the lever's doc says so. On a load that runs a layer without its service (
HostTier::mark_unserved,which the Qwen3.8 load sets), the host tier refuses by name a route trace attached after the load, whose message
says the load's
HostCfg::route_tracewas false, and a residency machine started after it(
HostTier::start_swap), before any slot moves. On such a layer the handoff still writes the row's image and the card's places and stops beforethe go. The back has no wait and no
row_enqueued.shared_addtakes the host's sum as anOption;NonereadsCard38::zero_sum, a zeroed row a token, which is what the host writes for an empty list. The zero row isallocated only when the load has such a layer. The prompt pass is unchanged.
walk_launchesandBody38::step_launchescount the two memops only on a layer with a host leg, sogenerate_qwen3moe's capturecheck still holds the graph to the program, and the captured step goes from 1391 nodes to 1295.
gate_qwen4exp_e2e's card clauses now derive the memops and the verify's host services they expect from the planthey load (
Shape::memops_card,hostless). A new clause, card leg whole plan, loads the plan with no cardbudget and holds its steps (graph and eager) and its verify to the same plan loaded with every host leg kept, bit
for bit, and checks that this load refuses a route trace and a residency machine by name. In the fixture tier
that plan puts every routed expert on the card, which the clause requires, so its load has no memop and no host
service. In the real tier the card's memory decides how many layers are whole, and the clause prints the count
without requiring it; on a card the file does not fit, it compares two loads that both keep every host leg.
The commits are separate because they are separate contracts: the first is a kernel body with no change to its
callers, and the second is the program's shape on one kind of load.
Code shape
hc_gated_norm_4andhc_gated_norm_4whad the same body twice; they now call onenorm_stream. The skip has one owner,Card38::hostless, which the handoff, both backs, the launch counts andthe host tier's two refusals read.
and whether a residency machine or a route trace runs), not on a model or a device.
HostCfg::route_traceisa fact about the host service; only Qwen3.8's body reads it today.
Card38::zero_sumis refused by name on a load with no hostless layer, a route traceor a residency machine on a load that skips a host leg is refused by name at the host tier,
Card38::hostlessandShape::memops_cardassert their ranges, and the capture check fails a step whose graph does not match theprogram's count (the FAIL-firsts are under "What I ran").
tools/unsafe-ratchet.txtgoes fromgpu 1729 192 10togpu 1731 193 10, thecounts
tools/check-unsafe.shreads, with aPIN(2026-10-12):line:norm_streamis the new unsafe fn, itsloads and stores each have a block and a SAFETY line, and the two entries each lose their copy of the body.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line):crates/gpu/src/hc_gated.rs, the bodies ofhc_gated_norm_4andhc_gated_norm_4w(removed, nownorm_stream). DeepSeek-V4.1's FFN (crates/gpu-deepseek41/src/chain/ffn.rs:1494)and GLM-5.3's (
crates/gpu-glm5next/src/ffn.rs:460) enqueue the go on every layer the same way. I left them alonebecause those files need far more than a DGX Spark's 128 GB. I have no plan that puts every routed expert of one of
their layers on the card, so nothing here could test the skip there.
What I ran
The code is
0bd19edc, two commits on mainb8d1ff06. The Mac checks ran on that tree. The GPU runs usedbinaries built from this branch on main
e8e32a38,dd187c1dandb8d1ff06, and the first-step runs under "TheA/B" used earlier builds; "Which binary ran what" at the end gives the trees and hashes.
On a Mac:
Each
mac-staticline is cut after its time. The lint step counts 41 warnings, the ratchet's 41, and combos ran 1shape with 0 red (45 scoped out; its ledger held the others green from earlier runs of this branch).
cargo checkfor
aarch64-unknown-linux-gnu(tools/mac-check.sh checkwithBLOOMERY_CHECK_TARGET) passes too.just affectednames 11 changed files and selects 137 of the 149 gate recipes(the levers crate is among the changed files) and 1 of the 7 weekly recipes (
weekly-gpu-ds41-lost, whichcrates/gpu/src/host/mod.rstriggers).cargo test -p bloomery-levers: 37 passed.ptxas and ptx-scan. On the
generate_qwen3moePTX module of main and of this branch, with the dev container'sptxas 13.3.73, and
tools/ptx-scan.shwith the driver JIT (not--no-jit) on a GB10, the same numbers forhc_gated_norm_4andhc_gated_norm_4w:The two
[f32; 16]arrays stay in registers: the PTX has nold.localorst.local. I did not runjust gate-ptx-spill, which checks the 0/0 pins these two entries carry intools/ref/ptx-shapes.tsv(thegenerate_ds41andgate_e2erows): its JIT column is an RTX 3090's, so that check is in your box run. One8e32a38, a full--no-jitscan of the module lists 229 entries on main and on this branch, and only these twodiffer; on each side the two compile to the same PTX as each other (191 lines on main, 854 here). Their static occupancy goes from 6 blocks an SM to 4. That costs
hc_gated_norm_4nothing: its grid is 4× m blocks with m at most 8, so 32 blocks at most, under one wave on a GB10 (48 SMs), an RTX A6000 (84) or an RTX
3090 (82).
The table is from main
dd187c1dand this branch on it; the rebase ontob8d1ff06changes no kernel.Gates. On a DGX Spark, in the dev container, run directly from the built binaries:
gate_hc_gated: 60 PASS on main and 60 PASS on this branch (on0bd19edctoo), every stage bit for bit, and the wide arm's normthe capped entry's bits. FAIL-first (on
e8e32a38): the same tree with pass 1 walking each chunk in reverseorder (not committed) fails
stages[xn](bit_equal=false max_ulps=3) andstages[head].gate_qwen4exp_e2ein the fixture tier passes its two structure clauses on the host plan (graph_nodes=113, 8 ofthem
batch_mem_op) and then stops, as on main: the fixture tier opens the Qwen3.8 fixture, which this machinehas, but it also reads the token ids of the real file's ik set (
ref_qwen4exp/MANIFEST.tsvunderBLOOMERY_DATA), which this machine does not have. So I ran the card clauses from a build of the gate whoserun()keeps only them (not committed): the card leg's structure and rows on the half-card plan, then the newwhole-plan clause. On
0bd19edcthat build passes 30 checks, 0 FAIL. The half-card plan's verify reads 139 nodeswith 8
batch_mem_opand 4 host services; the whole plan's reads 131 with 0 and 0, against 8 and 4 with everyhost leg kept, and its graph steps, eager steps and verify equal the kept load's bit for bit. The whole-plan load
refuses a route trace and a residency machine by name:
FAIL-firsts, each a mutant of that build (not committed). On
0bd19edc, with the trace's refusal taken out:card leg whole plan: a route trace after the load -> taken FAIL. With the machine's refusal taken out:card leg whole plan: a residency machine after the load -> SwapMachine::new: no layer of the map names expert parts: the source holds no stacks the machine could move FAIL(the clause hands the machine a source with noparts, so it stops there instead of moving experts). On
e8e32a38: the zero row swapped for the card's own sum(4 FAIL: the pass against the steps, and the graph steps, the eager steps and the verify against the kept load);
every host leg kept fails the whole plan's verify structure (
batch_mem_op=8 (want 0)) and services (7 FAIL); theverify expecting a service on every layer fails the whole plan's three verify cases (3 FAIL).
The clause's real-tier path ran on no machine here: the count printed and not required, and on a card the file
does not fit, the line that there is no refusal to check. With no budget, each card plans with its own usable
bytes (
PlanLevers), so that load fits the card.cargo test -p bloomery-gpu-gates --lib q38_fixture(in the container; the crate does not build its tests onmacOS), from the build on
b8d1ff06before this review's fixes (they change only a comment in that file): 2passed, with the new
memops_cardcheck.Of the 137 gate recipes
just affectedselects, I ran only what is above and below. No unit test covers thechanged step count (
body38.rs's one test checks a hash), and the rest need your box.Same output, and the FAIL-firsts.
generate_qwen3moeat main and at this branch, Qwen3.8UD-Q4_K_XL, oneprocess a run,
-n 64, the same prompt,--mode graphand--mode eager,--logits(the fnv64 of the last logitsrow) where the draft is off. In every run below, all 64 ids equal main's, and graph and eager agree.
I ran every case on main
dd187c1dand this branch on it, and on this branch onb8d1ff06before this review's fixes; maine8e32a38read thesame ids and the same fnv64 in each. At
0bd19edc, the default plan in graph and eager reads the same ids and55b10727a2f20da1again.batch_mem_op), main / this branch55b10727a2f20da1--place a,BLOOMERY_CARD_BUDGET=84292M: 49 experts on the host, no layer whole34cd72db9b0d9f22BLOOMERY_QWEN38_EXPERTS=host: every expert on the host8225b759e013a254BLOOMERY_RESIDENCY=mid-p500-s103a873fe24fa3e4eBLOOMERY_ROUTE_TRACE,--prefill stepc81f178744e72544With the route trace, both builds seal
positions=94 completeover all 48 layers, and the trace files(
MANIFEST.tsv,topk-<layer>.u16,slots-<layer>.u8) are byte for byte the same in graph and in eager.bloomery-serve-qwen38withBLOOMERY_ROUTE_TRACEon the default plan (tools/ref/route-trace-chat.py, onerequest) writes main's trace byte for byte: 101 positions over 48 layers. One budget step above 84292M puts every
expert on the card, so I found no plan that leaves some layers whole and others not; only the fixture's whole-plan
clause and the real file's whole plan cover a hostless layer.
FAIL-firsts on the real file (not committed; on
e8e32a38unless the line says otherwise):BLOOMERY_RESIDENCY=mid-p500-s1stops with rc 1 in graph and in eager at the first decode step (
SwapMachine::end_pass: row 0 at layer 0: slots [0..9] of top-10 not noted (1 rows kept)), andBLOOMERY_ROUTE_TRACEgenerates main's ids and logits but writesno positions.
Levers::hostleavingroute_traceunset, so the trace reaches a hostless load: on0bd19edc,generate_qwen3moe(graph and eager) stops with rc 1 at the attach,HostTier::attach_route_trace: a route trace on a load whose step runs layer 0 without the host service, which writes the trace: the load's HostCfg::route_trace was false (Levers::host sets it from BLOOMERY_ROUTE_TRACE). One8e32a38, where therefusal's text was older,
bloomery-serve-qwen38stopped at the same attach. Before the tier refused it, theseat's trace sealed 0 positions.
graph run at the capture check, by name.
The A/B.
tools/ref/depth-qwen3moe.shwithBLOOMERY_MODEL=qwen4exp, throughtools/box.sh's local mode on aDGX Spark's host, one lease,
LC_ALL=C, stock clocks, six rounds with the order rotated each round, n = 160 with 16warm steps, depth 6,
BLOOMERY_DRAFT=off, on maine8e32a38(before the rebase; of the files these commits change,the rebase onto
b8d1ff06brought changes only tocrates/leversandtools/unsafe-ratchet.txt). Before thesitting I wrote the card in
tools/ref/card.pyformat (card.py check: ok, h = 0.772 % at 6 rounds) with aprediction of +4..+15 % for the runner's term, tok/s(mean), and 1.03..1.07 for the p50 step ratio. The arms were
ours(this branch),bin:<main's build>(main) andours@BLOOMERY_AB_LOAD=arm(the A/A). The sitting began with the 1-minute and5-minute load averages both under 1.0, no GPU process and no container.
main_ms / PR_ms(from the ROW lines)PR / main(the runner's ratio line)PR / mainBoth terms read inside the card, so by its decide-in this pull request carries the p50 step first and the mean
beside it. Over the six rounds
oursaverages 30.88 tok/s with a 32.29 ms p50 step and a 32.39 ms mean step, andmain 28.32 tok/s, 33.77 ms and 35.33 ms. The mean term is larger because main has slow steps that
oursdoes not:main's mean step sits 2.50, 0.86, 2.34, 1.47, 1.05 and 1.11 ms above its p50 by round, and
ours0.08 to 0.10 ms.Main's
first10_p50column (33.99, 33.54, 33.63, 33.61, 40.04 and 33.88 ms against alast10_p50of 33.5 to 33.8ms, 35.9 in r5) shows slow first steps in r5 only. It is the median of steps 1 to 10, which are all inside the 16 warm
steps, and the p50 and the mean come from the SMOKE line, which counts steps 17 to 159, so slow first steps cost main
nothing in either term. The slow steps the mean does count come later, in runs of a few to a few dozen steps, and they
have the same cause as the slow first steps.
These are diagnostic runs outside the lease runners; no number here decides anything. The sitting's log keeps no
per-step times, so I looked into it in separate runs on the sitting's DGX Spark, with the
same model file and the command of the sitting's
bin:arm (--tokens 100000,53606,14808,58936,59336,53416 -n 160 --ctx 256 --time --warm 16,BLOOMERY_DRAFT=off), maine8e32a38against this branch, underBLOOMERY_STEP_STATS=1(one run of each without it), with a 100 ms read of each thread's CPU and context switchesfrom /proc beside it. This branch's mean sits 0.085 to 0.104 ms above its p50 in all six runs. Main's mean sits 0.9 to 2.3 ms above
its p50 in nine runs of ten (in the tenth more than half the steps were slow and the p50 itself read 39.5 ms), and 88
to 100 % of that excess is in steps more than 1 ms over the p50. Those steps cost 5 to 8 ms each. In their
stat steprecords
straggle_usreads about 11,000 against about 700 in a normal step,parksabout 600 against 5, andleg_usstays near 100 in both. No step past the warm ones takes a page fault, and the kernel does no reclaim while the steps
run.
The cause is the host leg's go wait. On main every hybrid layer of a step runs a service whose
wait_gois a pooljob: the 19 workers, pinned to 19 of the 20 cores, and the decode thread, which is not pinned and runs the last chunk,
all spin on the generation word until the go lands, and the card waits at the layer's
waituntil the servicesignals. When the scheduler puts the decode thread on a core that also holds a pinned worker, the two share that core.
The decode thread is then preempted about 1,000 times a second, each of the 48 services ends late, and the step takes
about 40 ms until the scheduler moves the decode thread back to the free core. In the thread samples, steps with the
decode thread on a worker's core averaged 39.5 to 41.7 ms across five runs, against 34.6 to 36.5 ms on the free core.
Three runs of main on another DGX Spark show the same: in the two where the decode thread spent time on a worker's
core, those steps averaged 41.0 and 42.3 ms against 34.1 and 34.2 ms on the free core, and main's mean sat 1.39 to
1.40 ms above its p50 in all three, against 0.07 ms for this branch. On the sitting's machine, the first steps are
slow when decode starts on a worker's core: the decode thread began on one in six runs and step 1 read 40 to 48 ms in all six; it began on a
free core in five runs and steps 1 to 3 read 33 to 35 ms in all five. Waiting 30 s between the load and the first
step (
--arm-sync) did not change this, so it is not something left over from the load. Shorter bursts come whenanother task takes a worker's core while the decode thread has its own: a wider /proc read that also took every other
process's CPU time, about 10 ms of CPU every 100 ms on one worker's core, added 4 to 8 ms to every third step of main
with the decode thread held on the free core (
taskset -c 19; the workers pin themselves). Under the same read thisbranch's mean sat 0.10 ms above its p50. On the other DGX Spark, the bursts that remain with the decode thread on its
own core and no sampler came from a monitoring script that reached the box over SSH every 5 s and ran
nvidia-smi,docker psand ajournalctlsearch. Each time, for about half a second, most cores took a burst of process starts,page faults and RCU work; the 19 workers together waited 23 to 45 ms per 100 ms for their cores (2 to 3 ms otherwise)
while the decode thread waited under 1 ms per 100 ms, and seven or eight steps of main ran long, up to 69 to 92 ms.
That was 60 to 85 % of main's excess over its p50 in those runs. This branch ran through the same probe: the mean
of its steps in each 100 ms window stayed within 2.1 ms of its p50, and its mean sat 0.105 ms above its p50. Parking is a symptom, not the cause: with
BLOOMERY_SPIN=0the workers park about640 times a step and the steps stay at 33 to 34 ms while the decode thread has its own core, and with
BLOOMERY_SPIN=2000000they never park and the bursts still come. This branch runs no host leg in the step on thisplan, so a step runs no pool job and waits for no go, and the slow steps that come from the go wait do not reach
it.
On main the effect could be reduced without this pull request, for example by leaving a core out of the pool
(
BLOOMERY_THREADS=19here: the decode thread found a free core within one or two steps and main's mean sat 0.5 and0.6 ms above its p50 in two runs) or by pinning the decode thread to a core the pool does not use. I have not changed
either.
How much of the mean term this is, as an estimate: in those runs on the sitting's machine, main's steps outside the
slow runs sit about 0.1 ms above its p50, as this branch's do. With main's mean at its p50 plus 0.1 ms in each round
of the sitting, tok/s(mean) would read 1.0459 ± 0.0065 instead of 1.0908 ± 0.0289. So about half of the mean term's
9.1 points (4.5) comes from main's slow steps, and the rest matches the p50 term (1.0458 ± 0.0065). The runner tags
every main row
[cold]; for abin:arm it counts major faults over the whole process, load included (about330,000), so the tag does not say whether the timed window faulted. The
oursrows (both arms) fault 0 to 3 times intheir timed window, and main's steps faulted 0 times in the runs above.
The 38 witness blocks show no Xid, event reasons 0x0 in every block, the SM clock at 2411 to 2424 MHz (208 MHz in
one, before the first load), and MemAvailable at 116.4 to 116.7 GiB in the 26 blocks taken with no model loaded
(37.2 to 37.3 GiB in the 12 taken while one was). No row was tagged
[cpu-busy]. The ids were equal in all sixrounds.
resident_bytesreads 83282041996 foroursand 83281960076 for main; the 81,920 bytes between them arethe zero row.
What I ran into
load's map, so it also skipped the host leg under a residency machine and under a route trace. Both broke on the
whole plan (the FAIL-firsts above). The decision now sits in
Card38::new. The trace is the awkward one: theload cannot see it, so it comes in through
HostCfg::route_trace, and a trace attached to the tier without it isrefused there. If you would rather attach the trace inside the load, or keep the flag off
HostCfg, say so and Iwill move it.
q5_1_gemv_sel(the Q5_1 expert down kernel, 43 of the 48 layers on this file) canwalk four rows a warp instead of one. Each lane's terms keep their order, so
gate_kquant's Q5_1 clause stays bitfor bit (
max_ulps 0at every shape). The launcher then refuses an expert size that is not a multiple of four,and the gate gains that case, which main accepts (the one FAIL on main). Its card said to include it if the
sitting read inside +0.5..+1.0 %, and it read 1.0088 ± 0.0021 in tok/s(mean) and 1.0090 ± 0.0024 on the p50 step
against this pull request's build at the time, both as
bin:arms. I still left it out. The card's h (0.193 %)rested on the A/A spread of this pull request's first sitting, and the q5_1 sitting's own A/A came out at
0.9967 ± 0.0111, so that assumption did not hold. AGENTS.md's ruler also cannot read a difference under 1 %
between two binaries. The commit is on my fork's
dgx-spark-q38-q51branch. A lever that picks one row or fourrows a warp inside one binary would let a same-binary sitting decide it; I can send that as its own pull request if
you want it.
not reach the Qwen3.8 card leg's kernels or its fused router.
sparkrouterindocs/research/sparkdec.md(section 7.1) coversqwen35moe_router_normand leaves_fusedout, but Qwen3.8 decode runsqwen35moe_router_fused_512. The sameregrid (eight rows a block, with gpu: on an integrated device, a decode gemv warp asks L2 for its whole row before the walk #27's prefetch) can go on that kernel, and I have it as a commit on top of gpu: on an integrated device, a decode gemv warp asks L2 for its whole row before the walk #27.
I can send it separately if you want it.
Docs
I changed no docs. No doc gives the Qwen3.8 step's node count or says that a layer the host serves nothing still
waits for it, so none goes stale here.
Hardware (if the change is for a machine)
Three DGX Sparks: one ran the sitting, the runs on
e8e32a38and0bd19edc, and most of the first-step runs, onethe runs on
dd187c1dand the first ones onb8d1ff06, and one the other first-step runs and the earlier sittings under "What I ran into". Onall three,
nvidia-smi --query-gpu=name,driver_versionprintsNVIDIA GB10, 595.84. CPU: 20 cores (10 Cortex-X925and 10 Cortex-A725).
MemTotalis 127535272 kB, 127535276 kB and 127599376 kB. All three run DGX OS 7.6.0 (the OTAversion in
/etc/dgx-release) on Ubuntu 24.04.5 LTS, kernel 6.17.0-1032-nvidia. The model is Qwen3.8-Flash-NextUD-Q4_K_XL(the four-part GGUF). I built in the project's dev container (CUDA 13.3.1, the pinned nightly) withcargo oxide build --arch sm_86 -- -p bloomery-gpu-gates --features gpu --release --bin <name>(--features gpu,deepseek41forbloomery-serve-qwen38), which the PTX JIT compiles on GB10. No local change to the trees one8e32a38,dd187c1dandb8d1ff06. The first sitting's trees onaa6df234hadtarget-cpu=nativein place ofznver3in.cargo/cuda-oxide.toml, becauseznver3stops rustc on aarch64.Which binary ran what (sha256, first 12 digits):
e8e32a38and this branch's two commits on it: the sitting, the same-output runs and FAIL-firsts, the seattrace, and the fixture-tier e2e mutants.
generate_qwen3moe: main3e8cb517249d, this branch033b192c4d40(both also the sitting's arms).bloomery-serve-qwen38: mainb169a103bef9, this branch8c0a5ea95f44.gate_hc_gated: main8efa448fcfd9, this branch5ebf97b858c2.dd187c1dand this branch on it: the ptxas table,gate_hc_gatedand the same-output runs.generate_qwen3moe: main013d600f3edb, this brancha327fcd1e4ca.gate_hc_gated: main16e1319fe3c7, thisbranch
0007b2f514ea.b8d1ff06, before this review's fixes:generate_qwen3moe650d47473b66(the same-output runs),gate_hc_gated6bdd1c83f496(60 PASS),gate_qwen4exp_e2eb0fe275994cf, its scaffold buildb16d0c7ead51(28 PASS), and theq38_fixtureunit test (2 passed).0bd19edc(mainb8d1ff06):generate_qwen3moeb541d28bd269(the whole plan's same-output runs),gate_hc_gatedc04fc9ee8a21(60 PASS),gate_qwen4exp_e2ed829f5c300d8, its scaffold buildb1658a499f26(30 PASS), the scaffold with the trace's refusal taken out
dd807cd565b8and with the machine's taken out840c3e17d2d6, andgenerate_qwen3moewithLevers::hostleavingroute_traceunsetbb07d69618f5.e8e32a38(e238179b1574) and an earlierbuild of this branch on it (
c681ed45bc79); on the other one, the first sitting's builds, mainaa6df234with thesingle-card timing mode of box.sh: local mode (BLOOMERY_BOX_LOCAL=1): the box command runs in this tree on a contributor's machine with a card of its own #38 and tools/ref: a single-card timing mode under box.sh's local mode (BLOOMERY_BOX_CARD=local): timing-card.sh times the one card nvidia-smi lists by UUID, the lease and its trace sit in BLOOMERY_LOCK_DIR, the witness prints the card, its Xid count, the shared memory pool and the machine, and depth-qwen3moe.sh fails an arm on an Xid or a lost card #39, which no kernel reads (
4c06205e8983), and this branch's two commits onthat tree (
7447a444a0ca).