fix: pass backend="cpu" when requesting CPU gemm_4bit_forward kernel - #2090
Open
SIDDARTHAREDDY8 wants to merge 1 commit into
Open
SIDDARTHAREDDY8 wants to merge 1 commit into
SIDDARTHAREDDY8 wants to merge 1 commit into
Conversation
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 #2064.
Summary
bitsandbytes/backends/cpu/ops.pyrequested the fused CPU 4-bit GEMM kernel from kernels-community/quantization-bitsandbytes viaget_kernel(...)without abackendargument. Thekernelspackage infers the backend from the installed torch build, so on any CUDA torch build the inferred backend is CUDA, every CPU-only build variant is rejected, andget_kernelraises at every process start on hosts with AVX512-BF16 (logged as a warning by the best-effort fallback handler). This one-line change passesbackend="cpu"explicitly so the CPU build variant is selected regardless of the torch build.Test notes
get_kernelaccepts abackendkwarg against thekernelslibrary source (huggingface/kernels, load.py): "The backend to load the kernel for. Can only becpuor the backend that Torch is compiled for."kernels.get_kernel: it now callsget_kernel(repo, version=1, backend="cpu").get_kernel(REPO, version=1, backend="cpu")loads the CPU build variant cleanly where the inferred call fails.cpu), and thekernelspackage is not installed.py_compilepasses.