Skip to content

fix(inkling): measure RAM on Windows so auto-cap is not 16 experts - #1726

Merged
JustVugg merged 1 commit into
JustVugg:devfrom
kevin9327:fix/inkling-windows-ram-probe
Sep 24, 2026
Merged

JustVugg merged 1 commit into
JustVugg:devfrom
kevin9327:fix/inkling-windows-ram-probe

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Symptom

On Windows, coli serve --model <inkling> with no --cap always sizes the expert LRU to 16 experts/layer, and /health reports ram_total_gb: 0.0 / ram_avail_gb: 0.0. This host had 13 GB free while that happened. macOS already measured RAM; Windows took the #else return 0 branch.

The auto path is:

cap = avail > 0 ? (avail*0.80 - 4e9) / (slot * sparse_layers) : 16

Zero available RAM is treated as "use 16". There was no warning.

This is the Inkling half of the same class as #1601 (OLMoE Linux-only probe). It does not overlap #1611, which changes olmoe.c.

Fix

  • mem_avail_bytes() calls compat_mem_available_gb() (Linux MemAvailable, macOS free+inactive+purgeable, Windows ullAvailPhys/commit). If that is still 0, print one line and keep the historical 16-slot fallback.
  • serve_hwinfo() fills total/available from compat_meminfo_gb() when /proc/meminfo is absent, so /health stops reporting 0.0 GB. Windows also fills cores; Darwin fills the CPU brand.

--cap is unchanged.

Tests

tests/test_inkling_mem_probe.py:

  • mem_avail_bytes must call the shared probe and must not have #else return 0
  • serve_hwinfo must call compat_meminfo_gb
  • on Windows, if the old branch is still present, fail with this host's free RAM (13 GB here)

tests/test_inkling_cache_index.c (CI make test-c) asserts mem_avail_bytes() is > 0 and within 0.25 GB of the shared probe.

Fail-before on unfixed dev:

AssertionError: 'compat_mem_available_gb' not found in mem_avail_bytes
AssertionError: mem_avail_bytes() returns 0 on Windows; this host has 13.2 GB free, so auto cap would stay at 16 experts/layer

Validation

  • Targeted: python -m unittest tests.test_inkling_mem_probe fails on unfixed dev, passes after
  • Baseline: tests.test_resource_plan tests.test_env_defaults tests.test_inkling_mem_probe -- 106 OK
  • make -C c check -- local Windows host has no gcc/make; the Python pin is the gate here. test_inkling_cache_index is already in TEST_BINS.
  • CUDA changes were tested with make -C c cuda-test (not applicable)
  • Performance claims: none

Compatibility

  • The default CPU build remains dependency-free
  • No model files, generated binaries, or benchmark artifacts are included

AI-assisted (Grok)

Windows took mem_avail_bytes()'s #else return 0 branch, so coli serve
with no --cap always used 16 experts/layer and /health reported 0.0 GB.
Use the shared probe (compat_mem_available_gb / compat_meminfo_gb).
@JustVugg
JustVugg merged commit a8de807 into JustVugg:dev Sep 24, 2026
29 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.

2 participants