fullFold 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fullfold-0.1.0/LICENSE +201 -0
- fullfold-0.1.0/PKG-INFO +193 -0
- fullfold-0.1.0/README.md +173 -0
- fullfold-0.1.0/pyproject.toml +39 -0
- fullfold-0.1.0/setup.cfg +4 -0
- fullfold-0.1.0/src/fullFold/__init__.py +3 -0
- fullfold-0.1.0/src/fullFold/__main__.py +4 -0
- fullfold-0.1.0/src/fullFold/banner.py +20 -0
- fullfold-0.1.0/src/fullFold/benchmark.py +232 -0
- fullfold-0.1.0/src/fullFold/cli.py +103 -0
- fullfold-0.1.0/src/fullFold/config.py +148 -0
- fullfold-0.1.0/src/fullFold/data/reference_timings.csv +312 -0
- fullfold-0.1.0/src/fullFold/engine.py +476 -0
- fullfold-0.1.0/src/fullFold/jobs.py +186 -0
- fullfold-0.1.0/src/fullFold/runner.py +118 -0
- fullfold-0.1.0/src/fullFold/scheduling.py +506 -0
- fullfold-0.1.0/src/fullFold/templates.py +233 -0
- fullfold-0.1.0/src/fullFold/tokens.py +155 -0
- fullfold-0.1.0/src/fullFold/worker.py +615 -0
- fullfold-0.1.0/src/fullFold.egg-info/PKG-INFO +193 -0
- fullfold-0.1.0/src/fullFold.egg-info/SOURCES.txt +23 -0
- fullfold-0.1.0/src/fullFold.egg-info/dependency_links.txt +1 -0
- fullfold-0.1.0/src/fullFold.egg-info/entry_points.txt +3 -0
- fullfold-0.1.0/src/fullFold.egg-info/requires.txt +4 -0
- fullfold-0.1.0/src/fullFold.egg-info/top_level.txt +1 -0
fullfold-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) or by combination of their Contribution(s) with the
|
|
81
|
+
Work to which such Contribution(s) was submitted. If You institute
|
|
82
|
+
patent litigation against any entity (including a cross-claim or
|
|
83
|
+
counterclaim in a lawsuit) alleging that the Work or a Contribution
|
|
84
|
+
incorporated within the Work constitutes direct or contributory
|
|
85
|
+
patent infringement, then any patent licenses granted to You under
|
|
86
|
+
this License for that Work shall terminate as of the date such
|
|
87
|
+
litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
fullfold-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fullFold
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AlphaFold 3 at full throughput
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Keywords: alphafold,alphafold3,gpu,scheduler
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Provides-Extra: dev
|
|
17
|
+
Requires-Dist: pytest; extra == "dev"
|
|
18
|
+
Requires-Dist: build; extra == "dev"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# fullFold: unlocking the full speed of AF3!
|
|
22
|
+
|
|
23
|
+
**fullFold** is a lightweight inference and scheduling layer for running AlphaFold 3 efficiently, with a particular focus on high-throughput workloads on one or more GPUs. It can boost throughput by up to **3-fold** by (1) moving CPU-side work to background processes to keep GPU utilization near full, and (2) intelligently select and allocate bucket sizes while balancing compilation overhead against inference throughput, and as a bonus it will enable compilation caching by default. The more jobs you run, the greater the impact of fullFold. However, even for a single or a few jobs, fullFold is faster than native AlphaFold 3 in approximately 95% of cases, while in the remaining cases it performs on par with native AF3.
|
|
24
|
+
|
|
25
|
+
On multi-GPU systems, fullFold orchestrates prediction jobs across all available GPUs, including heterogeneous systems with GPUs of different performance. It dynamically distributes workloads while reducing unnecessary scheduling overhead and fully preserving the underlying AF3 inference implementation. In our benchmarks, fullFold has shown near-linear scaling with both the number and performance of available GPUs**, allowing throughput to scale efficiently across multi-GPU systems.
|
|
26
|
+
|
|
27
|
+
fullFold is deliberately non-invasive: it does not modify the AlphaFold 3 source code or model, making it straightforward to use alongside an existing AlphaFold 3 installation. It operates on fully prepared AlphaFold 3 inputs and focuses exclusively on the inference stage, not MSA generation or other parts of the data pipeline.
|
|
28
|
+
|
|
29
|
+
Inputs must therefore already contain the required MSA and template fields, including `""` where appropriate for MSA-free predictions. **fullFold does not run or replace the AlphaFold 3 data pipeline**; feature generation using the standard AlphaFold 3 pipeline must be completed before running fullFold.
|
|
30
|
+
|
|
31
|
+
See [docs/design.md](docs/design.md) for the cost model and [examples/demo.sh](examples/demo.sh)
|
|
32
|
+
for a template → scan → dry-run → kill → resume walkthrough (although just a run can be enough).
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
Requires Python 3.12+ and DeepMind’s `alphafold3>=3.0.2` already installed in the same environment.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# when installing from this GitHub repo
|
|
40
|
+
pip install .
|
|
41
|
+
# or directly via pip (SOON, not yet available):
|
|
42
|
+
pip install fullfold
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then run `fullfold` / `fullFold` (same command) or `python -m fullFold` from any directory.
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
The main command that does everything (it will run a few minute benchmark the first time):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## Other commands
|
|
58
|
+
|
|
59
|
+
Dry-run the same plan without launching workers:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models --dry-run
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Generate a ligand screen from a SMILES file, then schedule it:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
fullfold template --template receptor.json --records ligands.smi --output-dir jobs/
|
|
69
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## Helper commands - setting up batches
|
|
75
|
+
|
|
76
|
+
For setting up small-molecule screens or MSA-free peptide / de novo protein screens, you can use the template command below. For peptides and proteins it will write empty MSAs and
|
|
77
|
+
skip templates.
|
|
78
|
+
|
|
79
|
+
It takes an existing json input template with your configuration of interest, but without the other peptide/protein/small molecule. In our cases, this was often a single protein entry with all MSAs prepped. The records in the SMI/CSV/FASTA file are added as a new chain; existing receptor chains are left untouched):
|
|
80
|
+
|
|
81
|
+
Example 1 (SMILES input):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
fullfold template --template receptor.json --records ligands.smi --output-dir jobs/
|
|
85
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Example 2 (fasta input):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
fullfold template --template receptor.json --records binders.fasta --type protein --output-dir jobs/
|
|
92
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Resume is the same command: completed jobs (matching `done.json` hash) are skipped.
|
|
96
|
+
|
|
97
|
+
## Subcommands
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
| Command | What it does |
|
|
101
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
102
|
+
| `run` | All-in-one command: will run scan the AF3 json, plan them, and then execute. `--dry-run` stops after plan |
|
|
103
|
+
| `scan` | Verify and calculate the tokens for every `*.json` in `--input-dir` (writes `ledger.jsonl`) |
|
|
104
|
+
| `benchmark` | benchmark of the available GPUs for a 1024-token 4-seed probe per GPU; cached under `~/.cache/fullFold/bench/` |
|
|
105
|
+
| `plan` | Scan + benchmark (on cache miss) + write per-GPU manifests |
|
|
106
|
+
| `template` | Quickly setting up batch screens, from a template JSON file combined with each record in a FASTA / CSV / SMI file (one output JSON per record) |
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## GPU scheduling
|
|
112
|
+
|
|
113
|
+
`CUDA_VISIBLE_DEVICES` selects GPUs (indices or UUIDs). Unset or empty means every GPU reported by `nvidia-smi`, ordered by PCI bus ID. `--gpus` overrides.
|
|
114
|
+
|
|
115
|
+
`--policy contiguous` (default) assigns jobs with DP, then rebalances and steals tails. `--policy roundrobin` is the fallback (also used if a GPU probe is contaminated).
|
|
116
|
+
|
|
117
|
+
`--bucket-mode free` (default) compiles at the next `reference_timings.csv` bucket (ceil-8 only above 5216 tokens). `--bucket-mode ladder` intersects AlphaFold 3's default compile buckets with that CSV.
|
|
118
|
+
|
|
119
|
+
Prefetch and background-extract are on by default. Disable with `--no-prefetch` and `--no-background-extract`.
|
|
120
|
+
|
|
121
|
+
## Config fields
|
|
122
|
+
|
|
123
|
+
All tunables live in `config.py` (`Config`). Defaults:
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
| Field | Default | Meaning |
|
|
127
|
+
| ----------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
128
|
+
| `input_dir` | `.` | Folder of AlphaFold 3 JSON jobs |
|
|
129
|
+
| `output_dir` | `.` | Per-job output trees and `_af3sched/` |
|
|
130
|
+
| `model_dir` | `~/models` | AlphaFold 3 model weights |
|
|
131
|
+
| `gpus` | `()` | Override GPU indices/UUIDs; empty uses `CUDA_VISIBLE_DEVICES` or all |
|
|
132
|
+
| `dry_run` | `False` | Write manifests and stop |
|
|
133
|
+
| `prefetch` | `1` | Seed queue depth; also prepares the next job's first seed during the current job's inference. `--no-prefetch` sets `0` and disables all overlap |
|
|
134
|
+
| `background_extract` | `True` | Overlap one extract+write with the next same-bucket inference. Drains before compiling a new shape. `--no-background-extract` disables it |
|
|
135
|
+
| `policy` | `contiguous` | `contiguous` DP (then rebalance + steal tails), or `roundrobin` fallback |
|
|
136
|
+
| `bucket_mode` | `free` | `free` = next CSV bucket (ceil-8 above 5216); `ladder` = AF3 buckets ∩ CSV |
|
|
137
|
+
| `buckets` | AF3 128..5120 | Candidate compile shapes |
|
|
138
|
+
| `bucket_margin` | `0.05` | Near-boundary token counts escalate to exact count |
|
|
139
|
+
| `stale_lock_seconds` | `900` | Reclaim a lock whose mtime is older than this |
|
|
140
|
+
| `retry_failed` | `False` | Re-run jobs with `failed.json` |
|
|
141
|
+
| `exact_split_threshold` | `512` | Above this, coarsen multi-GPU split points |
|
|
142
|
+
| `force_benchmark` | `False` | Ignore the probe cache |
|
|
143
|
+
| `bench_seed` | `42` | RNG seed for the 1024-token probe protein |
|
|
144
|
+
| `cache_dir` | `~/.cache/fullFold/bench` | Per-host, per-GPU probe cache |
|
|
145
|
+
| `jax_compilation_cache_dir` | `None` | Root for the per-host, per-GPU-name JAX compile cache (default `<cache_dir>/jax/<host>__<name>/`; reuse follows JAX's GPU-name topology, not compute capability) |
|
|
146
|
+
| `xla_mem_fraction` | `0.97` | `XLA_CLIENT_MEM_FRACTION` in workers |
|
|
147
|
+
| `xla_preallocate` | `True` | `XLA_PYTHON_CLIENT_PREALLOCATE` |
|
|
148
|
+
| `exact_tokens` | `False` | Always use the AF3 tokenizer (slow, CCD load) |
|
|
149
|
+
| `template` | `None` | Base JSON for `template` |
|
|
150
|
+
| `records` | `None` | FASTA / CSV / SMI for `template` |
|
|
151
|
+
| `record_type` | `protein` | Default kind for FASTA / CSV `sequence` column |
|
|
152
|
+
| `save_embeddings` | `False` | Write per-seed embeddings |
|
|
153
|
+
| `save_distogram` | `False` | Write per-seed distograms |
|
|
154
|
+
| `compress_large_output_files` | `False` | Passed to `post_processing.write_output` |
|
|
155
|
+
| `save_terms_of_use` | `True` | Include AF3 output terms of use |
|
|
156
|
+
| `num_recycles` | `10` | Model recycle count |
|
|
157
|
+
| `num_diffusion_samples` | `5` | Diffusion samples per seed |
|
|
158
|
+
| `flash_attention` | `triton` | Flash-attention implementation |
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## Markers
|
|
164
|
+
|
|
165
|
+
Per job, under `<output-dir>/<sanitised-name>/.af3sched/`:
|
|
166
|
+
|
|
167
|
+
- `lock` — `O_CREAT|O_EXCL`, reclaimed if this host's pid is dead or mtime is stale
|
|
168
|
+
- `done.json` — written atomically; skip on resume if `sha256` matches
|
|
169
|
+
- `failed.json` — skip on resume unless `--retry-failed`
|
|
170
|
+
- `af3.log` — AlphaFold 3 stdout/stderr for that job
|
|
171
|
+
|
|
172
|
+
Under `<output-dir>/_af3sched/`:
|
|
173
|
+
|
|
174
|
+
- `gpu{N}.jsonl` — per-GPU scheduler events (`job_prep`, `job_skip`, …)
|
|
175
|
+
- `gpu{N}.log` — worker stdout/stderr, including JAX/XLA compile warnings (not printed to the terminal during `run`)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## Templates
|
|
180
|
+
|
|
181
|
+
SMILES are always ligands. Kind comes from the file extension (`.smi` / `.smiles`), a CSV `smiles` column, or `--type`. The same string `CCCC` is a ligand from `.smi` and a protein from FASTA. `--type ligand` on a FASTA is refused.
|
|
182
|
+
|
|
183
|
+
Added proteins get `"unpairedMsa": ""`, `"pairedMsa": ""`, `"templates": []` (MSA-free). That is how a de novo or peptide screen skips the AlphaFold 3 data pipeline. Existing template chains are not touched. `modelSeeds` is copied verbatim and never synthesised.
|
|
184
|
+
|
|
185
|
+
## Citing fullFold
|
|
186
|
+
|
|
187
|
+
A preprint or publication describing **fullFold** is not yet available. In the meantime, if you use fullFold in your work, please cite this GitHub repository and the specific version used:
|
|
188
|
+
|
|
189
|
+
> Verhellen, J. & Kooistra, A. J. **fullFold: Unlocking the Full Speed of AlphaFold 3.** Version `<version>`. GitHub: `https://github.com/DSDD-UCPH/fullFold`.
|
|
190
|
+
|
|
191
|
+
For reproducibility, please replace `<version>` with the fullFold release used in your analysis (for example, `v0.1.0`). If you used an unreleased version, please cite the corresponding Git commit hash in addition to the repository URL.
|
|
192
|
+
|
|
193
|
+
Once a preprint or publication becomes available, the recommended citation will be updated here.
|
fullfold-0.1.0/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# fullFold: unlocking the full speed of AF3!
|
|
2
|
+
|
|
3
|
+
**fullFold** is a lightweight inference and scheduling layer for running AlphaFold 3 efficiently, with a particular focus on high-throughput workloads on one or more GPUs. It can boost throughput by up to **3-fold** by (1) moving CPU-side work to background processes to keep GPU utilization near full, and (2) intelligently select and allocate bucket sizes while balancing compilation overhead against inference throughput, and as a bonus it will enable compilation caching by default. The more jobs you run, the greater the impact of fullFold. However, even for a single or a few jobs, fullFold is faster than native AlphaFold 3 in approximately 95% of cases, while in the remaining cases it performs on par with native AF3.
|
|
4
|
+
|
|
5
|
+
On multi-GPU systems, fullFold orchestrates prediction jobs across all available GPUs, including heterogeneous systems with GPUs of different performance. It dynamically distributes workloads while reducing unnecessary scheduling overhead and fully preserving the underlying AF3 inference implementation. In our benchmarks, fullFold has shown near-linear scaling with both the number and performance of available GPUs**, allowing throughput to scale efficiently across multi-GPU systems.
|
|
6
|
+
|
|
7
|
+
fullFold is deliberately non-invasive: it does not modify the AlphaFold 3 source code or model, making it straightforward to use alongside an existing AlphaFold 3 installation. It operates on fully prepared AlphaFold 3 inputs and focuses exclusively on the inference stage, not MSA generation or other parts of the data pipeline.
|
|
8
|
+
|
|
9
|
+
Inputs must therefore already contain the required MSA and template fields, including `""` where appropriate for MSA-free predictions. **fullFold does not run or replace the AlphaFold 3 data pipeline**; feature generation using the standard AlphaFold 3 pipeline must be completed before running fullFold.
|
|
10
|
+
|
|
11
|
+
See [docs/design.md](docs/design.md) for the cost model and [examples/demo.sh](examples/demo.sh)
|
|
12
|
+
for a template → scan → dry-run → kill → resume walkthrough (although just a run can be enough).
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Requires Python 3.12+ and DeepMind’s `alphafold3>=3.0.2` already installed in the same environment.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# when installing from this GitHub repo
|
|
20
|
+
pip install .
|
|
21
|
+
# or directly via pip (SOON, not yet available):
|
|
22
|
+
pip install fullfold
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then run `fullfold` / `fullFold` (same command) or `python -m fullFold` from any directory.
|
|
26
|
+
|
|
27
|
+
## Quickstart
|
|
28
|
+
|
|
29
|
+
The main command that does everything (it will run a few minute benchmark the first time):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Other commands
|
|
38
|
+
|
|
39
|
+
Dry-run the same plan without launching workers:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models --dry-run
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Generate a ligand screen from a SMILES file, then schedule it:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
fullfold template --template receptor.json --records ligands.smi --output-dir jobs/
|
|
49
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Helper commands - setting up batches
|
|
55
|
+
|
|
56
|
+
For setting up small-molecule screens or MSA-free peptide / de novo protein screens, you can use the template command below. For peptides and proteins it will write empty MSAs and
|
|
57
|
+
skip templates.
|
|
58
|
+
|
|
59
|
+
It takes an existing json input template with your configuration of interest, but without the other peptide/protein/small molecule. In our cases, this was often a single protein entry with all MSAs prepped. The records in the SMI/CSV/FASTA file are added as a new chain; existing receptor chains are left untouched):
|
|
60
|
+
|
|
61
|
+
Example 1 (SMILES input):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
fullfold template --template receptor.json --records ligands.smi --output-dir jobs/
|
|
65
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Example 2 (fasta input):
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
fullfold template --template receptor.json --records binders.fasta --type protein --output-dir jobs/
|
|
72
|
+
fullfold run --input-dir jobs/ --output-dir results/ --model-dir /path/to/models
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Resume is the same command: completed jobs (matching `done.json` hash) are skipped.
|
|
76
|
+
|
|
77
|
+
## Subcommands
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
| Command | What it does |
|
|
81
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `run` | All-in-one command: will run scan the AF3 json, plan them, and then execute. `--dry-run` stops after plan |
|
|
83
|
+
| `scan` | Verify and calculate the tokens for every `*.json` in `--input-dir` (writes `ledger.jsonl`) |
|
|
84
|
+
| `benchmark` | benchmark of the available GPUs for a 1024-token 4-seed probe per GPU; cached under `~/.cache/fullFold/bench/` |
|
|
85
|
+
| `plan` | Scan + benchmark (on cache miss) + write per-GPU manifests |
|
|
86
|
+
| `template` | Quickly setting up batch screens, from a template JSON file combined with each record in a FASTA / CSV / SMI file (one output JSON per record) |
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## GPU scheduling
|
|
92
|
+
|
|
93
|
+
`CUDA_VISIBLE_DEVICES` selects GPUs (indices or UUIDs). Unset or empty means every GPU reported by `nvidia-smi`, ordered by PCI bus ID. `--gpus` overrides.
|
|
94
|
+
|
|
95
|
+
`--policy contiguous` (default) assigns jobs with DP, then rebalances and steals tails. `--policy roundrobin` is the fallback (also used if a GPU probe is contaminated).
|
|
96
|
+
|
|
97
|
+
`--bucket-mode free` (default) compiles at the next `reference_timings.csv` bucket (ceil-8 only above 5216 tokens). `--bucket-mode ladder` intersects AlphaFold 3's default compile buckets with that CSV.
|
|
98
|
+
|
|
99
|
+
Prefetch and background-extract are on by default. Disable with `--no-prefetch` and `--no-background-extract`.
|
|
100
|
+
|
|
101
|
+
## Config fields
|
|
102
|
+
|
|
103
|
+
All tunables live in `config.py` (`Config`). Defaults:
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
| Field | Default | Meaning |
|
|
107
|
+
| ----------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
108
|
+
| `input_dir` | `.` | Folder of AlphaFold 3 JSON jobs |
|
|
109
|
+
| `output_dir` | `.` | Per-job output trees and `_af3sched/` |
|
|
110
|
+
| `model_dir` | `~/models` | AlphaFold 3 model weights |
|
|
111
|
+
| `gpus` | `()` | Override GPU indices/UUIDs; empty uses `CUDA_VISIBLE_DEVICES` or all |
|
|
112
|
+
| `dry_run` | `False` | Write manifests and stop |
|
|
113
|
+
| `prefetch` | `1` | Seed queue depth; also prepares the next job's first seed during the current job's inference. `--no-prefetch` sets `0` and disables all overlap |
|
|
114
|
+
| `background_extract` | `True` | Overlap one extract+write with the next same-bucket inference. Drains before compiling a new shape. `--no-background-extract` disables it |
|
|
115
|
+
| `policy` | `contiguous` | `contiguous` DP (then rebalance + steal tails), or `roundrobin` fallback |
|
|
116
|
+
| `bucket_mode` | `free` | `free` = next CSV bucket (ceil-8 above 5216); `ladder` = AF3 buckets ∩ CSV |
|
|
117
|
+
| `buckets` | AF3 128..5120 | Candidate compile shapes |
|
|
118
|
+
| `bucket_margin` | `0.05` | Near-boundary token counts escalate to exact count |
|
|
119
|
+
| `stale_lock_seconds` | `900` | Reclaim a lock whose mtime is older than this |
|
|
120
|
+
| `retry_failed` | `False` | Re-run jobs with `failed.json` |
|
|
121
|
+
| `exact_split_threshold` | `512` | Above this, coarsen multi-GPU split points |
|
|
122
|
+
| `force_benchmark` | `False` | Ignore the probe cache |
|
|
123
|
+
| `bench_seed` | `42` | RNG seed for the 1024-token probe protein |
|
|
124
|
+
| `cache_dir` | `~/.cache/fullFold/bench` | Per-host, per-GPU probe cache |
|
|
125
|
+
| `jax_compilation_cache_dir` | `None` | Root for the per-host, per-GPU-name JAX compile cache (default `<cache_dir>/jax/<host>__<name>/`; reuse follows JAX's GPU-name topology, not compute capability) |
|
|
126
|
+
| `xla_mem_fraction` | `0.97` | `XLA_CLIENT_MEM_FRACTION` in workers |
|
|
127
|
+
| `xla_preallocate` | `True` | `XLA_PYTHON_CLIENT_PREALLOCATE` |
|
|
128
|
+
| `exact_tokens` | `False` | Always use the AF3 tokenizer (slow, CCD load) |
|
|
129
|
+
| `template` | `None` | Base JSON for `template` |
|
|
130
|
+
| `records` | `None` | FASTA / CSV / SMI for `template` |
|
|
131
|
+
| `record_type` | `protein` | Default kind for FASTA / CSV `sequence` column |
|
|
132
|
+
| `save_embeddings` | `False` | Write per-seed embeddings |
|
|
133
|
+
| `save_distogram` | `False` | Write per-seed distograms |
|
|
134
|
+
| `compress_large_output_files` | `False` | Passed to `post_processing.write_output` |
|
|
135
|
+
| `save_terms_of_use` | `True` | Include AF3 output terms of use |
|
|
136
|
+
| `num_recycles` | `10` | Model recycle count |
|
|
137
|
+
| `num_diffusion_samples` | `5` | Diffusion samples per seed |
|
|
138
|
+
| `flash_attention` | `triton` | Flash-attention implementation |
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
## Markers
|
|
144
|
+
|
|
145
|
+
Per job, under `<output-dir>/<sanitised-name>/.af3sched/`:
|
|
146
|
+
|
|
147
|
+
- `lock` — `O_CREAT|O_EXCL`, reclaimed if this host's pid is dead or mtime is stale
|
|
148
|
+
- `done.json` — written atomically; skip on resume if `sha256` matches
|
|
149
|
+
- `failed.json` — skip on resume unless `--retry-failed`
|
|
150
|
+
- `af3.log` — AlphaFold 3 stdout/stderr for that job
|
|
151
|
+
|
|
152
|
+
Under `<output-dir>/_af3sched/`:
|
|
153
|
+
|
|
154
|
+
- `gpu{N}.jsonl` — per-GPU scheduler events (`job_prep`, `job_skip`, …)
|
|
155
|
+
- `gpu{N}.log` — worker stdout/stderr, including JAX/XLA compile warnings (not printed to the terminal during `run`)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## Templates
|
|
160
|
+
|
|
161
|
+
SMILES are always ligands. Kind comes from the file extension (`.smi` / `.smiles`), a CSV `smiles` column, or `--type`. The same string `CCCC` is a ligand from `.smi` and a protein from FASTA. `--type ligand` on a FASTA is refused.
|
|
162
|
+
|
|
163
|
+
Added proteins get `"unpairedMsa": ""`, `"pairedMsa": ""`, `"templates": []` (MSA-free). That is how a de novo or peptide screen skips the AlphaFold 3 data pipeline. Existing template chains are not touched. `modelSeeds` is copied verbatim and never synthesised.
|
|
164
|
+
|
|
165
|
+
## Citing fullFold
|
|
166
|
+
|
|
167
|
+
A preprint or publication describing **fullFold** is not yet available. In the meantime, if you use fullFold in your work, please cite this GitHub repository and the specific version used:
|
|
168
|
+
|
|
169
|
+
> Verhellen, J. & Kooistra, A. J. **fullFold: Unlocking the Full Speed of AlphaFold 3.** Version `<version>`. GitHub: `https://github.com/DSDD-UCPH/fullFold`.
|
|
170
|
+
|
|
171
|
+
For reproducibility, please replace `<version>` with the fullFold release used in your analysis (for example, `v0.1.0`). If you used an unreleased version, please cite the corresponding Git commit hash in addition to the repository URL.
|
|
172
|
+
|
|
173
|
+
Once a preprint or publication becomes available, the recommended citation will be updated here.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fullFold"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "AlphaFold 3 at full throughput"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Science/Research",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Bio-Informatics",
|
|
20
|
+
]
|
|
21
|
+
keywords = ["alphafold", "alphafold3", "gpu", "scheduler"]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
fullFold = "fullFold.cli:main"
|
|
25
|
+
fullfold = "fullFold.cli:main"
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dev = ["pytest", "build"]
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.packages.find]
|
|
31
|
+
where = ["src"]
|
|
32
|
+
include = ["fullFold*"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
fullFold = ["data/*.csv"]
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
testpaths = ["src/tests"]
|
|
39
|
+
pythonpath = ["src"]
|
fullfold-0.1.0/setup.cfg
ADDED