Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ def matmul_4bit(
out: Optional[torch.Tensor] = None,
bias: Optional[torch.Tensor] = None,
):
assert quant_state is not None
if quant_state is None:
raise ValueError("quant_state cannot be None")
# Change dtype to input dtype on CPU
if A.device.type == "cpu":
quant_state.dtype = A.dtype
Expand Down
3 changes: 2 additions & 1 deletion bitsandbytes/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,8 @@ def dequantize_blockwise(
The dequantized tensor. The datatype is indicated by `quant_state.dtype` and defaults to `torch.float32`.
"""

assert quant_state is not None or absmax is not None
if quant_state is None and absmax is None:
raise ValueError("Either quant_state or absmax must be provided")
if code is None and quant_state is None:
if "dynamic" not in name2qmap:
name2qmap["dynamic"] = create_dynamic_map().to(A.device)
Expand Down