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
text-generation-inference
Commits
ce960be0
Unverified
Commit
ce960be0
authored
Jan 26, 2023
by
OlivierDehaene
Committed by
GitHub
Jan 26, 2023
Browse files
feat(bloom): use torch.nn.Linear and torch.nn.GELU (#33)
parent
13e7044a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
server/text_generation/models/bloom.py
server/text_generation/models/bloom.py
+1
-3
No files found.
server/text_generation/models/bloom.py
View file @
ce960be0
...
@@ -136,7 +136,6 @@ class BLOOMSharded(BLOOM):
...
@@ -136,7 +136,6 @@ class BLOOMSharded(BLOOM):
start
=
rank
*
block_size
start
=
rank
*
block_size
stop
=
(
rank
+
1
)
*
block_size
stop
=
(
rank
+
1
)
*
block_size
tensor
=
slice_
[
start
:
stop
]
tensor
=
slice_
[
start
:
stop
]
tensor
=
tensor
.
transpose
(
1
,
0
)
else
:
else
:
size
=
slice_
.
get_shape
()[
0
]
size
=
slice_
.
get_shape
()[
0
]
block_size
=
size
//
world_size
block_size
=
size
//
world_size
...
@@ -150,7 +149,6 @@ class BLOOMSharded(BLOOM):
...
@@ -150,7 +149,6 @@ class BLOOMSharded(BLOOM):
start
=
rank
*
block_size
start
=
rank
*
block_size
stop
=
(
rank
+
1
)
*
block_size
stop
=
(
rank
+
1
)
*
block_size
tensor
=
slice_
[:,
start
:
stop
]
tensor
=
slice_
[:,
start
:
stop
]
tensor
=
tensor
.
transpose
(
1
,
0
)
else
:
else
:
tensor
=
slice_
[:]
tensor
=
slice_
[:]
# XXX: Hack for Rowlinear to add the bias only once.
# XXX: Hack for Rowlinear to add the bias only once.
...
@@ -186,7 +184,7 @@ class BLOOMSharded(BLOOM):
...
@@ -186,7 +184,7 @@ class BLOOMSharded(BLOOM):
and
param_name
==
"weight"
and
param_name
==
"weight"
):
):
tensor
=
Int8Params
(
tensor
=
Int8Params
(
tensor
.
transpose
(
1
,
0
)
,
tensor
,
has_fp16_weights
=
False
,
has_fp16_weights
=
False
,
requires_grad
=
False
,
requires_grad
=
False
,
).
to
(
device
)
).
to
(
device
)
...
...
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