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
4e4668ab
Unverified
Commit
4e4668ab
authored
Sep 05, 2022
by
Tim Dettmers
Committed by
GitHub
Sep 05, 2022
Browse files
Merge pull request #13 from chessgecko/patch-1
fix param name
parents
9d60b3c5
e4e13db8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
README.md
README.md
+3
-3
No files found.
README.md
View file @
4e4668ab
...
@@ -23,12 +23,12 @@ Resources:
...
@@ -23,12 +23,12 @@ Resources:
1.
Comment out torch.nn.Linear:
``#linear = torch.nn.Linear(...)``
1.
Comment out torch.nn.Linear:
``#linear = torch.nn.Linear(...)``
2.
Add bnb 8-bit linear light module:
``linear = bnb.nn.Linear8bitLt(...)``
(base arguments stay the same)
2.
Add bnb 8-bit linear light module:
``linear = bnb.nn.Linear8bitLt(...)``
(base arguments stay the same)
3.
There are two modes:
3.
There are two modes:
-
Mixed 8-bit training with 16-bit main weights. Pass the argument
``
use
_fp16_weights=True``
(default)
-
Mixed 8-bit training with 16-bit main weights. Pass the argument
``
has
_fp16_weights=True``
(default)
-
Int8 inference. Pass the argument
``
use
_fp16_weights=False``
-
Int8 inference. Pass the argument
``
has
_fp16_weights=False``
4.
To use the full LLM.int8() method, use the
``threshold=k``
argument. We recommend
``k=6.0``
.
4.
To use the full LLM.int8() method, use the
``threshold=k``
argument. We recommend
``k=6.0``
.
```
python
```
python
# LLM.int8()
# LLM.int8()
linear
=
bnb
.
nn
.
Linear8bitLt
(
dim1
,
dim2
,
bias
=
True
,
use
_fp16_weights
=
False
,
threshold
=
6.0
)
linear
=
bnb
.
nn
.
Linear8bitLt
(
dim1
,
dim2
,
bias
=
True
,
has
_fp16_weights
=
False
,
threshold
=
6.0
)
# inputs need to be fp16
# inputs need to be fp16
out
=
linear
(
x
.
to
(
torch
.
float16
))
out
=
linear
(
x
.
to
(
torch
.
float16
))
```
```
...
...
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