Repository navigation
Fix: Regression - LAMB8bit and LARS8bit fail on the first CUDA step in all version bitsandbytes >0.49.2 - #2151
Open
SIDDARTHAREDDY8 wants to merge 1 commit into
Conversation
…se dispatch table (bitsandbytes-foundation#2150) Signed-off-by: SIDDARTHA REDDY <75976672+SIDDARTHAREDDY8@users.noreply.github.com> Signed-off-by: Siddartha Reddy Chinthala <siddarthareddychinthala@gmail.com>
SIDDARTHAREDDY8
force-pushed
the
oss-bhai-2026-11-20-p1
branch
from
November 20, 2026 20:15
5a1c5be to
18e45a9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2150.
Fix for bitsandbytes-foundation/bitsandbytes issue #2150 (LAMB8bit/LARS8bit fail on the first CUDA step with 'Unsupported optimizer name: lamb/lars'). Collision check clean before building: 0 body-ref PRs, 0 title-similar PRs, empty timeline (no cross-referenced PR). Root cause confirmed: str2optimizer8bit_blockwise in bitsandbytes/backends/cuda/ops.py had no 'lamb' or 'lars' entry, while the 32-bit CUDA table, the CPU backend, and the Triton backend all alias lamb->adam kernels and lars->momentum kernels (LAMB is Adam-based/2-state, LARS is momentum-based/1-state; LAMB8bit's own docstring anticipates the 8-bit blockwise update). Fix adds both entries to the CUDA table, reusing the existing cadam_8bit_blockwise_grad_* and cmomentum_8bit_blockwise_grad_* kernels (fp32/fp16/bf16) — no new C code needed. Added regression test test_lamb_lars_8bit_blockwise_step in tests/test_optim.py (4096-element param = default min_8bit_size cutoff; asserts step() completes, the parameter changes, and state1/state2 stay uint8). Branch oss-bhai-2026-11-20-p1 pushed to SIDDARTHAREDDY8/bitsandbytes at commit 5a1c5be on base main (a616886); pushed files verified byte-identical to local. No PR opened (reviewer gates that).
Tests could not be run in this environment: Repo test suite could NOT run here: no CUDA/GPU in this environment (torch 2.14.0+cpu, torch.cuda.is_available()=False) and bitsandbytes is not installed (needs the compiled C extension). Instead ran verify_fix.py (in the run workdir): 16/16 checks passed — it executes the edited dispatch dict with a stub lib and replays the _optimizer_update_8bit_blockwise_impl lookup, proving 'lamb'/'lars' resolve to the adam/momentum blockwise kernels, that no new C symbols are introduced, and that the pre-fix table raises exactly the reported ValueError; it also checks the new regression test's presence/content. Both changed files pass py_compile. Live CUDA verification of .step() is left to CI.