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
ColossalAI
Commits
71e72c48
Commit
71e72c48
authored
Jan 05, 2023
by
oahzxl
Browse files
last version of benchmark
parent
55cb713f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
autochunk_benchmark.py
autochunk_benchmark.py
+6
-4
No files found.
autochunk_benchmark.py
View file @
71e72c48
...
@@ -93,22 +93,24 @@ def _build_openfold():
...
@@ -93,22 +93,24 @@ def _build_openfold():
def
benchmark_evoformer
():
def
benchmark_evoformer
():
# init data and model
# init data and model
msa_len
=
300
msa_len
=
256
pair_len
=
800
pair_len
=
2048
node
=
torch
.
randn
(
1
,
msa_len
,
pair_len
,
256
).
cuda
()
node
=
torch
.
randn
(
1
,
msa_len
,
pair_len
,
256
).
cuda
()
pair
=
torch
.
randn
(
1
,
pair_len
,
pair_len
,
128
).
cuda
()
pair
=
torch
.
randn
(
1
,
pair_len
,
pair_len
,
128
).
cuda
()
model
=
evoformer_base
().
cuda
()
model
=
evoformer_base
().
cuda
()
# build autochunk model
# build autochunk model
max_memory
=
3000
# MB
max_memory
=
10000
# MB fit memory mode
# max_memory = None # min memory mode
autochunk
=
_build_autochunk
(
evoformer_base
().
cuda
(),
max_memory
,
node
,
pair
)
autochunk
=
_build_autochunk
(
evoformer_base
().
cuda
(),
max_memory
,
node
,
pair
)
# build openfold
# build openfold
chunk_size
=
64
openfold
=
_build_openfold
()
openfold
=
_build_openfold
()
# benchmark
# benchmark
_benchmark_evoformer
(
model
,
node
,
pair
,
"base"
)
_benchmark_evoformer
(
model
,
node
,
pair
,
"base"
)
_benchmark_evoformer
(
openfold
,
node
,
pair
,
"openfold"
,
chunk_size
=
4
)
_benchmark_evoformer
(
openfold
,
node
,
pair
,
"openfold"
,
chunk_size
=
chunk_size
)
_benchmark_evoformer
(
autochunk
,
node
,
pair
,
"autochunk"
)
_benchmark_evoformer
(
autochunk
,
node
,
pair
,
"autochunk"
)
...
...
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