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
cd4d904a
Commit
cd4d904a
authored
Feb 25, 2023
by
Max Ryabinin
Browse files
Raise an error when loading a quantized checkpoint before quantization
parent
ac3ab281
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
bitsandbytes/nn/modules.py
bitsandbytes/nn/modules.py
+5
-0
No files found.
bitsandbytes/nn/modules.py
View file @
cd4d904a
...
...
@@ -248,6 +248,11 @@ class Linear8bitLt(nn.Linear):
for
key
in
unexpected_keys
:
input_name
=
key
[
len
(
prefix
):]
if
input_name
==
"SCB"
:
if
self
.
weight
.
SCB
is
None
:
# buffers not yet initialized, can't call them directly without
raise
RuntimeError
(
"Loading a quantized checkpoint into non-quantized Linear8bitLt is "
"not supported. Please call module.cuda() before module.load_state_dict()"
)
input_param
=
state_dict
[
key
]
self
.
weight
.
SCB
.
copy_
(
input_param
)
unexpected_keys
.
remove
(
key
)
...
...
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