Skip to content
Merged
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
9 changes: 8 additions & 1 deletion bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ def get_inverse_transform_indices(
return permuted_tile_indices


# torch.compiler.is_compiling() is available only in torch >= 2.3
if hasattr(torch.compiler, "is_compiling"):
_is_compiling = torch.compiler.is_compiling
else:
_is_compiling = torch._dynamo.is_compiling


@deprecated(
"This function is deprecated and will be removed in a future release.",
category=FutureWarning,
Expand Down Expand Up @@ -174,7 +181,7 @@ def forward(
input_shape = A.shape

# Cast A to fp16
if A.dtype != torch.float16:
if A.dtype != torch.float16 and not _is_compiling():
warnings.warn(f"MatMul8bitLt: inputs will be cast from {A.dtype} to float16 during quantization")

if len(A.shape) == 3:
Expand Down