Skip to content

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
bitsandbytes-foundation:mainfrom
SIDDARTHAREDDY8:oss-bhai-2026-11-20-p1
Open

SIDDARTHAREDDY8 wants to merge 1 commit into
bitsandbytes-foundation:mainfrom
SIDDARTHAREDDY8:oss-bhai-2026-11-20-p1

Conversation

@SIDDARTHAREDDY8

Copy link
Copy Markdown

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.

…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>

This branch has not been deployed

No deployments
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.

Regression - LAMB8bit and LARS8bit fail on the first CUDA step in all version bitsandbytes >0.49.2

1 participant