Skip to content

coli: --auto-tier applies the plan's VRAM tier on sibling engines, and says why when it cannot (#1581) - #1582

Merged
JustVugg merged 2 commits into
devfrom
fix/auto-tier-vram-notice
Sep 18, 2026
Merged

JustVugg merged 2 commits into
devfrom
fix/auto-tier-vram-notice

Conversation

@JustVugg

@JustVugg JustVugg commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Closes #1581.

What the report found

coli plan and coli doctor print a VRAM tier. --auto-tier is documented as applying the plan they print ("automatically apply the RAM/VRAM placement plan", docs/SETTINGS.md). On the sibling-engine path it then dropped the tier whenever COLI_CUDA was not already 1, which --auto-tier on its own never sets, and dropped it in silence: no [PLAN] line, no [CUDA] banner, VRAM flat during decode. On the reporter's RTX 4060 Ti that was 11.8 tok/s against 21.0 once --gpu auto was added, and they only found it by watching nvidia-smi.

What changed since the first version of this PR

The first version kept the drop and only announced it. That was the weaker half of the report's own suggestion, and it leaves the user where they started: half the throughput, now with a message about it.

The drop was right when it was written. cuda_binary() could inspect only the GLM binary, so a working qwen36 CUDA build looked CPU-only to it, and requiring an explicit flag was safer than risking a CPU-only sibling launched as a CUDA one. Since #1533 the check takes the engine that will actually run, so the risk that contract was written against can be tested rather than assumed, and assuming it costs the user the tier they were just shown.

plan_cuda_enabled() now asks the question the GLM path has always asked (has_cuda=cuda_binary()), of the right binary:

state decision why
COLI_CUDA=1 apply --gpu/--vram already validated the build and exited if it was not capable
COLI_CUDA=0 do not --gpu none is still the off switch
unset ask the family's engine cuda_binary(engine_for_gpu_check(a)), and dsv4_cuda_available for DeepSeek V4, because cuda_binary() rejects valid V4 CUDA builds (#1219)

A CPU-only build still never gets a CUDA launch. That is now what the check says, rather than what the flag assumed.

The notice stays, and says which of the two happened

There are two ways a real tier can still go unused, and the advice for them is not interchangeable:

  [PLAN] the plan's VRAM tier is not being applied
  5.2 GB on 0:NVIDIA GeForce RTX 4060 Ti stays unused: the engine binary has no
  GPU backend, so there is nothing to apply it with. Rebuild the engine with
  CUDA=1 to use it.

and for --gpu none, "drop it to use the plan as printed" instead. Telling someone to rebuild an engine when they asked for no GPU sends them to fix something that is not broken.

It stays quiet when the tier was not real: no device qualified to drive placement (plans_placement, the planner's own test) or a zero budget. Neither was going to be applied with the GPU on either, and a warning that fires on every CPU-only launch is one people learn to scroll past.

The call sits outside the try that wraps plan construction. It only prints, and a display helper that stumbled inside it would be reported as invalid resource plan and take the launch down with it.

Verification

tests/test_auto_tier_vram_notice.py covers the decision in both directions, not just the message:

  • a GPU build gets the tier with no flag (the defect: this used to be False), and the family's own binary is the one inspected;
  • a CPU-only build still does not;
  • --gpu none beats a GPU build, and needs no probe to decide;
  • an explicit --gpu is taken at its word without a second probe that could only disagree with a decision already made;
  • V4 uses its own probe and the generic one is never called for it;
  • both notice messages, and the three silences.

Full suite on this branch rebased onto dev: python3 -m pytest tests/ -q — 939 passed, 161 skipped, 585 subtests passed.

Not verified here: no GPU on the machine this was written on. @troturier offered to test a patch on the reporting box (single 8 GB card, qwen36 and deepseek_v4 CUDA builds) — that is the measurement that would close this properly, since the claim is that --auto-tier alone now reaches the 21 tok/s that --auto-tier --gpu auto reached.

JustVugg and others added 2 commits September 17, 2026 14:36
)

`coli plan` and `coli doctor` print a VRAM tier; `--auto-tier` is documented as
applying that plan; and then environment_for_plan drops the tier whenever CUDA
was not switched on, which `--auto-tier` alone never does. Nothing said so.

The drop itself is the contract and stays: --gpu and --vram are what select a
CUDA-capable build, and merely asking for a plan must not turn a CPU-only
sibling binary into an attempted CUDA launch. The silence was the defect. On
the box in #1581 it was the difference between 11.8 and 21 tok/s, with the
plan on screen promising the tier that the launch had just discarded.

