Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
B
Basedformer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Basedformer
Commits
a564d1bb
Commit
a564d1bb
authored
Mar 08, 2022
by
novelailab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change some stuff
parent
676d36ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
9 deletions
+7
-9
cudagraph.py
cudagraph.py
+2
-2
main.py
main.py
+5
-4
test_pyfra.py
test_pyfra.py
+0
-3
No files found.
cudagraph.py
View file @
a564d1bb
...
@@ -65,8 +65,8 @@ def test_thing(graph, input):
...
@@ -65,8 +65,8 @@ def test_thing(graph, input):
torch
.
cuda
.
synchronize
()
torch
.
cuda
.
synchronize
()
with
torch
.
no_grad
():
with
torch
.
no_grad
():
model
=
init_
1_3
b
()
.
cuda
()
.
half
()
model
=
init_
6
b
()
.
cuda
()
.
half
()
shape
=
(
1
,
256
)
shape
=
(
1
,
1
)
x
=
torch
.
zeros
(
shape
)
.
cuda
()
.
long
()
x
=
torch
.
zeros
(
shape
)
.
cuda
()
.
long
()
print
(
shape
)
print
(
shape
)
print
(
"PyTorch Eager"
)
print
(
"PyTorch Eager"
)
...
...
main.py
View file @
a564d1bb
...
@@ -225,12 +225,13 @@ class GPTLayer(nn.Module):
...
@@ -225,12 +225,13 @@ class GPTLayer(nn.Module):
def
forward
(
self
,
x
,
hypernetwork
):
def
forward
(
self
,
x
,
hypernetwork
):
residual
=
x
residual
=
x
x
=
self
.
ln_preattn
(
x
)
x
=
self
.
ln_preattn
(
x
)
if
hypernetwork
:
hyper_out
=
hypernetwork
(
x
)
attn_out
=
self
.
attn
(
x
)
attn_out
=
self
.
attn
(
x
)
ff_out
=
self
.
ff
(
x
)
ff_out
=
self
.
ff
(
x
)
x
=
residual
+
ff_out
+
attn_out
# + (hyper_out if hypernetwork is not None else 0)
x
=
residual
+
ff_out
+
attn_out
if
hypernetwork
:
hyper_out
=
hypernetwork
(
x
)
x
=
x
+
hyper_out
return
x
return
x
# Can access and change every module from here, as both Layer class and ff and attn classes are passed from GPTModel.
# Can access and change every module from here, as both Layer class and ff and attn classes are passed from GPTModel.
...
...
test_pyfra.py
View file @
a564d1bb
...
@@ -18,9 +18,6 @@ config_obj.create_service(overwrite=True)
...
@@ -18,9 +18,6 @@ config_obj.create_service(overwrite=True)
remote
=
config_obj
.
get_pyfra_remote
()
remote
=
config_obj
.
get_pyfra_remote
()
env1
=
remote
.
env
(
'noname'
,
python_version
=
None
)
env1
=
remote
.
env
(
'noname'
,
python_version
=
None
)
models
=
{
'6b'
:
'/home/xuser/models/j6b_ckpt_14001'
,
'20b'
:
'/home/xuser/diffusionstorage/models/20B_136500.hf'
,
'13b'
:
'/home/xuser/diffusionstorage/workspace/finetune/pokepls/bigmodel'
}
path
=
env1
.
path
(
'/home/xuser/diffusionstorage/workspace/kuru/basedformer'
)
path
=
env1
.
path
(
'/home/xuser/diffusionstorage/workspace/kuru/basedformer'
)
env1
.
sh
(
'pip install /home/xuser/hugessd/pytorch/torch-1.10.1+cu113-cp38-cp38-linux_x86_64.whl'
)
env1
.
sh
(
'pip install /home/xuser/hugessd/pytorch/torch-1.10.1+cu113-cp38-cp38-linux_x86_64.whl'
)
env1
.
sh
(
'pip install einops numpy'
)
env1
.
sh
(
'pip install einops numpy'
)
...
...
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