Repository navigation
Conversation
…ed memory Paged optimizers only degraded gracefully on CPU. On MPS (and any other device whose native library lacks cget_managed_ptr) they reached F.get_paged and failed with "Method 'cget_managed_ptr' not available in CPU-only version of bitsandbytes". Generalize the fallback in Optimizer8bit.get_state_buffer to every device type other than cuda/xpu, which are the two with managed-memory support, and name the device in the one-time warning. Tests: the paged_* skip in test_optimizer32bit now covers all non-paging devices, and a new test checks the fallback warns once and keeps a regular state tensor. Ref bitsandbytes-foundation#2011 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks for the PR. Given that paged optimizers are only actually supported on CUDA/ROCm/XPU, it seems superfluous. But considering we'd later implement optimizers for MPS or fallback, I suppose it's reasonable in that respect. With that said, the extra test for regression against previous behavior, literally saying "previously" in the comments, IMHO seems just unnecessary. I do not understand why the agents love adding these pointless tests so much, but please remove that. |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Per review feedback on bitsandbytes-foundation#2069. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Removed the test, and dropped a now-stale reference to it from the skip message. The remaining test change is just widening the existing |
|
@matthewdouglas, I’ve pushed 80a30b6 to cover a missed allocation path: large Refreshed validation on Apple M5/macOS 26.0, PyTorch 2.12.1 and 2.15.0, with the patch applied to current main (
CUDA/ROCm/XPU hardware was unavailable locally; MPS 8-bit checks cover allocation only. The fresh PR Tests, Lint, Python package, and documentation workflows are awaiting approval. Could you approve those runs and review the updated PR? The description now includes the fix and validation details. |
Paged optimizers on MPS could reach
cget_managed_ptrand fail with a CPU-library error instead of allocating regular state buffers. AdEMAMix's separate double-buffer allocator also bypassed the fallback on both CPU and MPS for parameters with at least 100,000 elements.Both allocation paths now use regular tensors on devices outside CUDA/ROCm/XPU, with the existing once-per-optimizer warning naming the device. CUDA/ROCm/XPU keep the managed-memory path. The existing
test_optimizer32bitpaged-case skip is widened to non-paging devices; the extra regression test was removed as requested.Validation on Apple M5/macOS 26.0, Python 3.12.13, both PyTorch 2.12.1 and 2.15.0, with this patch applied to current main (
a616886):git diff --checkpass. The local validation scripts are kept outside the PR test suite.CUDA/ROCm/XPU hardware was unavailable locally. Upstream CI remains required: the previous PR Tests run expired while awaiting maintainer approval. This change does not implement MPS 8-bit optimizers.
Ref #2011.
🤖 Generated with Claude Code; follow-up fix and validation assisted by Codex.