You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
paged: turn Qwen3.8's MTP draft on for 12/24 GB paged plans (verify's queue depth) #71
On a paged plan (12 GB and 24 GB cards, where experts are read from the NVMe tier into a RAM arena), a rule turns Qwen3.8's MTP draft off. The rule has no measurement behind it (crates/levers/src/lib.rs:1830-1837, "not shown to pay"). This issue settles it by experiment.
The part of the structure under test. A draft's verify computes 1 + k rows in one step. On a paged plan, each layer reads the rows' missed experts together, so the drive sees a deeper queue. The bytes do not shrink. But if the drive's throughput rises with queue depth, the time per token falls.
Prediction [derived]: ×1.0…×2.7, centre ×1.8. On a 12 GB RTX 3060 that is 5.4 tok/s → about 9.7 tok/s. If the drive's throughput is flat in queue depth, there is no gain (×0.9…×1.0). On a 12 GB card the draft takes about 2.8 GB of the card, so the context shrinks by that much.
Steps
A set BLOOMERY_DRAFT=mtp runs on a paged plan; unset stays off. The refusal clause is rewritten with a dated reason.
Check that the MTP verify takes the arena's read path (the multi-column step's port).
Same-binary A/B on a small arena (BLOOMERY_NVTIER_BYTES 4–8G, the shape of a PC with 32–64 GB of RAM), draft mtp vs off, n=1024, 6 rounds.
The drive's queue-depth curve: probe_nvread --threads 1,2,4,8. Anyone can help here. Post your result as a comment: drive model, how it is attached, and the output.
If the verdict is a gain, the paged plan's default turns on. The maintainers do this.
Step 5 from two drives: a DGX Spark whose drive is a 1 TB ESL01TBTLCZ-27J2-TYN (other Spark units ship other drives), and an SK hynix Platinum P41 in an x86_64 desktop. Neither is flat. With about 1 MB expert parts read through O_DIRECT at random offsets, the total rate rises ×1.76 from QD 1 to QD 4 on the Spark's drive and then flattens (×1.85 at QD 8, ×1.78 at QD 16). On the P41 it is ×1.79 at QD 4 and keeps rising, ×2.49 at QD 8 and ×2.64 at QD 16. A Spark would not run a 12/24 GB paged plan, so its drive is here only as one more curve.
QD here is the number of pread calls in flight from the reader's threads, as in docs/cards/qdsweep.card. With max_sectors_kb at 128 on both drives, the block layer splits each 1 MB pread into 128 KiB commands, so the drive sees more commands than that.
--threads takes one number (--threads 1,2,4,8 exits with --threads 1,2,4,8: invalid digit found in string), so each point is its own run at 1, 2, 4, 8 and 16 threads.
Drives and hosts
DGX Spark
x86_64 desktop
drive
ESL01TBTLCZ-27J2-TYN, 1 TB, DRAM-less (it uses a host memory buffer)
SK hynix Platinum P41 (SHPP41-2000GM), 2 TB
link
PCIe Gen4 x4
PCIe Gen4 x4
file system, kernel
ext4, 6.17.0-1032-nvidia
ext4, 7.0.0-38-generic
block queue
max_sectors_kb 128 (also the hardware limit), read_ahead_kb 128, scheduler none
the same
model file the probe read
Qwen3.8 UD-Q4_K_XL split set (48 layers)
the 4-layer Qwen3.8 gate fixture (qwen38-fixture, 8.9 GB)
The desktop does not hold the full split set, so its probe runs read the fixture, which sits on the same drive as the cold loop's file. The fixture's experts have the real shapes and types (512 a layer), so its parts average 1.14 MB (1.02 to 1.33 MB by layer), against 1.04 MB in the full file.
Results, GB/s: the median over three rounds, with the lowest and highest round in brackets. Each round's value is that run's median over its batches.
DGX Spark drive:
QD
cold loop, 96 random parts
probe k3 directN
probe range directN
probe range drive
1
2.17 (2.16..2.18)
1.76 (1.55..2.36)
2.74 (2.73..2.76)
4.72 (4.70..4.73)
2
2.83 (2.82..3.16)
3.16 (2.01..3.35)
4.32 (4.20..4.35)
4.73 (4.70..4.74)
4
3.81 (3.74..3.83)
4.11 (3.77..4.90)
5.46 (5.35..5.64)
4.72 (4.71..4.75)
8
4.00 (3.98..4.00)
4.50 (3.92..4.78)
6.75 (6.74..6.76)
4.75 (4.70..4.77)
16
3.86 (3.84..3.86)
4.25 (4.02..4.68)
6.74 (6.73..6.74)
4.80 (4.76..4.81)
P41:
QD
cold loop, 96 random parts
probe k3 directN
probe range directN
probe range drive
1
2.66 (2.66..2.66)
3.19 (3.18..3.20)
4.55 (4.39..4.63)
6.61 (6.61..6.62)
2
3.46 (3.45..3.47)
3.88 (3.79..4.04)
4.50 (4.48..4.55)
6.62 (6.61..6.62)
4
4.76 (4.74..4.79)
4.88 (4.71..4.91)
6.17 (5.71..6.39)
6.55 (6.45..6.59)
8
6.64 (6.61..6.67)
5.72 (5.59..5.83)
7.15 (7.07..7.15)
6.56 (6.49..6.62)
16
7.03 (7.03..7.04)
5.86 (5.83..6.04)
7.22 (7.21..7.23)
6.62 (6.62..6.63)
The cold loop is the closest of these columns to verify's misses. Each batch is 96 spans of 1,052,672 B (a 1,044,622 B part rounded out to pages) at random 4 KiB-aligned offsets in a 49.9 GB shard (-00002-of-00004), split over the threads in equal contiguous shares. Each thread has one blocking O_DIRECTpread in flight. The rate is the parts' bytes over the wall from the start signal to the last thread's end, 100 batches a run, with no pre-read and no gap between batches. The offsets come from a fixed seed, so every run on both machines reads the same 9,600 spans, and spans within a run can overlap. The code is at the end.
k3 is the probe's default case with the most parts, 9, so its QD 16 row runs at QD 9.
range is one layer's experts 256..511, 768 parts read in file order within each thread's share. The drive arm reads the same bytes on one thread in 4 MiB requests at every QD, so it is the run's reference and does not change with --threads.
The Spark's range directN, 2.74 / 4.32 / 5.46 / 6.75 / 6.74, is close to the curve in docs/cards/qdsweep.card (2.51 / 4.15 / 5.67 / 6.48 / 6.77). It reaches 6.8 GB/s at QD 8 where the cold loop stops at 4.0, but the two differ in more than order: range reads bytes the cache arm and direct1 read moments before, in one region of the file.
direct1 (QD 1, the same bytes as directN) was 2.73..2.91 on the Spark and 3.14..3.44 (k cases) and 4.50..4.66 (range) on the P41, leaving out the one-batch stub cases.
How the reads were kept cold
Page cache: before each run, every model file was dropped whole with posix_fadvise(POSIX_FADV_DONTNEED) over its full length, and mincore over the files then showed 0 resident pages. On the Spark a sync; echo 2 > /proc/sys/vm/drop_caches ran before that as well. The probe also checks each batch with mincore and redraws a batch that has a resident page.
The probe's own per-part drop does not clear everything it reads on these machines. What I observed: the k runs needed a few redraws each (k3: 1 to 5 on the Spark, 3 to 9 on the fixture), and in them the drive read 1.045 to 1.067 times the bytes the probe asked for (from /sys/block/<dev>/stat), against 0.9994 to 1.0011 in the range runs and 1.0000 to 1.0001 in the cold loop. A --ks 32 --batches 16 run on the Spark ended with 35 batches redrawn because dropped runs stayed resident (the last: 30 pages), so there is no 32-run case here, and on the fixture the default 64 batches ended the same way (83 redraws), so its k runs used 16. This fits what I measured earlier on two other Spark units: with max_sectors_kb and read_ahead_kb both at 128, WILLNEED brings in only 128 KiB of a part, and MADV_POPULATE_READ then faults the rest with read-around that runs past the part's end into the next expert. Why the next per-part drop (evict_rows, which drops the part's whole pages) does not clear those pages I have not proven. My guess is ext4 large folios that straddle the boundary between two experts, since a ranged DONTNEED skips a folio that reaches past its range, while the whole-file drop above clears everything.
The same thing appears to hit prove_instrument, which populates expert 256 of the middle layer's gate stack, inside the range the range case reads. On the Spark the range runs needed one redraw in two of the three rounds and never drew layer 24. On the 4-layer fixture a range run asking for all four layers failed with every layer's range was drawn or refused, and with the same seed a 3-batch run drew layers 3, 0 and 1, so layer 2 was the one refused. With three layers left, and the range run's k1 stub able to taint another, I set the fixture's range runs to 3 batches in round 1 and 2 batches in rounds 2 and 3.
Drive side: within a probe batch, direct1 and directN read the bytes the cache arm read moments before, so a drive with a read cache, or a map cache in host memory as on the Spark's drive, can serve them faster than a first read. The cold loop has no such pre-read. It reads below the probe's k3 directN at every QD from 2 up on the Spark and from 1 to 4 on the P41, although its batches are larger (on the P41 its parts are also smaller).
Before each point the machine had to pass a 60 s window: seven samples 10 s apart with the 1-minute load average under 1.00, no GPU compute process, no container and no build, and the model drive under 16384 sectors read and 65536 written. Then came the cold loop, the k run and the range run, each followed by the same process checks. The rounds used seeds 20261013, 20261014 and 20261015 and the thread orders 4 1 16 2 8, 8 2 16 1 4 and 1 8 4 16 2. The probe was built from e659f4fe and run directly, not through nvtier-read.sh, so its rows carry lease=false.
Commands, per point (BLOOMERY_REF_MODEL is shard 1 of the split set on the Spark, the fixture on the P41):
qdloop batch <shard 2> 1044622 96 T 100 0 0
probe_nvread --threads T --batches B --range-from 511 --range-batches 1 --seed S # k1..k3; B = 64 (Spark), 16 (fixture)
probe_nvread --threads T --ks 1 --batches 1 --warmup 0 --range-from 256 --range-batches R --seed S # range; R = 16 (Spark), 3 or 2 (fixture)
What the curves say about the prediction
The question in the issue is whether reading more missed experts at once raises the drive's throughput. On both drives it does between QD 1 and QD 4: ×1.76 on the Spark's drive and ×1.79 on the P41 for random parts. Past QD 4 the Spark's drive gains 5 % more by QD 8 and nothing after that, while the P41 keeps gaining up to QD 16. How much of this reaches tok/s depends on terms these runs do not measure: the queue depth the paged reader issues today for one row's misses and for 1 + k rows (steps 2 and 3), its thread count, and how much of a step is drive time. I did not turn the curves into a tok/s ratio.
Thank you. Both curves rise from QD 1 to QD 4, which is the premise of the draft's gain on a paged plan. Tonight's A/B runs the paged MTP draft at a 16 GiB card budget (A6000, an 8 GiB arena). On a 12 GiB budget the drafted load is refused at the card's floor: the draft layer's 512 routed experts are 2.85 GB on the card. The A/B result and that floor go in this issue tomorrow.
Activity
[-]paged: 12/24 GB paged plan에서 Qwen3.8 MTP draft를 켜는 실험 (verify의 큐 깊이)[/-][+]paged: turn Qwen3.8's MTP draft on for 12/24 GB paged plans (verify's queue depth)[/+]juliankang4 commentedon Oct 12, 2026
Step 5 from two drives: a DGX Spark whose drive is a 1 TB ESL01TBTLCZ-27J2-TYN (other Spark units ship other drives), and an SK hynix Platinum P41 in an x86_64 desktop. Neither is flat. With about 1 MB expert parts read through
O_DIRECTat random offsets, the total rate rises ×1.76 from QD 1 to QD 4 on the Spark's drive and then flattens (×1.85 at QD 8, ×1.78 at QD 16). On the P41 it is ×1.79 at QD 4 and keeps rising, ×2.49 at QD 8 and ×2.64 at QD 16. A Spark would not run a 12/24 GB paged plan, so its drive is here only as one more curve.QD here is the number of
preadcalls in flight from the reader's threads, as indocs/cards/qdsweep.card. Withmax_sectors_kbat 128 on both drives, the block layer splits each 1 MBpreadinto 128 KiB commands, so the drive sees more commands than that.--threadstakes one number (--threads 1,2,4,8exits with--threads 1,2,4,8: invalid digit found in string), so each point is its own run at 1, 2, 4, 8 and 16 threads.Drives and hosts
max_sectors_kb128 (also the hardware limit),read_ahead_kb128, scheduler noneqwen38-fixture, 8.9 GB)The desktop does not hold the full split set, so its probe runs read the fixture, which sits on the same drive as the cold loop's file. The fixture's experts have the real shapes and types (512 a layer), so its parts average 1.14 MB (1.02 to 1.33 MB by layer), against 1.04 MB in the full file.
Results, GB/s: the median over three rounds, with the lowest and highest round in brackets. Each round's value is that run's median over its batches.
DGX Spark drive:
k3directNrangedirectNrangedriveP41:
k3directNrangedirectNrangedrive-00002-of-00004), split over the threads in equal contiguous shares. Each thread has one blockingO_DIRECTpreadin flight. The rate is the parts' bytes over the wall from the start signal to the last thread's end, 100 batches a run, with no pre-read and no gap between batches. The offsets come from a fixed seed, so every run on both machines reads the same 9,600 spans, and spans within a run can overlap. The code is at the end.k3is the probe's default case with the most parts, 9, so its QD 16 row runs at QD 9.rangeis one layer's experts 256..511, 768 parts read in file order within each thread's share. Thedrivearm reads the same bytes on one thread in 4 MiB requests at every QD, so it is the run's reference and does not change with--threads.rangedirectN, 2.74 / 4.32 / 5.46 / 6.75 / 6.74, is close to the curve indocs/cards/qdsweep.card(2.51 / 4.15 / 5.67 / 6.48 / 6.77). It reaches 6.8 GB/s at QD 8 where the cold loop stops at 4.0, but the two differ in more than order:rangereads bytes the cache arm anddirect1read moments before, in one region of the file.direct1(QD 1, the same bytes as directN) was 2.73..2.91 on the Spark and 3.14..3.44 (k cases) and 4.50..4.66 (range) on the P41, leaving out the one-batch stub cases.How the reads were kept cold
posix_fadvise(POSIX_FADV_DONTNEED)over its full length, andmincoreover the files then showed 0 resident pages. On the Spark async; echo 2 > /proc/sys/vm/drop_cachesran before that as well. The probe also checks each batch withmincoreand redraws a batch that has a resident page./sys/block/<dev>/stat), against 0.9994 to 1.0011 in the range runs and 1.0000 to 1.0001 in the cold loop. A--ks 32 --batches 16run on the Spark ended with35 batches redrawn because dropped runs stayed resident (the last: 30 pages), so there is no 32-run case here, and on the fixture the default 64 batches ended the same way (83 redraws), so its k runs used 16. This fits what I measured earlier on two other Spark units: withmax_sectors_kbandread_ahead_kbboth at 128,WILLNEEDbrings in only 128 KiB of a part, andMADV_POPULATE_READthen faults the rest with read-around that runs past the part's end into the next expert. Why the next per-part drop (evict_rows, which drops the part's whole pages) does not clear those pages I have not proven. My guess is ext4 large folios that straddle the boundary between two experts, since a rangedDONTNEEDskips a folio that reaches past its range, while the whole-file drop above clears everything.prove_instrument, which populates expert 256 of the middle layer's gate stack, inside the range therangecase reads. On the Spark the range runs needed one redraw in two of the three rounds and never drew layer 24. On the 4-layer fixture a range run asking for all four layers failed withevery layer's range was drawn or refused, and with the same seed a 3-batch run drew layers 3, 0 and 1, so layer 2 was the one refused. With three layers left, and the range run'sk1stub able to taint another, I set the fixture's range runs to 3 batches in round 1 and 2 batches in rounds 2 and 3.direct1anddirectNread the bytes the cache arm read moments before, so a drive with a read cache, or a map cache in host memory as on the Spark's drive, can serve them faster than a first read. The cold loop has no such pre-read. It reads below the probe'sk3directN at every QD from 2 up on the Spark and from 1 to 4 on the P41, although its batches are larger (on the P41 its parts are also smaller).e659f4feand run directly, not throughnvtier-read.sh, so its rows carrylease=false.Commands, per point (
BLOOMERY_REF_MODELis shard 1 of the split set on the Spark, the fixture on the P41):What the curves say about the prediction
The question in the issue is whether reading more missed experts at once raises the drive's throughput. On both drives it does between QD 1 and QD 4: ×1.76 on the Spark's drive and ×1.79 on the P41 for random parts. Past QD 4 the Spark's drive gains 5 % more by QD 8 and nothing after that, while the P41 keeps gaining up to QD 16. How much of this reaches tok/s depends on terms these runs do not measure: the queue depth the paged reader issues today for one row's misses and for 1 + k rows (steps 2 and 3), its thread count, and how much of a step is drive time. I did not turn the curves into a tok/s ratio.
The cold loop
Probe rows, round 1 (seed 20261013), both drives
midagedev commentedon Oct 12, 2026
Thank you. Both curves rise from QD 1 to QD 4, which is the premise of the draft's gain on a paged plan. Tonight's A/B runs the paged MTP draft at a 16 GiB card budget (A6000, an 8 GiB arena). On a 12 GiB budget the drafted load is refused at the card's floor: the draft layer's 512 routed experts are 2.85 GB on the card. The A/B result and that floor go in this issue tomorrow.
midagedev commentedon Oct 20, 2026
Status (2026-10-20): BLOOMERY_DRAFT=mtp runs on paged plans. Left: the A/B that decides whether the default turns on.