Skip to content

fix(gpu): remove "cpu" gpu_type branch from persona/allocator - #999

Merged
joelteply merged 1 commit into
canaryfrom
mac/gpu-fallback-removal-persona-allocator
May 2, 2026
Merged

joelteply merged 1 commit into
canaryfrom
mac/gpu-fallback-removal-persona-allocator

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

GPU-fallback audit follow-up to #998. Removes the "cpu" branch from detect_gpu_type — unreachable post-#998 since memory_manager panics on no-GPU. Tests updated.

🤖 Generated with Claude Code

…gpu_type

Per #964-series GPU-fallback audit + Joel's "lack of GPU integration is
forbidden" rule. PR #998 made memory_manager::detect_gpu() panic when
no GPU is found, so a "cpu" gpu_name can never reach detect_gpu_type
in production. Removing the branch cleans up the dead path.

If somehow a "cpu" gpu_name still arrives (e.g. a test stub), it now
falls back to the OS-default GPU type ("metal" on Mac, "cuda" on
Linux) — a best-guess that lets the caller proceed against a real GPU
subsystem rather than configuring a non-existent "cpu" subsystem that
no inference path actually serves.

Test updated:
  - assert_eq!(detect_gpu_type("CPU"), "cpu") removed
  - replaced with cfg-gated assertions matching new OS-default behaviour
  - real GPU detections (NVIDIA, Apple M-series) unchanged

cargo test --features metal,accelerate --lib persona::allocator::
tests::test_detect_gpu_type: PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 0dfb672 into canary May 2, 2026
3 checks passed
@joelteply
joelteply deleted the mac/gpu-fallback-removal-persona-allocator branch May 2, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant