Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
49609323
Unverified
Commit
49609323
authored
Apr 01, 2025
by
Matthew Douglas
Committed by
GitHub
Apr 01, 2025
Browse files
Fix torch.compile issue for LLM.int8() with threshold=0 (#1581)
parent
90bbe147
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
bitsandbytes/autograd/_functions.py
bitsandbytes/autograd/_functions.py
+8
-1
No files found.
bitsandbytes/autograd/_functions.py
View file @
49609323
...
@@ -84,6 +84,13 @@ def get_inverse_transform_indices(
...
@@ -84,6 +84,13 @@ def get_inverse_transform_indices(
return
permuted_tile_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
(
@
deprecated
(
"This function is deprecated and will be removed in a future release."
,
"This function is deprecated and will be removed in a future release."
,
category
=
FutureWarning
,
category
=
FutureWarning
,
...
@@ -174,7 +181,7 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -174,7 +181,7 @@ class MatMul8bitLt(torch.autograd.Function):
input_shape
=
A
.
shape
input_shape
=
A
.
shape
# Cast A to fp16
# 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"
)
warnings
.
warn
(
f
"MatMul8bitLt: inputs will be cast from
{
A
.
dtype
}
to float16 during quantization"
)
if
len
(
A
.
shape
)
==
3
:
if
len
(
A
.
shape
)
==
3
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment