Conversation
vivekgoe
suggested changes
May 29, 2025
bitsandbytes/backends/utils.py
Outdated
| CODE = {"nf4": _NF4_QUANT_TABLE, "fp4": _FP4_QUANT_TABLE} | ||
|
|
||
|
|
||
| def get_habana_frameworks_version(): |
There was a problem hiding this comment.
Maybe better to change this to "get_gaudi_sw_version".
bitsandbytes/backends/utils.py
Outdated
|
|
||
| def get_habana_frameworks_version(): | ||
| """ | ||
| Returns the installed version of SynapseAI. |
There was a problem hiding this comment.
Returns the installed version of Gaudi SW.
bitsandbytes/backends/utils.py
Outdated
| return version.parse(output.stdout.split("\n")[0].split()[-1]) | ||
|
|
||
|
|
||
| HABANA_VERSION = get_habana_frameworks_version() |
There was a problem hiding this comment.
Replace HABANA_VERSION by GAUDI_SW_VER
bitsandbytes/backends/hpu/ops.py
Outdated
| ) -> torch.Tensor: | ||
| torch._check_is_size(blocksize) | ||
| torch._check(quant_type == "nf4", lambda: f"quant_type must be nf4 or fp4, got {quant_type}") | ||
| torch._check(dtype == torch.bfloat16, lambda: f"4bit dequantization only supports bf16, but got {dtype}") |
There was a problem hiding this comment.
We support torch.float32 also, better to include that also in this check).
| if torch.xpu.is_available(): | ||
| from .backends.xpu import ops as xpu_ops | ||
|
|
||
| if hasattr(torch, "hpu") and torch.hpu.is_available(): |
There was a problem hiding this comment.
In Line-29 above, can we make it "Intel Gaudi".
vivekgoe
approved these changes
May 29, 2025
9fb71c1 to
068f0e1
Compare
updates the assertion message Co-authored-by: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com>
Co-authored-by: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com>
Fix lint issue
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.
This PR enables the support of bitsandbytes for HPU (Intel Gaudi) devices.
These changes add support for single and double NF4 quantization/dequantization using Intel Gaudi hardware.