Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
!LICENSE
!pyproject.toml
!README.md
!setup.py

# Allow specific directories
!deepspeed_configs/**
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ cutlass/

# User-specific claude settings
.claude/

# User-specific pre-commit settings
.pre-commit-config.yaml
6 changes: 3 additions & 3 deletions docker/DOCKER.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
## Generating and updating production.lock file

While a conda env can be created from `environments/production.yml`, this causes the environment to be resolved from scratch everytime.
While a conda env can be created from `environments/production-linux-64.yml`, this causes the environment to be resolved from scratch everytime.
For reproducible builds, one needs to generate a .lock file that exactly re-creates the environment.

When you modify `environments/production.yml`, you need to regenerate the lock file to pin exact versions. This ensures reproducible builds, prevents conda from resolving the environment again. `environment/production.lock` is then used for 'stable' builds.
When you modify `environments/production-linux-64.yml`, you need to regenerate the lock file to pin exact versions. This ensures reproducible builds, prevents conda from resolving the environment again. `environment/production.lock` is then used for 'stable' builds.

```bash
# Build the lock file generator image
docker build -f docker/Dockerfile.update-reqs -t openfold3-update-reqs .

# Generate the lock file (linux-64 only for now)
docker run --rm openfold3-update-reqs > environments/production-linux-64.lock
docker run -v $(pwd)/environments:/output --rm openfold3-update-reqs

# Commit the updated lock file
git add environments/production-linux-64.lock
Expand Down
15 changes: 6 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENV PATH=/opt/conda/bin:$PATH
# To regenerate the lock file, see docker/DOCKER.md
# Use BUILD_MODE=yaml (default) for reproducible builds, BUILD_MODE=yml for flexible dev builds
COPY environments/production-linux-64.lock /opt/openfold3/production-linux-64.lock
COPY environments/production.yml /opt/openfold3/production.yml
COPY environments/production-linux-64.yml /opt/openfold3/production-linux-64.yml

# Install environment based on BUILD_MODE
# - lock: uses conda-lock for exact reproducible builds (training/production)
Expand All @@ -38,7 +38,7 @@ RUN mamba install -n base -c conda-forge conda-lock --yes \
&& if [ "$BUILD_MODE" = "lock" ]; then \
conda-lock install --name openfold3 /opt/openfold3/production-linux-64.lock; \
elif [ "$BUILD_MODE" = "yaml" ]; then \
mamba env create -f /opt/openfold3/production.yml --name openfold3; \
mamba env create -f /opt/openfold3/pproduction-linux-64 --name openfold3; \
else \
echo "Invalid BUILD_MODE: $BUILD_MODE. Use 'lock' or 'yaml'." && exit 1; \
fi \
Expand All @@ -51,7 +51,6 @@ ENV CONDA_PREFIX=/opt/conda/envs/openfold3
ENV CONDA_DEFAULT_ENV=openfold3

# Copy the minimal set of files needed to install the package
COPY setup.py /opt/openfold3/
COPY pyproject.toml /opt/openfold3/
COPY openfold3/__init__.py /opt/openfold3/openfold3/
COPY scripts/ /opt/openfold3/scripts/
Expand All @@ -62,8 +61,7 @@ RUN /opt/openfold3/scripts/install_third_party_dependencies.sh

# Install the package
WORKDIR /opt/openfold3
# even `pip install --no-build-isolation` not actually working here, needs investigation
RUN python setup.py install
RUN python -m uv pip install --editable --no-deps .

# Set CUDA architecture for compilation (adjust based on your GPU)
ENV TORCH_CUDA_ARCH_LIST="8.0;8.6;9.0"
Expand Down Expand Up @@ -130,8 +128,7 @@ WORKDIR /opt/openfold3
# Test stage - build on devel layer with test dependencies
FROM devel AS test

COPY environments/requirements-test.txt /opt/openfold3/requirements-test.txt

WORKDIR /opt/openfold3
RUN pip install -r requirements-test.txt
RUN pip install --no-deps --editable .
# Only uv supports --dependency-groups from pyproject.toml
RUN uv pip install --dependency-groups=test
RUN uv pip install --no-deps --editable .
4 changes: 2 additions & 2 deletions docker/Dockerfile.blackwell
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
WORKDIR /opt
RUN git clone https://github.com/aqlaboratory/openfold-3.git && \
cd openfold-3 && \
cp -p environments/production.yml environments/production.yml.backup && \
cp -p environments/production-linux-64.yml environments/production.yml.backup && \
grep -v "pytorch::pytorch" environments/production.yml > environments/production.yml.tmp && \
mv environments/production.yml.tmp environments/production.yml

Expand Down Expand Up @@ -56,7 +56,7 @@ RUN git clone https://github.com/NVIDIA/cutlass --branch v3.6.0 --depth 1

# Install OpenFold3 package itself (provides run_openfold command)
WORKDIR /opt/openfold-3
RUN python3 setup.py install
RUN python3 -m pip install --editable --no-deps .

# Set environment variables including CUDA architecture for Blackwell
ENV PYTHONUNBUFFERED=1 \
Expand Down
8 changes: 5 additions & 3 deletions docker/Dockerfile.update-reqs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ RUN micromamba install -y -n base -c conda-forge conda-lock \

USER $MAMBA_USER

COPY --chown=$MAMBA_USER:$MAMBA_USER environments/production.yml /tmp/environment.yml
COPY --chown=$MAMBA_USER:$MAMBA_USER environments/production-linux-64.yml /tmp/production-linux-64.yml

# Generate explicit lock file for linux-64
# The explicit format is directly consumable by mamba/conda
RUN micromamba run -n base conda-lock lock \
--mamba \
--platform linux-64 \
--file /tmp/environment.yml \
--file /tmp/production-linux-64.yml \
--kind explicit \
--filename-template '/tmp/production-{platform}.lock'

# Output the lock file to stdout when container runs
CMD ["cat", "/tmp/production-linux-64.lock"]
USER root
CMD ["sh", "-c", "cp /tmp/production-*.lock /output/"]

23 changes: 12 additions & 11 deletions environments/production-linux-64.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by conda-lock.
# platform: linux-64
# input_hash: c6c19afe77e0f661243e36155e1d001a14036561d4f5842ec9230565596b8060
# input_hash: 12c5e0c7c920184c37043be6c44627092723a93293a4b6e68614446c10120d5d
@EXPLICIT
https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.4-h3060b56_3.conda#c9a3fe8b957176e1a8452c6f3431b0d8
https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2#0c96522c6bdaed4b1566d11387caaf45
Expand Down Expand Up @@ -67,12 +67,13 @@ https://conda.anaconda.org/conda-forge/linux-64/llvm-openmp-15.0.7-h0cdce71_0.co
https://conda.anaconda.org/conda-forge/linux-64/opencl-headers-2025.06.13-h5888daf_0.conda#45c3d2c224002d6d0d7769142b29f986
https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda#7a3bff861a6583f1889021facefc08b1
https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda#c01af13bdc553d1a8fbfff6e8db075f0
https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8c095d6_2.conda#283b96675859b20a825f8fa30f311446
https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda#d7d95fc8287ea7bf33e0e7116d2b95ec
https://conda.anaconda.org/conda-forge/linux-64/s2n-1.6.1-h23ded05_1.conda#d9f44253e28b48baee6e278d51ece70c
https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_ha0e22de_103.conda#86bc20552bf46075e3d92b67f089172d
https://conda.anaconda.org/conda-forge/linux-64/uv-0.9.18-h76e24b7_0.conda#66a5d1348be63f1874f5a0dd0add29c2
https://conda.anaconda.org/conda-forge/linux-64/xorg-libsm-1.2.6-he73a12e_0.conda#1c74ff8c35dcadf952a16f752ca5aa49
https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-hb9d3cd8_2.conda#c9f075ab2f33b3bbee9e62d4ad0a6cd8
https://conda.anaconda.org/conda-forge/linux-64/zlib-ng-2.3.2-h54a6638_0.conda#0faadd01896315ceea58bcc3479b1d21
https://conda.anaconda.org/conda-forge/linux-64/zlib-ng-2.3.2-hceb46e0_1.conda#40feea2979654ed579f1cda7c63ccb94
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda#4a13eeac0b5c8e5b8ab496e6c4ddd829
https://conda.anaconda.org/conda-forge/linux-64/aws-c-io-0.23.3-had5c4f5_4.conda#a53c9f532e5c4a2b85d4b4c439ea5a5d
https://conda.anaconda.org/conda-forge/linux-64/brotli-bin-1.2.0-hb03c661_1.conda#af39b9a8711d4a8d437b52c1d78eb6a1
Expand Down Expand Up @@ -137,7 +138,7 @@ https://conda.anaconda.org/conda-forge/noarch/distro-1.8.0-pyhd8ed1ab_0.conda#67
https://conda.anaconda.org/conda-forge/linux-64/docutils-0.18.1-py312h7900ff3_1.conda#09365878b2c29a847deca0d9e1d56756
https://conda.anaconda.org/conda-forge/noarch/dpath-2.2.0-pyha770c72_1.conda#7b2af124684a994217e62c641bca2e48
https://conda.anaconda.org/conda-forge/noarch/eval_type_backport-0.3.1-pyha770c72_0.conda#9cb8eae2a1f3e4a2cb8c53559abf6d75
https://conda.anaconda.org/conda-forge/noarch/filelock-3.20.0-pyhd8ed1ab_0.conda#66b8b26023b8efdf8fcb23bac4b6325d
https://conda.anaconda.org/conda-forge/noarch/filelock-3.20.1-pyhd8ed1ab_0.conda#81a651287d3000eb12f0860ade0a1b41
https://conda.anaconda.org/conda-forge/linux-64/freetype-2.14.1-ha770c72_0.conda#4afc585cd97ba8a23809406cd8a9eda8
https://conda.anaconda.org/conda-forge/linux-64/frozenlist-1.7.0-py312h447239a_0.conda#63e20cf7b7460019b423fc06abb96c60
https://conda.anaconda.org/conda-forge/noarch/fsspec-2025.12.0-pyhd8ed1ab_0.conda#a3b9510e2491c20c7fc0f5e730227fbb
Expand Down Expand Up @@ -239,7 +240,7 @@ https://conda.anaconda.org/conda-forge/noarch/yte-1.9.4-pyhd8ed1ab_0.conda#89d5e
https://conda.anaconda.org/conda-forge/linux-64/aiohttp-3.13.2-py312h27b7581_0.conda#ad84ca57d502eead2df0233090261dfb
https://conda.anaconda.org/conda-forge/noarch/annotated-types-0.7.0-pyhd8ed1ab_1.conda#2934f256a8acfe48f6ebb4fce6cde29c
https://conda.anaconda.org/conda-forge/linux-64/awscrt-0.29.1-py312he7d6d80_1.conda#d7f6c3ae7a72ef678d6c9b80dc3251c8
https://conda.anaconda.org/conda-forge/noarch/botocore-1.42.9-pyhd8ed1ab_0.conda#4d2ec2e8bb652cc4e33cb3b47a42108f
https://conda.anaconda.org/conda-forge/noarch/botocore-1.42.13-pyhd8ed1ab_0.conda#604d364e7010ad8313d8453879097bf0
https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-h3394656_0.conda#09262e66b19567aff4f592fb53b28760
https://conda.anaconda.org/conda-forge/noarch/cuda-runtime-12.4.1-ha804496_0.conda#48829f4ef6005ae8d4867b99168ff2b8
https://conda.anaconda.org/conda-forge/noarch/gitpython-3.1.45-pyhff2d567_0.conda#b91d463ea8be13bcbe644ae8bc99c39f
Expand All @@ -250,15 +251,15 @@ https://conda.anaconda.org/conda-forge/linux-64/pydantic-core-2.41.5-py312h868fb
https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda#2b694bad8a50dc2f712f5368de866480
https://conda.anaconda.org/conda-forge/noarch/requests-2.32.5-pyhd8ed1ab_0.conda#db0c6b99149880c8ba515cf4abe93ee4
https://conda.anaconda.org/conda-forge/noarch/rich-14.2.0-pyhcf101f3_0.conda#a247579d8a59931091b16a1e932bbed6
https://conda.anaconda.org/conda-forge/noarch/sentry-sdk-2.47.0-pyhd8ed1ab_0.conda#bdf1bb47b4c0e3c32165fedf701f7023
https://conda.anaconda.org/conda-forge/noarch/sentry-sdk-2.48.0-pyhd8ed1ab_0.conda#328e2c6d3c229c4669d900bf0abc308a
https://conda.anaconda.org/bioconda/noarch/snakemake-interface-executor-plugins-9.3.9-pyhdfd78af_0.tar.bz2#e75b9c422bcc3c9b52679dedb84f3b71
https://conda.anaconda.org/bioconda/noarch/snakemake-interface-logger-plugins-2.0.0-pyhd4c3c12_0.conda#98f75f2ca3a222992e2230d7afc54bb8
https://conda.anaconda.org/bioconda/noarch/snakemake-interface-report-plugins-1.3.0-pyhd4c3c12_0.conda#e6fd8cfb23b294da699e395dbc968d11
https://conda.anaconda.org/bioconda/noarch/snakemake-interface-scheduler-plugins-2.0.2-pyhd4c3c12_0.conda#1500fccf5e46c7f91d14925449ff3632
https://conda.anaconda.org/bioconda/noarch/snakemake-interface-storage-plugins-4.3.2-pyhd4c3c12_0.conda#b894c6a2d0612da952c9989ac7a22d16
https://conda.anaconda.org/conda-forge/linux-64/sqlalchemy-2.0.45-py312h4c3975b_0.conda#62bf6422896d094a55aa59bdf052aa1d
https://conda.anaconda.org/conda-forge/noarch/sympy-1.14.0-pyh2585a3b_105.conda#8c09fac3785696e1c477156192d64b91
https://conda.anaconda.org/conda-forge/linux-64/awscli-2.32.16-py312h20c3967_0.conda#c861f278fdbcdc4792fbab59820dc8e1
https://conda.anaconda.org/conda-forge/linux-64/awscli-2.32.20-py312h20c3967_0.conda#03fad208dbf6ca9e877c7169ca1b9da6
https://conda.anaconda.org/conda-forge/linux-64/blas-1.0-mkl.tar.bz2#349aef876b1d8c9dccae01de20d5b385
https://conda.anaconda.org/conda-forge/noarch/jsonschema-4.25.1-pyhe01879c_0.conda#341fd940c242cf33e832c0402face56f
https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-20_linux64_mkl.conda#8bf521f6007b0b0eb91515a1165b5d85
Expand All @@ -269,7 +270,7 @@ https://conda.anaconda.org/pytorch/linux-64/pytorch-cuda-12.4-hc786d27_7.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/s3transfer-0.16.0-pyhd8ed1ab_0.conda#061b5affcffeef245d60ec3007d1effd
https://conda.anaconda.org/conda-forge/noarch/typer-slim-standard-0.20.0-h4daf872_1.conda#37b26aafb15a6687b31a3d8d7a1f04e7
https://conda.anaconda.org/conda-forge/noarch/veracitools-0.1.3-py_0.tar.bz2#f2c8d44ea78cf639ab4810aedba43ab5
https://conda.anaconda.org/conda-forge/noarch/boto3-1.42.9-pyhd8ed1ab_0.conda#49b937582653599d4a3daf309a3a2b56
https://conda.anaconda.org/conda-forge/noarch/boto3-1.42.13-pyhd8ed1ab_0.conda#d4e7353eecdc12fc7722b9a09d763908
https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-20_linux64_mkl.conda#7a2972758a03adc92d856072c71c9170
https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.9.0-20_linux64_mkl.conda#4db0cd03efcdab535f6f066aca4cddbb
https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_1.conda#bbe1963f1e47f594070ffe87cdf612ea
Expand All @@ -288,7 +289,7 @@ https://conda.anaconda.org/conda-forge/linux-64/contourpy-1.3.3-py312hd9148b4_3.
https://conda.anaconda.org/bioconda/linux-64/hmmer-3.4-hb6cb901_4.tar.bz2#689f962720e131fe4849e2909181120a
https://conda.anaconda.org/conda-forge/linux-64/libboost-python-1.86.0-py312hf890105_4.conda#ad2ca5f64b13b92c0dc928767a6b8288
https://conda.anaconda.org/conda-forge/linux-64/pandas-2.3.3-py312hf79963d_1.conda#e597b3e812d9613f659b7d87ad252d18
https://conda.anaconda.org/conda-forge/linux-64/scipy-1.16.3-py312h7a1785b_1.conda#c6e0e1f1d9ac014a980574cfe8caa25f
https://conda.anaconda.org/conda-forge/linux-64/scipy-1.16.3-py312h54fa4ab_2.conda#e82683871cbc4bb257b7694f31a91327
https://conda.anaconda.org/conda-forge/linux-64/biotraj-1.2.2-py312h1289d80_1.conda#54583e730310f65444c2d3c6b4867c27
https://conda.anaconda.org/conda-forge/linux-64/coin-or-clp-1.17.10-hc03379b_3.conda#36a0b880feba1c1a14a37eb95b3d8dd6
https://conda.anaconda.org/conda-forge/linux-64/matplotlib-base-3.10.8-py312he3d6523_0.conda#b8dc157bbbb69c1407478feede8b7b42
Expand All @@ -297,11 +298,11 @@ https://conda.anaconda.org/conda-forge/linux-64/coin-or-cgl-0.60.9-hc46dffc_6.co
https://conda.anaconda.org/conda-forge/linux-64/rdkit-2025.09.3-py312h3ecb6ed_0.conda#a124ddd026e0ba1b3f781f4189dde55d
https://conda.anaconda.org/conda-forge/linux-64/coin-or-cbc-2.10.12-h4d16d09_4.conda#603a1a18878030b5e6793ba558fac972
https://conda.anaconda.org/conda-forge/linux-64/pulp-2.8.0-py312hd0750ca_3.conda#1ade2915cfabbcb8f07e7b4387f4d49b
https://conda.anaconda.org/bioconda/noarch/snakemake-minimal-9.14.4-pyhdfd78af_0.conda#0496673a83b94e461296a112058c4b07
https://conda.anaconda.org/bioconda/noarch/snakemake-minimal-9.14.5-pyhdfd78af_0.conda#506595d74d93a867497f0c97144007c5
https://conda.anaconda.org/conda-forge/noarch/eido-0.2.4-pyhd8ed1ab_0.conda#fc815854ab62482e2f2f0d8fab786a1c
https://conda.anaconda.org/conda-forge/noarch/pephubclient-0.4.4-pyhd8ed1ab_1.conda#08d92912686d87b05d53ce04f00142c8
https://conda.anaconda.org/conda-forge/noarch/peppy-0.40.8-pyhd8ed1ab_0.conda#af8214b9b5fd6d49175958be2a4f5321
https://conda.anaconda.org/bioconda/noarch/snakemake-9.14.4-hdfd78af_0.conda#ff4ac83ceb640f17c8b1191832ed9063
https://conda.anaconda.org/bioconda/noarch/snakemake-9.14.5-hdfd78af_0.conda#f58d59bad6b87b017ed678571ec76577
https://conda.anaconda.org/pytorch/linux-64/pytorch-2.5.1-py3.12_cuda12.4_cudnn9.1.0_0.tar.bz2#42164c6ce8e563c20a542686a8b9b964
https://conda.anaconda.org/conda-forge/noarch/torchmetrics-1.8.2-pyhd8ed1ab_0.conda#5d6e1558a945d0333ae7dc557add7201
https://conda.anaconda.org/pytorch/linux-64/torchtriton-3.1.0-py312.tar.bz2#bb4b2d07cb6b9b476e78740c08ba69fe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- awscli
- setuptools
- pip
- conda-forge::uv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: shouldn't uv be installed from conda-forge by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review!

The OpenFold3-MLX is a slightly different story, since they want to re-write everything in this MLX framework. I'd like to support people running the CPU-native workloads (datapipeline) of OpenFold on Macs. But it's a bit experimental so I'd agree not to signal that we can support it (we can't yet, it'd be a lot of work).

nit: shouldn't uv be installed from conda-forge by default?

it should, i guess this is marginally more explicit (if another random channel provides this package, ignore it) but to be fair I don't really remember how the package vs multiple-channels thing work.

Copy link
Collaborator Author

@jandom jandom Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let's maybe keep the osx and say it's 'experimental' – maybe some members of the community will contribute off a nugget like this. People seem to be quite interested in building OF3 for their various platforms (DGX etc). What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested running OpenFold on CPUs, but my understanding is that the capacity of structures that could be predicted is quite limited because the triangle attention modules are optimized for GPUs. Did you already have a chance to test the osx builds on your machine?

If we haven't tested the osx build and/or it doesn't work on very many use cases, I would suggest omitting the osx builds for now. I think that organizing our environment files with production-linux-64.* provides a reference format for future contributors to add environments for other platforms that they've tested.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, no really tested - okay, you've convinced me, I've removed the OSX stuff completely. I think this is ready to merge :D

- pytorch-lightning
- biopython
- numpy
Expand Down
4 changes: 0 additions & 4 deletions environments/requirements-test.txt

This file was deleted.

8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ Repository = "https://github.com/aqlaboratory/openfold-3"
run_openfold="openfold3.run_openfold:cli"
setup_openfold="openfold3.setup_openfold:main"

[dependency-groups]
test = [
"pytest",
"ruff",
"awscli",
"aria2",
]

[project.optional-dependencies]
dev = [
"pytest",
Expand Down
17 changes: 0 additions & 17 deletions setup.py

This file was deleted.

Loading