Skip to content

GB10 TP2: kernel tuning MemoryError with MTP (glm-5.3-flash); vm.min_free_kbytes hides ~6.6 GB from the headroom check #73

Open

Description

@CaptKitCarson

Setup: 2x DGX Spark (GB10, 128 GB unified each), direct CX7 RoCE link, Flare main @d5fd9824 (scripts/build_deb.sh), Orbit + flare-agent TP2. Model nvidia/GLM-5.3-Flash-FP4-Local@76348dd, --max-concurrency 8, --prefill-chunk-size 2048. Stock DGX OS, driver 580.178.04.

Problem: the MTP export fails in kernel tuning with MemoryError on both ranks. Tuning finds 7.2-8.8 GiB free and needs 9,216 MiB (8 GiB headroom + 1 GiB growth), measured after scratch reservation, which takes about 9.5 GiB whatever the concurrency. The same export without MTP passes.

Didn't help: dropping page cache, --compile-workers 4, chunk 2048, lower speculative capacity or image concurrency, c4.

Workaround: our boxes run vm.min_free_kbytes=4194304, a common Spark setting against GPU-driver OOM freezes. On GB10 the kernel watermarks hide about 6.6 GB per box from cudaMemGetInfo. Lowering it to 2 GiB for the export only gave back about 3.7 GB and the MTP export passed. Serving then works with 4 GiB restored: KV 1,993,728 tokens (6.9 GiB per rank), 1M tokens per request, c8.

Asks:

  1. On unified-memory parts, could the tuning headroom be configurable or scale with total memory?
  2. Could the MemoryError print the free and needed numbers, and mention min_free_kbytes on GB10?

Result once running, for reference:

  • tools 5/5
  • our 8-case image test 8/8; the tiny-solid-colour-after-20K case also came back right
  • Hotel Lights (llm-inference-bench) xhigh 8/8
  • decode 41 / 81 / 121 tok/s at C1 / C4 / C8
  • prefill 1,683-2,018 tok/s from 8K to 128K

So GLM + MTP + vision on 2x GB10 TP2 works.

Minor, same build: at d5fd982, packaging/debian/Dockerfile and Dockerfile.dockerignore don't COPY or allow the recipe assets for gemma4, glm53, kimi3, mimo_v2, minimax_m3, nemotron_h, qwen38 and step5. build_deb.sh failed on a missing kimi3 template until we added them.

Activity

  1. javieratomic commented on Oct 28, 2026

    @javieratomic
    Contributor

    Some numbers from a 3x GB10 setup (DeepSeek V4.1 Flash, TP3) in support of making the headroom configurable.

    On GB10 the fixed 8 GiB _HEADROOM_BYTES in ignition/preparation/host_memory.py is what sizes the compiler pools once the weights are resident. During an export each node has about 10-13 GiB available, which leaves one forward compiler per rank. For a local experiment only, I patched the constant to 6 GiB. I know AGENTS.md rules out environment switches, so this is not a proposal for the mechanism.

    I then timed "Compile model forwards" on its own: tuning was restored from cache, forwards started cold, and everything else was identical.

    Setting Compile model forwards
    --compile-workers 4, headroom 8 GiB 997 s
    no flag, headroom 8 GiB 908 s
    no flag, headroom 6 GiB 503 s

    With 6 GiB the lowest MemAvailable on any node during the phase was 9 GiB, and there was no OOM. A full export with 6 GiB of headroom completed and the package served normally: at 262k tokens, the cold prefill took 77.6 s and the warm one 1.8 s, retrieval scored 16/16, and decode ran at 42.7 tok/s with one stream and 93.5 tok/s aggregate with four. All of these numbers are in line with the 8 GiB exports.

    --compile-workers N is slower than the default because it forces compile_threads=1 (compile_pool.py), while the memory budget still caps the pool at one worker. That is easy to misread as "more workers".

    Two small suggestions:

    1. Make the headroom a preparation setting, carried through the plan into PreparationConfig, so the report records it, and keep 8 GiB as the default. Make the compiler memory headroom a preparation setting #122 does this as [preparation] compile_headroom and --compile-headroom. With either one set to 6G, "Compile model forwards" took 508–511 s, against 906 s with the default.
    2. When a rank cannot fit a forward compiler, report the numbers when the phase starts (free, headroom, per-worker bytes). Today the rank waits in all_gather until the end of the phase before it raises the MemoryError.
  2. CaptKitCarson commented on Nov 2, 2026

    @CaptKitCarson
    Author

    Update for Qwen, for anyone hitting this on GB10: at 6fa01a49 a Qwen3.8 Flash Next TP2 export with MTP 5 and c8 passed kernel tuning on the stock vm.min_free_kbytes=4194304, with no change to the setting ("Prepare and tune kernels" 788.1 s, FlashInfer f5f5341d).

    This isn't a retest of the GLM-5.3-Flash MTP export this issue was opened for, and I haven't checked whether the headroom check itself changed, so it doesn't show the issue is fixed.

  3. added
    triage:reviewProposed change needs code review; this does not imply merge readiness.
    bugSomething isn't working
    priority:P2Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround.
    area:memoryMemory budgets, allocation lifetimes, scratch sharing, and capacity.
    area:preparationIgnition checkpoint loading, tuning, compilation, capture, and export.
    on Nov 5, 2026
  4. added a commit that references this issue on Nov 5, 2026
  5. added
    model:glm-5.3Affected recipe or documented reproducer: glm-5.3. Impact may be broader.
    on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:memoryMemory budgets, allocation lifetimes, scratch sharing, and capacity.area:preparationIgnition checkpoint loading, tuning, compilation, capture, and export.bugSomething isn't workingmodel:glm-5.3Affected recipe or documented reproducer: glm-5.3. Impact may be broader.priority:P2Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround.triage:reviewProposed change needs code review; this does not imply merge readiness.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions