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
OpenFold
Commits
bebbe782
Commit
bebbe782
authored
Jun 11, 2022
by
Gustaf Ahdritz
Browse files
Speed up inference
parent
6e66b218
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
openfold/model/model.py
openfold/model/model.py
+3
-2
openfold/model/template.py
openfold/model/template.py
+5
-2
No files found.
openfold/model/model.py
View file @
bebbe782
...
...
@@ -177,7 +177,6 @@ class AlphaFold(nn.Module):
t
,
z
,
template_mask
=
batch
[
"template_mask"
].
to
(
dtype
=
z
.
dtype
),
chunk_size
=
self
.
globals
.
chunk_size
,
use_lma
=
self
.
globals
.
use_lma
,
)
...
...
@@ -199,6 +198,8 @@ class AlphaFold(nn.Module):
ret
.
update
({
"template_pair_embedding"
:
t
})
del
t
return
ret
def
iteration
(
self
,
feats
,
prevs
,
_recycle
=
True
):
...
...
openfold/model/template.py
View file @
bebbe782
...
...
@@ -102,7 +102,8 @@ class TemplatePointwiseAttention(nn.Module):
t
:
torch
.
Tensor
,
z
:
torch
.
Tensor
,
template_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
chunk_size
:
Optional
[
int
]
=
None
,
# This module suffers greatly from a small chunk size
chunk_size
:
Optional
[
int
]
=
256
,
use_lma
:
bool
=
False
,
)
->
torch
.
Tensor
:
"""
...
...
@@ -216,6 +217,7 @@ class TemplatePairStackBlock(nn.Module):
single
,
chunk_size
=
chunk_size
,
mask
=
single_mask
,
use_memory_efficient_kernel
=
not
use_lma
,
use_lma
=
use_lma
,
)
),
...
...
@@ -228,6 +230,7 @@ class TemplatePairStackBlock(nn.Module):
single
,
chunk_size
=
chunk_size
,
mask
=
single_mask
,
use_memory_efficient_kernel
=
not
use_lma
,
use_lma
=
use_lma
,
)
),
...
...
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