So the launcher now names what it is not applying, how much of it there is, and
the flag that would use it. It stays quiet when the tier was not real anyway --
no device qualified to drive placement, or a zero budget -- because a warning
that fires on every CPU-only launch is one people learn to scroll past.

The notice sits outside the try that wraps plan construction on purpose: it
only prints, and a display helper that stumbled inside it would be reported as
"invalid resource plan" and take the launch down with it.

tests/test_auto_tier_vram_notice.py covers both directions and the malformed
plan. It caught a real mistake on the way: GB lives in resource_plan, not in
the launcher, so the first version raised NameError on the one path that
mattered.
… it (#1581)

`coli plan` and `coli doctor` print a VRAM tier. `--auto-tier` is documented as
applying the plan they print. On the sibling-engine path it then dropped the
tier whenever COLI_CUDA was not already "1", which `--auto-tier` on its own
never sets, and dropped it in silence: no [PLAN] line, no [CUDA] banner, just
half the throughput. On the reporter's RTX 4060 Ti that was 11.8 tok/s against
21.0 once `--gpu auto` was added, found only by watching nvidia-smi.

The drop was right once. cuda_binary() could inspect only the GLM binary, so a
working qwen36 CUDA build looked CPU-only to it, and requiring an explicit flag
was safer than risking a CPU-only sibling launched as a CUDA one. Since #1533
the check takes the engine that will actually run, so the risk that contract
was written against can be tested instead of assumed -- and assuming it costs
the user the tier they were just shown.

So plan_cuda_enabled() now asks the same question the GLM path has always asked
(`has_cuda=cuda_binary()`), of the right binary:

  COLI_CUDA=1  --gpu/--vram already validated the build; take it at its word
  COLI_CUDA=0  --gpu none is still the off switch
  otherwise    ask the family's engine, and DeepSeek V4 its own probe, because
               cuda_binary() rejects valid V4 CUDA builds (#1219)

A CPU-only build still never gets a CUDA launch: that is now what the check
says rather than what the flag assumed.

The notice stays, for the two ways a real tier can still go unused, and says
which one happened -- "drop --gpu none" and "rebuild with CUDA=1" are not
interchangeable advice. It stays quiet when no device qualified to drive
placement or the budget was zero, since neither was going to be applied with
the GPU on either. The call sits outside the try that wraps plan construction:
it only prints, and a display helper that stumbled inside it would be reported
as "invalid resource plan" and take the launch down with it.

tests/test_auto_tier_vram_notice.py covers the decision in both directions (a
GPU build gets the tier without a flag; a CPU-only build does not; --gpu none
beats a GPU build; an explicit --gpu is taken at its word without a second
probe; V4 uses its own probe) and the notice's two messages and its silences.
@JustVugg
JustVugg force-pushed the fix/auto-tier-vram-notice branch from b7526bf to 28959fa Compare September 17, 2026 12:39
@JustVugg JustVugg changed the title coli: say when --auto-tier is leaving the plan's VRAM tier unused (#1581) coli: --auto-tier applies the plan's VRAM tier on sibling engines, and says why when it cannot (#1581) Sep 17, 2026
Edo771977 added a commit to Edo771977/colibri that referenced this pull request Sep 17, 2026
- c/coli: ask about the accelerator LAST. JustVugg#1582 lets --auto-tier turn the
  VRAM tier on from the built binary alone, after the --gpu/--vram block, so
  the Windows hot-team defaults were seeded for launches that do use the GPU
  -- exactly what their own comment forbids. Moved the block to the end of
  env_for_engine, with a test that fails without the move.
- c/compat.h: compat_fadvise waited on a pending warm-up read through an
  OVERLAPPED with no hEvent, i.e. on the file handle, which a shared fd
  signals for ANY completed read; it could return while this read was still
  in flight and then free the buffer. It now goes through compat_read_at and
  its per-thread event (helpers moved above it), which also resets the event
  before each read instead of relying on ReadFile doing it.
- ISTRUZIONI.md: current hardware (64 GB at 5200, SSD in M.2_3 at Gen4 x4,
  BIOS 3881), the measured numbers, and the reordered open items.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Edo771977 added a commit to Edo771977/colibri that referenced this pull request Sep 18, 2026
Integrazione dev + JustVugg#1582 auto-tier VRAM + JustVugg#1580 build Windows CUDA + JustVugg#1588 + tetto RAM_GB qwen36
@JustVugg
JustVugg merged commit 5a0b725 into dev Sep 18, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant