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
1145589f
"git@developer.sourcefind.cn:OpenDAS/bitsandbytes.git" did not exist on "32a9a88f987e26c5b891ce1f881f008307b4548c"
Commit
1145589f
authored
Sep 18, 2022
by
justheuristic
Browse files
change typecast behavior
parent
d6e25b5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
bitsandbytes/autograd/_functions.py
bitsandbytes/autograd/_functions.py
+1
-2
No files found.
bitsandbytes/autograd/_functions.py
View file @
1145589f
...
@@ -328,7 +328,6 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -328,7 +328,6 @@ class MatMul8bitLt(torch.autograd.Function):
ctx
.
formatB
=
formatB
ctx
.
formatB
=
formatB
ctx
.
grad_shape
=
input_shape
ctx
.
grad_shape
=
input_shape
ctx
.
req_grads
=
[
requires_gradA
,
requires_gradB
,
requires_gradBias
]
ctx
.
dtype_A
,
ctx
.
dtype_B
,
ctx
.
dtype_bias
=
A
.
dtype
,
B
.
dtype
,
None
if
bias
is
None
else
bias
.
dtype
ctx
.
dtype_A
,
ctx
.
dtype_B
,
ctx
.
dtype_bias
=
A
.
dtype
,
B
.
dtype
,
None
if
bias
is
None
else
bias
.
dtype
if
requires_gradA
or
requires_gradB
:
if
requires_gradA
or
requires_gradB
:
...
@@ -357,7 +356,7 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -357,7 +356,7 @@ class MatMul8bitLt(torch.autograd.Function):
if
req_gradBias
:
if
req_gradBias
:
# compute grad_bias first before changing grad_output dtype
# compute grad_bias first before changing grad_output dtype
grad_bias
=
grad_output
.
sum
(
0
).
to
(
ctx
.
bias_
dtype
)
grad_bias
=
grad_output
.
sum
(
0
).
to
(
ctx
.
dtype
_bias
)
# Cast grad_output to fp16
# Cast grad_output to fp16
if
len
(
grad_output
.
shape
)
==
3
:
if
len
(
grad_output
.
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