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
[job] Per-request host-memory growth: attribute and stop it #73
all targets (seen on Qwen3.8-Flash-Next and 27B BFCL runs)
What's the job?
Attribute the per-request host-memory growth. A Flash-Next BFCL run (job 245, GB10) lost MemAvailable 9 → 5 GB over the first 242 requests (~27 MB/request early, ~8 MB/request later); earlier 27B runs showed ~4 MB/request. On a unified-memory box this caps how many requests a gate can run and can kill a server mid-run. Teardown reports thousands of allocations with no owner (teardown swept 1279 allocation(s) that no ModelResource released). Done = allocation tagging names the growth by owner, and a 995-request BFCL run is flat after warm-up.
changed the title [-][job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9[/-][+][job] Per-request host-memory growth: attribute and stop it[/+]on Sep 25, 2026
In flight (reiner job 254): per-request host-memory slope, 300 varied tool-bearing requests, Flash-Next recipe-like serve (MTP on, prefix caching on, util 0.93). First arm (main66): ~1.8 MB/request after warm-up (6,842 → 6,636 MB over requests 100-225). Second arm: #68's campaign binary — answers whether the ~7-27 MB/request seen in its BFCL run is a regression or the workload.
Result (reiner job 254). Per-request host-memory slope, 300 varied tool-bearing requests on the Flash-Next recipe (MTP on, prefix caching on), measured after warm-up (req 25..300):
#68 does not regress host memory. The steady leak is ~1.5 MB/req on both builds; it is pre-existing and still open under this issue.
The ~13 MB/req seen in #68's earlier BFCL run (job 245) is therefore not a campaign regression. It is specific to the BFCL workload, or to the harness running on the same box.
The generic tool probe (job 254) lost 1.4-1.7 MB/request.
At 27 MB/request the run would reach the 2.5 GB watchdog around question 260, so I cancelled it; it had already measured what it was for.
Leading suspect: the prefix-cache snapshot path.
BFCL runs through the recipe with prefix caching ON (radix tree + Marconi SSM snapshots).
Each request saves ~3 SSM snapshots: 91 prefill snapshots, 90 finish-leaf snapshots and 71 intermediate checkpoints over ~90 requests.
It also logs 25 × "prefix cache hit … but no SSM snapshot — recomputing all KV".
If a snapshot, or a radix node that owns one, is not released on eviction, the loss scales with requests.
Next: job 265. main66 serving the same BFCL client with prefix caching on vs off, 22 min per arm, memory traced against the completed-request count (least-squares MB/request).
If P0 is flat and P1 falls, the leak is in the prefix-cache / Marconi snapshot lifecycle.
If both fall, it is in request handling (tool parsing, templating) and prefix caching is cleared.
Correction: prefix caching is not the BFCL memory loss (job 265).
Setup: main66 serving the real BFCL client (spark benchmark run bfcl-subset --url), util 0.90, 22 min per arm. Slope is least squares over completed requests, excluding the first 10.
arm
MB lost / request
requests
MemAvailable
prefix caching on
4.22
11..181
7,366 → 6,236 MB
prefix caching off
8.79
13..155
7,751 → 6,125 MB
It is worse without prefix caching, so my Marconi-snapshot hypothesis was wrong.
Two open points:
Leak or bounded warm-up. ~170 requests cannot tell the two apart. Job 225 completed a full 995-question BFCL on this model, which argues for a plateau.
The 27 MB/request from job 261 came from the benchmark harness's own serve recipe, not from #68.
The pre-existing loss is real and has not plateaued. MemAvailable fell 5,854 → 4,968 MB between requests 77 and 362, about 3.1 MB/request past warm-up. It does not come from prefix caching (job 265: 8.8 MB/req with it off).
At util 0.90 on this 119.6 GB box, a full 995-question BFCL ends close to a 2.5 GB watchdog, which matches the runs that were stopped.
Workaround for gating: util 0.88.
Actual fix: find what grows per request. Next is a heap/allocation profile over ~200 BFCL requests: host allocations (jemalloc stats or heaptrack) vs device allocations (the tracked-alloc counter).
Measured with a jemalloc heap profile on reiner (job 273): the shipped recipe profile with thinking on, MTP and prefix caching, driven by BFCL traffic.
The growth only shows under the recipe. In job 271 the server's RssAnon grew +20.6 (main66), +24.6 (#68) and +28.0 (main66 without MTP) MB per request. The client stayed flat. Jobs 265/268 ran with thinking off and saw only ~4 MB/req, which is why they understated it.
Two leaks explain it.
xgrammar. Every compiled tool grammar held a deep copy of TokenizerInfo, about 20 MB on the 248k vocab. The grammar cache's LRU budget does not count that copy, and BFCL sends a distinct tool schema per request.
Fixed by #82 (merged in the GB10 train). Per-request host growth under the recipe profile fell from +24.6 MB/request to +1.86 MB/request (job 274). The full 995-request ST-995 run (job 280) kept server RssAnon flat at ~1.76 GB from request ~500 on, and the 1007-turn agentic leg (job 298) added only ~0.5 MB per turn after warm-up. A follow-up that makes the dedupe exact is #92.
Activity
[-][job] Qwen3.8-27B on Strix Halo: prefill 2.4x gap + DP4A verify tiers for K=5..9[/-][+][job] Per-request host-memory growth: attribute and stop it[/+]AzeezIsh commentedon Sep 25, 2026
In flight (reiner job 254): per-request host-memory slope, 300 varied tool-bearing requests, Flash-Next recipe-like serve (MTP on, prefix caching on, util 0.93). First arm (main66): ~1.8 MB/request after warm-up (6,842 → 6,636 MB over requests 100-225). Second arm: #68's campaign binary — answers whether the ~7-27 MB/request seen in its BFCL run is a regression or the workload.
AzeezIsh commentedon Sep 25, 2026
Result (reiner job 254). Per-request host-memory slope, 300 varied tool-bearing requests on the Flash-Next recipe (MTP on, prefix caching on), measured after warm-up (req 25..300):
#68 does not regress host memory. The steady leak is ~1.5 MB/req on both builds; it is pre-existing and still open under this issue.
The ~13 MB/req seen in #68's earlier BFCL run (job 245) is therefore not a campaign regression. It is specific to the BFCL workload, or to the harness running on the same box.
Next:
AzeezIsh commentedon Sep 25, 2026
BFCL-shaped traffic leaks ~16x faster (reiner job 261).
Leading suspect: the prefix-cache snapshot path.
Next: job 265. main66 serving the same BFCL client with prefix caching on vs off, 22 min per arm, memory traced against the completed-request count (least-squares MB/request).
AzeezIsh commentedon Sep 25, 2026
Correction: prefix caching is not the BFCL memory loss (job 265).
Setup: main66 serving the real BFCL client (
spark benchmark run bfcl-subset --url), util 0.90, 22 min per arm. Slope is least squares over completed requests, excluding the first 10.It is worse without prefix caching, so my Marconi-snapshot hypothesis was wrong.
Two open points:
Job 268 runs #68's binary in this exact harness for 40 min, prefix caching on, to measure both the slope and whether it flattens.
AzeezIsh commentedon Sep 25, 2026
#68 does not regress memory (job 268). Same harness as job 265: #68 head, BFCL traffic, prefix caching on, 40 min.
The 27 MB/request from job 261 came from the benchmark harness's own serve recipe, not from #68.
The pre-existing loss is real and has not plateaued. MemAvailable fell 5,854 → 4,968 MB between requests 77 and 362, about 3.1 MB/request past warm-up. It does not come from prefix caching (job 265: 8.8 MB/req with it off).
At util 0.90 on this 119.6 GB box, a full 995-question BFCL ends close to a 2.5 GB watchdog, which matches the runs that were stopped.
AzeezIsh commentedon Sep 26, 2026
Root cause found. Fix in #82.
Measured with a jemalloc heap profile on reiner (job 273): the shipped recipe profile with thinking on, MTP and prefix caching, driven by BFCL traffic.
The growth only shows under the recipe. In job 271 the server's RssAnon grew +20.6 (main66), +24.6 (#68) and +28.0 (main66 without MTP) MB per request. The client stayed flat. Jobs 265/268 ran with thinking off and saw only ~4 MB/req, which is why they understated it.
Two leaks explain it.
TokenizerInfo, about 20 MB on the 248k vocab. The grammar cache's LRU budget does not count that copy, and BFCL sends a distinct tool schema per request.kernel_audit::recordappended a row with two Strings on everyGpuBackend::kernel()call. qwen4_exp: land the 2026-08-31 long-context TTFT campaign (QSA tensor cores, mHC grid fix, MoE CTA striding) #68's mHC split dispatcher looks kernels up on every decode step, so this grew continuously.How the growth split across call sites:
hc_pre_split)TokenizerInfocloneWhat #82 changes.
TokenizerInfobecomes an Arc handle, and the audit keeps one row per(module, func, loaded).Next. Job 274 measures the slope on the merge-train tree before the gates run.
docs(status): 2026-09-26 — merge train, #73 root cause, TC2 default, …
Merge pull request #82 from Atlas-Inf/fix/host-heap-growth-73
AzeezIsh commentedon Sep 26, 2026
Fixed by #82 (merged in the GB10 train). Per-request host growth under the recipe profile fell from +24.6 MB/request to +1.86 MB/request (job 274). The full 995-request ST-995 run (job 280) kept server RssAnon flat at ~1.76 GB from request ~500 on, and the 1007-turn agentic leg (job 298) added only ~0.5 MB per turn after warm-up. A follow-up that makes the dedupe exact is #92.
Merge pull request #92 from Atlas-Inf/fix/kernel-audit-exact-dedupe
xgrammar: share TokenizerInfo storage across clones (Atlas-Inf#73)
spark-runtime: record each kernel lookup once in the audit (Atlas-Inf#73
spark-runtime: make the kernel-audit dedupe exact, not hash-only (Atl…