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
0de1a449
Commit
0de1a449
authored
Sep 17, 2022
by
justheuristic
Browse files
change order
parent
e9b87112
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
bitsandbytes/autograd/_functions.py
bitsandbytes/autograd/_functions.py
+5
-5
No files found.
bitsandbytes/autograd/_functions.py
View file @
0de1a449
...
@@ -357,6 +357,11 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -357,6 +357,11 @@ class MatMul8bitLt(torch.autograd.Function):
SCAt
,
idx
=
ctx
.
tensor_states
SCAt
,
idx
=
ctx
.
tensor_states
formatB
=
ctx
.
formatB
formatB
=
ctx
.
formatB
state
=
ctx
.
state
state
=
ctx
.
state
grad_A
=
grad_B
=
grad_bias
=
None
if
req_gradBias
:
# compute grad_bias first before changing grad_output dtype
grad_bias
=
grad_output
.
sum
(
0
)
# Cast grad_output to fp16
# Cast grad_output to fp16
grad_output_dtype
=
grad_output
.
dtype
grad_output_dtype
=
grad_output
.
dtype
...
@@ -367,8 +372,6 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -367,8 +372,6 @@ class MatMul8bitLt(torch.autograd.Function):
-
1
,
grad_output
.
shape
[
-
1
]
-
1
,
grad_output
.
shape
[
-
1
]
).
contiguous
()
).
contiguous
()
grad_A
=
grad_B
=
grad_bias
=
None
Cgrad
,
Cgradt
,
SCgrad
,
SCgradt
,
coo_tensor
=
F
.
double_quant
(
grad_output
)
Cgrad
,
Cgradt
,
SCgrad
,
SCgradt
,
coo_tensor
=
F
.
double_quant
(
grad_output
)
if
req_gradB
:
if
req_gradB
:
CxAt
,
SAt
=
F
.
transform
(
CAt
,
formatB
,
transpose
=
True
)
CxAt
,
SAt
=
F
.
transform
(
CAt
,
formatB
,
transpose
=
True
)
...
@@ -395,9 +398,6 @@ class MatMul8bitLt(torch.autograd.Function):
...
@@ -395,9 +398,6 @@ class MatMul8bitLt(torch.autograd.Function):
else
:
else
:
raise
Exception
(
'State must contain either CBt or CB matrix for backward'
)
raise
Exception
(
'State must contain either CBt or CB matrix for backward'
)
if
req_gradBias
:
grad_bias
=
grad_output
.
sum
(
0
)
# Cast grad_A back to grad_output_dtype
# Cast grad_A back to grad_output_dtype
grad_output
=
grad_output
.
to
(
grad_output_dtype
)
grad_output
=
grad_output
.
to
(
grad_output_dtype
)
...
...
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