Skip to content

build: cleanup unused metal build code#2004

Merged
matthewdouglas merged 1 commit into
mainfrom
metal-cleanup
Jul 15, 2026
Merged

build: cleanup unused metal build code#2004
matthewdouglas merged 1 commit into
mainfrom
metal-cleanup

Conversation

@matthewdouglas

Copy link
Copy Markdown
Member

Currently the Metal backend loads kernels from Hugging Face Hub and/or uses ops implemented in pure PyTorch + torch.compile.

As we do not build or ship a native metallib at the moment, this PR removes the stale prototype code. Not user facing.

@github-actions

Copy link
Copy Markdown

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.

@matthewdouglas matthewdouglas merged commit b4057b8 into main Jul 15, 2026
128 checks passed
@matthewdouglas matthewdouglas deleted the metal-cleanup branch July 15, 2026 20:34
eaglstun added a commit to eaglstun/bitsandbytes that referenced this pull request Jul 15, 2026
Brings in 6 upstream commits (through bitsandbytes-foundation#2004). Conflict resolutions:

- csrc/mps_kernels.metal, csrc/mps_ops.mm: upstream bitsandbytes-foundation#2004 DELETED these as
  'unused metal build code' (they were stubs upstream); the fork built them into
  the real MPS port. Kept the fork's versions (rejected the deletion).
- CMakeLists.txt: bitsandbytes-foundation#2004 removed upstream's stub metal build. Restored the fork's
  full MPS build support that the auto-merge dropped: the COMPUTE_BACKEND=mps ->
  BUILD_MPS selection branch, set(MPS_FILES)/set(METAL_FILES), and the late
  if(BUILD_MPS) framework-linking + add_dependencies(metallib) block. Verified a
  clean MPS build produces the metallib + _mps.dylib.
- bitsandbytes/backends/default/ops.py: dropped the stale Lion NOTE (claimed CUDA
  and Triton still had the coupled-decay bug -- all three are now fixed on this
  fork); took upstream's cleaner version. The decoupled-decay code is unchanged.
- tests/test_optim.py: kept the fork's test_lion8bit_blockwise_weight_decay
  alongside upstream's test_lion32bit_weight_decay.
- csrc/pythonInterface.cpp: took upstream's removal of a commented-out dead
  #include (fork's MPS loads via dladdr, doesn't use it).

Verified on the merged tree: MPS builds, tests/test_mps_parity.py 329 passed
under BNB_MPS_REQUIRE_NATIVE=1 (bit-exact quant/dequant + native matmul intact).
Pre-existing paged_lion-on-mps test_optim failures are unchanged (paging is
CUDA-only; identical on fork main pre-merge).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant