Skip to content

recommend(): host-RAM-aware pin decision#42

Merged
TroyHernandez merged 3 commits into
mainfrom
feat/recommend-pin
Jul 22, 2026
Merged

recommend(): host-RAM-aware pin decision#42
TroyHernandez merged 3 commits into
mainfrom
feat/recommend-pin

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Extends the pure policy engine with the pinning axis. recommend() now returns pin, pinned_set_gb, and host_ram_gb alongside the precision/device recommendation.

Policy: phase-swapped weights are page-locked host copies that transfer at DMA rate (25 GB/s measured), but pinned pages are unswappable — on small-RAM machines they turn memory pressure into OOM kills. So pin = TRUE only when available host RAM (Linux MemAvailable; NA elsewhere) covers the model's estimated pinned set twice over; FALSE below that; FALSE on the cpu tier (nothing stages); TRUE when RAM is undetectable, since page-locking already fails soft per component and /proc-less platforms rarely pair with CUDA.

Pinned-set estimates are coarse artifact-scale numbers per model+precision (quantized checkpoint + text-encoder host copy) — the decision needs the order of magnitude, not the byte.

Also corrects stale CLAUDE.md prose claiming auto-device configuration requires gpuctl: auto_devices() and recommend() are self-contained (nvidia-smi + /proc), with no gpuctl reference anywhere in code or DESCRIPTION.

Tests: 26 new results in test_recommend.R (80 total green) — large-RAM pin, small-RAM refusal, cpu-tier FALSE, NA fail-soft, detection helper, unknown-tier fallback.

@TroyHernandez
TroyHernandez merged commit f8711dc into main Jul 22, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the feat/recommend-pin branch July 22, 2026 21:43
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