build: cleanup unused metal build code#2004
Merged
Merged
Conversation
|
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. |
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>
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.
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.