Repository navigation
gate-batch: a local batch runs one lane and packs against the machine's own memory - #1125
Conversation
…e box's card names Outside the box the card a command runs on was told three ways: tools/box.sh refused BLOOMERY_CARD=both by name on every machine, tools/gpu-gate.sh refused BLOOMERY_GATE_CARD=both the same way, and tools/ref/timing-card.sh listed every card nvidia-smi shows, ignoring the CUDA_VISIBLE_DEVICES the command was given, so a machine with two cards and one in view was refused as two. tools/ref/tier-cost.sh counted the physical cards on its own. - tools/ref/cards.sh gains cards_view: the cards in view by UUID, from CUDA_VISIBLE_DEVICES (UUIDs, unique UUID prefixes or nvidia-smi indices) or every listed card when it is unset, with a named reason when they cannot be told: an entry naming no card, several or one already in view, and, without CUDA_DEVICE_ORDER=PCI_BUS_ID, an index unless the indices alone name every card, since CUDA counts fastest first by default and nvidia-smi lists by PCI bus. The box's two names stay in the file as the box's own. - tools/box.sh's local mode runs BLOOMERY_CARD=both when two or more cards are in view, read after the environment file, and otherwise refuses with the cards in view (64). The one local gate lock holds every card of the machine, so it holds whatever is in view. - tools/gpu-gate.sh's local mode takes BLOOMERY_GATE_CARD=both by the same rule. - timing-card.sh's local mode times the one card in view, or the BLOOMERY_TIMING_GPU among them. tier-cost.sh's own count of physical cards goes: timing-card.sh leaves it one card in view or refuses with the reason. - The stub trees' cards.sh carries the real cards_view, and the depth-serve local case starts from the caller's view. - local-check.md, dgx-spark.md, BUILD.md and the serve-qwen38 comments describe the cards in view instead of the card names.
…'s own memory The batch's two lanes are the box's two cards, each behind a gate lock of its own, and the pack's budget is the box's lowest MemAvailable. Under BLOOMERY_BOX_LOCAL=1 every gate takes the one local gate lock that holds the machine's cards, so a second lane's gates only queued on it, and a two-lane pack summed its items against the box's 262 GB whatever the machine had. - Local mode defaults to --lanes 1; --lanes 2 still runs two lanes. - A two-lane local batch packs against this machine's MemAvailable less the same 1 GiB margin, read once as it starts; BLOOMERY_PACK_BUDGET still overrides it. - tools/gate-batch-resources.tsv says what a row is: the plan's host bytes, the same on every card with the room for the gate plan, summed against the machine's budget. - The self-test clears BLOOMERY_BOX_LOCAL for its cases and checks both local defaults.
There was a problem hiding this comment.
Verdict: CLEAN: Local card selection and batching preserve named refusals and the local lock contract.
Checked
Duplicates: 1 new production function checked by Grep; no duplicate owner. Stub runners embed the production selector.
Complexity: no Rust function changed; no crapper targets.
Silent failure: 4 caller paths followed through box, gate, timing, and batch setup. Invalid views and unreadable memory produce named refusals.
Tests: all 9 changed shell scripts pass bash -n. The selector and batch assertions cover invalid views, environment overrides, two-card refusals, lane defaults, and the local memory budget.
Mutation review: ignoring the view, accepting duplicates, dropping trailing-empty or device-order checks, and shifting index lookup make the selector assertions red (tools/ref/cards.sh:52). Moving selection before environment overrides breaks the box assertions (tools/box.sh:1411). Dropping the two-card guard breaks the gate refusal assertion (tools/gpu-gate.sh:2247). Keeping two default lanes or the workstation budget breaks the batch assertions (tools/gate-batch.sh:4406, tools/gate-batch.sh:4418).
Gates: no numeric gate or lint moved. The PR supplies FAIL-first output for the replaced local-mode behavior.
Escape catalog: no C1–C4 pattern matched. New status captures preserve errors; heredoc substitutions are intentional.
Performance: tool and documentation changes only; no inference hot path changed.
Notes
Dryer and crapper did not run because no Rust file changed. Runtime cases, full tool suites, and hardware gates were not rerun during validation.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
로컬 모드의 GPU 선택을 박스의 카드 이름 대신 실제로 보이는 카드에서 읽고, 로컬 gate-batch가 레인 1개와 그 머신의 메모리로 묶도록 바꾸는 도구 PR입니다.
What and why
Local mode (
BLOOMERY_BOX_LOCAL=1) still chose cards by the two names of the maintainer workstation, soBLOOMERY_CARD=bothwas refused on every machine, including one with two cards, and a machine with several cards could not time on the card it had in view. A local batch also ran two lanes, although every local gate takes the one local gate lock, and packed its loads against the workstation's memory figure instead of the machine's own.cards_viewintools/ref/cards.shnow says which cards a local run uses. It reads the listed cards fromnvidia-smiand takes the caller'sCUDA_VISIBLE_DEVICES(UUIDs, unique UUID prefixes, or indices) as the view. A failingnvidia-smi, an empty view, an entry that names no listed card, a repeated card, and an index that CUDA's default device order could read as another card are each refused with the reason.tools/box.sh,tools/gpu-gate.shandtools/ref/timing-card.shtake their local cards from it, soBLOOMERY_CARD=bothandBLOOMERY_GATE_CARD=bothrun when two or more cards are in view and are refused, naming the cards, when fewer are.tools/ref/tier-cost.shdrops its own physical-card count, and the stub runners embed the realcards_view. In local modetools/gate-batch.shdefaults to--lanes 1;--lanes 2still runs two lanes and packs against the machine'sMemAvailableless the same 1 GiB margin, read once at start.BLOOMERY_PACK_BUDGETstill overrides, and the box's defaults are unchanged.tools/gate-batch-resources.tsv's header,docs/contrib/local-check.md,docs/contrib/dgx-spark.md,docs/BUILD.mdand thejustfilecomments now describe this.Release notes: Changed: local gate runs read their cards from the cards in view, so the two-card recipes run on a machine with two or more cards, and a local gate-batch runs one lane by default.
Code shape
cards_view, replaces the name checks intools/box.sh,tools/gpu-gate.shandtools/ref/timing-card.sh, and the separate card count intools/ref/tier-cost.shis removed. The stub tree embeds the real function instead of a copy.cards_viewreturns a named reason for every refusal and each caller turns it into a named refusal (exit 64);tools/gate-batch.shstops by name when/proc/meminfogives nothing.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line): none.What I ran
Base
e635e3fb7b82a656f5b7b9849fb5da79bdf0a980, PR head0319b30125c9ceb4b518d5b03e740937bdc824a1.The selector and the two-card refusals on the card, through box.sh's local mode (
BLOOMERY_BOX_LOCAL=1). The probe reads the view throughcards_viewwith the caller'sCUDA_VISIBLE_DEVICESunset, as an index, as a UUID prefix, as an index past the list, as an unlisted UUID and as a card named twice, then runstiming-card.shthroughtools/box.shand asks forboth:The model-free one-card gate end to end through box.sh's local mode, the build and gpu-gate.sh's local lock:
The gate printed 164
PASSlines and noFAIL, ending inPASSED: gate_kquant q5k_gemv_sel within 1e-5 of the f64 dequant_row reference at 8 shapes.The tool tests, on a Linux host without a card:
The new cases include the local
bothruns on two cards in view, the env-file narrowing, an index underCUDA_DEVICE_ORDER=PCI_BUS_ID, an index that leaves a card out, an index beside a UUID, a card named twice, a newline in the value,--lanes 1as the local default and--lanes 2packing againstMemAvailableless 1 GiB. With the production files at the base and the tests at this change, the same two commands fail:Hardware (if the change is for a machine)
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.