From 38d466538c7830159d80554f3ce52e020bc1cb7b Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 13:53:43 +1100 Subject: [PATCH 01/14] Test on MacOS and remove progress bar from example --- .github/workflows/examples-ci.yaml | 102 +++++++++--------- .../train-gnn-to-electric-field.ipynb | 51 +++++++-- 2 files changed, 94 insertions(+), 59 deletions(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index ddc10350..610628ae 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -28,65 +28,63 @@ jobs: name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python-version: ["3.11", "3.12"] - pydantic-version: ["2"] - include-rdkit: [true] - include-openeye: [false] - include-dgl: [true] - + fail-fast: false + matrix: + os: [macOS-12, ubuntu-latest] + python-version: ["3.11", "3.12"] + pydantic-version: ["2"] + include-rdkit: [true] + include-openeye: [false] + include-dgl: [true] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + + - name: Build information + run: | + uname -a + df -h + ulimit -a - - name: Build information - run: | - uname -a - df -h - ulimit -a + - name: Install environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda-envs/examples_env.yaml + create-args: >- + python=${{ matrix.python-version }} + pydantic=${{ matrix.pydantic-version }} - - name: Install environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: devtools/conda-envs/examples_env.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} + - name: Install package + run: | + python -m pip install . --no-deps - - name: Install package - run: | - python -m pip install . --no-deps + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" + - name: Uninstall RDKit + if: matrix.include-rdkit == false + run: conda remove --force rdkit --yes || echo "rdkit not installed" - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: conda remove --force rdkit --yes || echo "rdkit not installed" - - - name: Python information - run: | - which python - conda info - conda list + - name: Python information + run: | + which python + conda info + conda list - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - name: Run example notebooks - run: | - python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --nbval-cell-timeout=50000 --dist loadscope examples + - name: Run example notebooks + run: | + python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --dist loadscope examples diff --git a/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb b/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb index 2e918cdd..a45ae887 100644 --- a/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb +++ b/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb @@ -551,7 +551,13 @@ { "cell_type": "markdown", "id": "79cb1d56-3d70-4307-93f0-0d5956fdb32e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Training the model\n", "\n", @@ -562,7 +568,13 @@ "cell_type": "code", "execution_count": 13, "id": "5bfcbce1-8323-4403-a607-89292681375b", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "import pytorch_lightning as pl\n", @@ -573,12 +585,18 @@ "cell_type": "code", "execution_count": null, "id": "c8cb0a08-eea6-41e4-9fd6-158204e26e79", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "trainer = pl.Trainer(\n", " max_epochs=100,\n", - " callbacks=[TQDMProgressBar()], # add progress bar\n", + " # callbacks=[TQDMProgressBar()], # add progress bar\n", " accelerator=\"cpu\"\n", ")" ] @@ -587,7 +605,13 @@ "cell_type": "code", "execution_count": null, "id": "f8846142-77f2-4d60-a74e-c3bc3c3ed3ee", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "datamodule = training_model.create_data_module(verbose=False)" @@ -597,7 +621,13 @@ "cell_type": "code", "execution_count": 14, "id": "4e0174d7-a57b-49d9-89a3-5c756adc0d8c", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [ { "name": "stderr", @@ -2154,7 +2184,14 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.12.7" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } } }, "nbformat": 4, From 69abd328ab798e860770438492947a4063dde596 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 14:30:34 +1100 Subject: [PATCH 02/14] Undo formatting changes --- .github/workflows/examples-ci.yaml | 102 +++++++++++++++-------------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index 610628ae..bacb6515 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -28,63 +28,65 @@ jobs: name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false - matrix: - os: [macOS-12, ubuntu-latest] - python-version: ["3.11", "3.12"] - pydantic-version: ["2"] - include-rdkit: [true] - include-openeye: [false] - include-dgl: [true] + fail-fast: false + matrix: + os: [macOS-12, ubuntu-latest] + python-version: ["3.11", "3.12"] + pydantic-version: ["2"] + include-rdkit: [true] + include-openeye: [false] + include-dgl: [true] - steps: - - uses: actions/checkout@v4 - - name: Build information - run: | - uname -a - df -h - ulimit -a + steps: + - uses: actions/checkout@v4 - - name: Install environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: devtools/conda-envs/examples_env.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} + - name: Build information + run: | + uname -a + df -h + ulimit -a - - name: Install package - run: | - python -m pip install . --no-deps + - name: Install environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/conda-envs/examples_env.yaml + create-args: >- + python=${{ matrix.python-version }} + pydantic=${{ matrix.pydantic-version }} - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} + - name: Install package + run: | + python -m pip install . --no-deps - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: conda remove --force rdkit --yes || echo "rdkit not installed" + + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" - - name: Python information - run: | - which python - conda info - conda list + - name: Uninstall RDKit + if: matrix.include-rdkit == false + run: conda remove --force rdkit --yes || echo "rdkit not installed" + + - name: Python information + run: | + which python + conda info + conda list - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - name: Run example notebooks - run: | - python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --dist loadscope examples + - name: Run example notebooks + run: | + python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --dist loadscope examples From 45e4de111128b1647dcb0f668551dc4b56741675 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 15:36:40 +1100 Subject: [PATCH 03/14] Disable progress bar in electric field example --- .../train-gnn-to-electric-field.ipynb | 1903 ++++------------- 1 file changed, 368 insertions(+), 1535 deletions(-) diff --git a/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb b/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb index a45ae887..8ec653f1 100644 --- a/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb +++ b/examples/train-gnn-to-electric-field/train-gnn-to-electric-field.ipynb @@ -21,7 +21,20 @@ "cell_type": "code", "execution_count": 1, "id": "522bc606-c1aa-4cc7-89da-87440c61f8ba", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:39:01.803451Z", + "iopub.status.busy": "2024-11-12T03:39:01.803352Z", + "iopub.status.idle": "2024-11-12T03:39:04.043969Z", + "shell.execute_reply": "2024-11-12T03:39:04.043614Z", + "shell.execute_reply.started": "2024-11-12T03:39:01.803438Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "import tqdm\n", @@ -46,7 +59,13 @@ { "cell_type": "markdown", "id": "097895ad-685b-4825-8c22-1a0f79467e9d", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## Generate and format training data\n", "\n", @@ -59,17 +78,21 @@ "cell_type": "code", "execution_count": 2, "id": "964318ce-9e08-4551-9af4-dc49ea89d027", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING: This client version is newer than the server version. This may work if the versions are close, but expect exceptions and errors if attempting things the server does not support. client version: 0.56, server version: 0.55\n", - "WARNING: This client version is newer than the server version. This may work if the versions are close, but expect exceptions and errors if attempting things the server does not support. client version: 0.56, server version: 0.55\n" - ] - } - ], + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:39:04.044736Z", + "iopub.status.busy": "2024-11-12T03:39:04.044463Z", + "iopub.status.idle": "2024-11-12T03:42:11.995381Z", + "shell.execute_reply": "2024-11-12T03:42:11.995072Z", + "shell.execute_reply.started": "2024-11-12T03:39:04.044721Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], "source": [ "qc_client = PortalClient(\"https://api.qcarchive.molssi.org:443\", cache_dir=\".\")\n", "\n", @@ -86,7 +109,13 @@ { "cell_type": "markdown", "id": "54235869-1a60-4945-967d-602ef1f49185", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Converting to MoleculeESPRecords\n", "\n", @@ -97,13 +126,26 @@ "cell_type": "code", "execution_count": 3, "id": "25f9db71-4738-4431-9e65-7c0b015b40b4", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:42:11.995906Z", + "iopub.status.busy": "2024-11-12T03:42:11.995798Z", + "iopub.status.idle": "2024-11-12T03:47:20.452022Z", + "shell.execute_reply": "2024-11-12T03:47:20.451739Z", + "shell.execute_reply.started": "2024-11-12T03:42:11.995894Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [04:36<00:00, 5.52s/it]\n" + "100%|███████████████████████████████████████████████████████████████| 50/50 [05:08<00:00, 6.17s/it]\n" ] } ], @@ -128,7 +170,13 @@ { "cell_type": "markdown", "id": "9dc86d0a-c59e-4f8f-93c7-3b74adb6636e", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Convert to PyArrow dataset\n", "\n", @@ -142,13 +190,26 @@ "cell_type": "code", "execution_count": 4, "id": "70634680-8249-49f6-ad24-bc5178851360", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:20.452773Z", + "iopub.status.busy": "2024-11-12T03:47:20.452478Z", + "iopub.status.idle": "2024-11-12T03:47:20.578505Z", + "shell.execute_reply": "2024-11-12T03:47:20.578270Z", + "shell.execute_reply.started": "2024-11-12T03:47:20.452758Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:00<00:00, 447.17it/s]\n" + "100%|██████████████████████████████████████████████████████████████| 50/50 [00:00<00:00, 421.81it/s]\n" ] }, { @@ -161,9 +222,9 @@ "prediction_vector: list\n", " child 0, item: double\n", "----\n", - "mapped_smiles: [[\"[H:1][C:2](=[O:3])[C:4]1=[C:9]([C:7](=[N:6][S:5]1)[Br:8])[Br:10]\",\"[H:1][C:2](=[O:3])[C:4]1=[C:5]([N:7]=[C:8]([N:10]1[H:11])[Br:9])[Br:6]\",\"[H:1][C:2](=[O:3])[C:4]1=[C:10]([N:8]([C:6](=[N:5]1)[Br:7])[H:9])[Br:11]\",\"[H:1][C:2](=[O:3])[C:4]1=[C:9]([S:8][N:7]=[C:5]1[Br:6])[Br:10]\",\"[H:1][C:2](=[O:3])[C:4]1=[N:5][S:6][C:7](=[C:9]1[Br:10])[Br:8]\",...,\"[H:4][c:3]1[c:2]([c:20]([c:18]([c:16]([c:5]1[C:6]([H:7])([C:8]([H:9])([H:10])[H:11])[N+:12]([H:13])([H:14])[H:15])[Br:17])[H:19])[Br:21])[H:1]\",\"[H:1][c:2]1[c:19]([c:9]([c:7]([c:5]([c:3]1[H:4])[Br:6])[Br:8])[C:10]([H:11])([C:15]([H:16])([H:17])[H:18])[N:12]([H:13])[H:14])[H:20]\",\"[H:1][c:2]1[c:20]([c:9]([c:7]([c:5]([c:3]1[H:4])[Br:6])[Br:8])[C:10]([H:11])([C:12]([H:13])([H:14])[H:15])[N+:16]([H:17])([H:18])[H:19])[H:21]\",\"[H:4][c:3]1[c:2]([c:22]([c:20]([c:18]([c:5]1[C:6]([H:7])([H:8])[N:9]([H:10])[C:11]([H:12])([H:13])[C:14]([H:15])([H:16])[H:17])[H:19])[Br:21])[Br:23])[H:1]\",\"[H:4][c:3]1[c:2]([c:22]([c:20]([c:18]([c:5]1[C:6]([H:7])([H:8])[N:9]([H:10])[C:11]([H:12])([H:13])[C:14]([H:15])([H:16])[H:17])[H:19])[Br:21])[Br:23])[H:1]\"]]\n", - "precursor_matrix: [[[0.5268278695916089,0.3663918376587872,0.30209382642805216,0.24952373167995737,0.20284281127461076,...,0.12682386926954425,0.17299639848680223,0.14835260748248824,0.22417394022165082,0.31729613836761544],[0.5459961499174945,0.3811772132544467,0.310495392830858,0.26421186900748445,0.16815883207694643,...,0.1959073125648948,0.2712204910932398,0.2018013854288873,0.3843880654806236,0.5473435022093819],...,[0.5188600228738232,0.36372757615732326,0.27049010438839094,0.2625940436429743,0.1744397734479557,...,0.10263580193044784,0.18779157315897135,0.16465862132957662,0.24504157435453747,0.34126749604041895],[0.523471022948499,0.3711542616380526,0.2768487697745459,0.26502768742612426,0.17897523760699538,...,0.10483875445263033,0.18971891584707673,0.16387162999092086,0.24867226425516173,0.3443168978222578]]]\n", - "prediction_vector: [[[0.06806112259081701,0.030716434587978025,-0.016729472006731878,0.029951025414986638,0.029496272551505647,-0.0024857716639207815,0.005087538225819736,-0.004348276082205866,0.013868185380437326,-0.0003752919418263855],[0.06562099527752072,0.022540831241458854,-0.03627159213493826,0.030697369204467136,-0.003824835345860035,-0.022952256996058556,-0.013973378103473662,0.024411442114600782,0.020922857209616338,0.06615881080418917,0.12160304322089216],...,[0.022271980401278424,0.0056816366203780245,0.016862184483462814,0.036808512643687834,0.013646974537450432,...,0.0024587377823627682,-0.015963611907693187,-0.028345562608464187,-0.014267070720150517,-0.0268968083285119],[0.020751052712825666,0.0033002036503013057,0.009596814898405207,0.01807019115329054,0.01444660212469153,...,0.02400538665376119,-0.013272983985162003,-0.026300857709583143,-0.01412185316045618,-0.026633251145107114]]]" + "mapped_smiles: [[\"[H:1][C:2](=[O:3])[C:4]1=[C:9]([Br:10])[C:7]([Br:8])=[N:6][S:5]1\",\"[H:1][C:2](=[O:3])[C:4]1=[C:5]([Br:6])[N:7]=[C:8]([Br:9])[N:10]1[H:11]\",\"[H:1][C:2](=[O:3])[C:4]1=[C:10]([Br:11])[N:8]([H:9])[C:6]([Br:7])=[N:5]1\",\"[H:1][C:2](=[O:3])[C:4]1=[C:9]([Br:10])[S:8][N:7]=[C:5]1[Br:6]\",\"[H:1][C:2](=[O:3])[C:4]1=[N:5][S:6][C:7]([Br:8])=[C:9]1[Br:10]\",...,\"[H:1][c:2]1[c:3]([H:4])[c:5]([C:6]([H:7])([C:8]([H:9])([H:10])[H:11])[N+:12]([H:13])([H:14])[H:15])[c:16]([Br:17])[c:18]([H:19])[c:20]1[Br:21]\",\"[H:1][c:2]1[c:3]([H:4])[c:5]([Br:6])[c:7]([Br:8])[c:9]([C:10]([H:11])([N:12]([H:13])[H:14])[C:15]([H:16])([H:17])[H:18])[c:19]1[H:20]\",\"[H:1][c:2]1[c:3]([H:4])[c:5]([Br:6])[c:7]([Br:8])[c:9]([C:10]([H:11])([C:12]([H:13])([H:14])[H:15])[N+:16]([H:17])([H:18])[H:19])[c:20]1[H:21]\",\"[H:1][c:2]1[c:3]([H:4])[c:5]([C:6]([H:7])([H:8])[N:9]([H:10])[C:11]([H:12])([H:13])[C:14]([H:15])([H:16])[H:17])[c:18]([H:19])[c:20]([Br:21])[c:22]1[Br:23]\",\"[H:1][c:2]1[c:3]([H:4])[c:5]([C:6]([H:7])([H:8])[N:9]([H:10])[C:11]([H:12])([H:13])[C:14]([H:15])([H:16])[H:17])[c:18]([H:19])[c:20]([Br:21])[c:22]1[Br:23]\"]]\n", + "precursor_matrix: [[[0.5268278695916088,0.3663918376587869,0.30209382642805216,0.2495237316799569,0.20284281127461032,...,0.12682386926954417,0.1729963984868022,0.14835260748248816,0.22417394022165088,0.3172961383676153],[0.5459961499174948,0.3811772132544468,0.3104953928308583,0.26421186900748456,0.16815883207694643,...,0.19590731256489477,0.2712204910932398,0.20180138542888734,0.3843880654806236,0.547343502209382],...,[0.5188600228738238,0.36372757615732254,0.2704901043883896,0.26259404364297456,0.174439773447956,...,0.10263580193044784,0.18779157315897133,0.1646586213295766,0.24504157435453758,0.34126749604041884],[0.5234710229484995,0.3711542616380525,0.27684876977454587,0.26502768742612326,0.1789752376069953,...,0.1048387544526304,0.18971891584707684,0.16387162999092092,0.24867226425516167,0.3443168978222574]]]\n", + "prediction_vector: [[[0.06806112259087671,0.030716434588028432,-0.01672947200663685,0.029951025414965547,0.029496272551447888,-0.0024857716640091427,0.005087538225717987,-0.0043482760823769845,0.013868185380384116,-0.00037529194184321565],[0.06562099527727273,0.022540831241202333,-0.036271592135264416,0.030697369204302098,-0.003824835345960371,-0.022952256996007787,-0.013973378103587722,0.02441144211448937,0.02092285720950078,0.06615881080407054,0.12160304322077782],...,[0.022271980401070538,0.005681636620152487,0.016862184483217153,0.03680851264345411,0.013646974537191332,...,0.002458737782103706,-0.015963611907879226,-0.02834556260852975,-0.014267070720346707,-0.026896808328652506],[0.02075105271295132,0.0033002036504139556,0.009596814898498528,0.018070191153379336,0.014446602124759561,...,0.0240053866538266,-0.013272983985113784,-0.02630085770960776,-0.01412185316036113,-0.02663325114497883]]]" ] }, "execution_count": 4, @@ -219,7 +280,20 @@ "cell_type": "code", "execution_count": 5, "id": "72a9cdce-5411-4fe3-b2ea-46fb63e09d2c", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:20.578981Z", + "iopub.status.busy": "2024-11-12T03:47:20.578866Z", + "iopub.status.idle": "2024-11-12T03:47:20.582474Z", + "shell.execute_reply": "2024-11-12T03:47:20.582244Z", + "shell.execute_reply.started": "2024-11-12T03:47:20.578968Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "pq.write_table(training_table, \"training_dataset_table.parquet\")\n", @@ -233,7 +307,13 @@ { "cell_type": "markdown", "id": "4682e8cb-fba8-4cec-97b0-4d996e24ecf9", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "## Set up for training a GNN" ] @@ -242,7 +322,20 @@ "cell_type": "code", "execution_count": 6, "id": "3d3c909f-c1b9-44e0-86e0-d4ccf6ceb996", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:20.583457Z", + "iopub.status.busy": "2024-11-12T03:47:20.583351Z", + "iopub.status.idle": "2024-11-12T03:47:21.655807Z", + "shell.execute_reply": "2024-11-12T03:47:21.655393Z", + "shell.execute_reply.started": "2024-11-12T03:47:20.583445Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from openff.nagl.config import (\n", @@ -270,7 +363,13 @@ { "cell_type": "markdown", "id": "88be032d-0101-479e-a468-2c5db34600fc", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Defining the training config\n", "\n", @@ -284,7 +383,20 @@ "cell_type": "code", "execution_count": 7, "id": "f7ddfbde-1349-42ec-a2aa-0f9ead097e99", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.656481Z", + "iopub.status.busy": "2024-11-12T03:47:21.656171Z", + "iopub.status.idle": "2024-11-12T03:47:21.659526Z", + "shell.execute_reply": "2024-11-12T03:47:21.659243Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.656466Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "atom_features = [\n", @@ -342,7 +454,13 @@ { "cell_type": "markdown", "id": "a68f7b57-a1f7-43f4-ba2d-9579dd9562db", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "#### Defining a DataConfig\n", "\n", @@ -353,7 +471,20 @@ "cell_type": "code", "execution_count": 8, "id": "bf524fad-42e5-4020-a9d9-90a56343b7a1", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.660004Z", + "iopub.status.busy": "2024-11-12T03:47:21.659897Z", + "iopub.status.idle": "2024-11-12T03:47:21.668487Z", + "shell.execute_reply": "2024-11-12T03:47:21.668229Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.659991Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "target = GeneralLinearFitTarget(\n", @@ -392,7 +523,13 @@ { "cell_type": "markdown", "id": "cfd8bba9-241c-4c67-8f88-a89ae608ec89", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "#### Defining an OptimizerConfig\n", "\n", @@ -403,7 +540,20 @@ "cell_type": "code", "execution_count": 9, "id": "1759ed0f-2e89-4d22-80ae-2c0ba04f37a0", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.668916Z", + "iopub.status.busy": "2024-11-12T03:47:21.668809Z", + "iopub.status.idle": "2024-11-12T03:47:21.676788Z", + "shell.execute_reply": "2024-11-12T03:47:21.676523Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.668903Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "optimizer_config = OptimizerConfig(optimizer=\"Adam\", learning_rate=0.001)" @@ -412,7 +562,13 @@ { "cell_type": "markdown", "id": "7c784871-e834-470e-a346-bde893326fee", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "#### Creating a TrainingConfig" ] @@ -421,7 +577,20 @@ "cell_type": "code", "execution_count": 10, "id": "f5958818-03ef-4580-9cbf-c588cbb3141f", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.677234Z", + "iopub.status.busy": "2024-11-12T03:47:21.677133Z", + "iopub.status.idle": "2024-11-12T03:47:21.684364Z", + "shell.execute_reply": "2024-11-12T03:47:21.684055Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.677222Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "training_config = TrainingConfig(\n", @@ -434,7 +603,13 @@ { "cell_type": "markdown", "id": "17d61258-fe16-4993-9c19-57118c9d0a1a", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "### Creating a TrainingGNNModel\n", "\n", @@ -445,7 +620,20 @@ "cell_type": "code", "execution_count": 11, "id": "3eefcea4-2e9a-4e4a-b3fc-939f3f733fb8", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.684805Z", + "iopub.status.busy": "2024-11-12T03:47:21.684705Z", + "iopub.status.idle": "2024-11-12T03:47:21.919136Z", + "shell.execute_reply": "2024-11-12T03:47:21.918838Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.684792Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [ { "data": { @@ -502,7 +690,13 @@ { "cell_type": "markdown", "id": "d696dae6-93ce-4f0a-ab0f-ebb7e72fa176", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "We can look at the initial capabilities of the model by comparing its charges to AM1-BCC charges. They're pretty bad." ] @@ -511,14 +705,27 @@ "cell_type": "code", "execution_count": 12, "id": "adb99158-fa97-412d-972b-89f6f563b84a", - "metadata": {}, + "metadata": { + "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:21.919640Z", + "iopub.status.busy": "2024-11-12T03:47:21.919528Z", + "iopub.status.idle": "2024-11-12T03:47:22.209956Z", + "shell.execute_reply": "2024-11-12T03:47:22.209704Z", + "shell.execute_reply.started": "2024-11-12T03:47:21.919625Z" + }, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [ { "data": { "text/plain": [ - "array([-0.0422502 , -0.05428261, 0.15142802, -0.42682151, 0.09391647,\n", - " 0.09391647, 0.09391647, 0.2050635 , 0.2050635 , -0.15997499,\n", - " -0.15997499])" + "array([-0.07757042, -0.04149809, -0.05459142, -0.10976206, 0.02205708,\n", + " 0.02205708, 0.02205708, -0.22072439, -0.22072439, 0.3293481 ,\n", + " 0.3293481 ])" ] }, "execution_count": 12, @@ -570,6 +777,13 @@ "id": "5bfcbce1-8323-4403-a607-89292681375b", "metadata": { "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:22.210455Z", + "iopub.status.busy": "2024-11-12T03:47:22.210338Z", + "iopub.status.idle": "2024-11-12T03:47:22.212075Z", + "shell.execute_reply": "2024-11-12T03:47:22.211832Z", + "shell.execute_reply.started": "2024-11-12T03:47:22.210441Z" + }, "slideshow": { "slide_type": "" }, @@ -583,30 +797,54 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "c8cb0a08-eea6-41e4-9fd6-158204e26e79", "metadata": { "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:22.212508Z", + "iopub.status.busy": "2024-11-12T03:47:22.212401Z", + "iopub.status.idle": "2024-11-12T03:47:22.230803Z", + "shell.execute_reply": "2024-11-12T03:47:22.230576Z", + "shell.execute_reply.started": "2024-11-12T03:47:22.212495Z" + }, "slideshow": { "slide_type": "" }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:pytorch_lightning.utilities.rank_zero:GPU available: False, used: False\n", + "INFO:pytorch_lightning.utilities.rank_zero:TPU available: False, using: 0 TPU cores\n", + "INFO:pytorch_lightning.utilities.rank_zero:HPU available: False, using: 0 HPUs\n" + ] + } + ], "source": [ "trainer = pl.Trainer(\n", " max_epochs=100,\n", - " # callbacks=[TQDMProgressBar()], # add progress bar\n", - " accelerator=\"cpu\"\n", + " accelerator=\"cpu\",\n", + " enable_progress_bar=False, # Comment this out to monitor progress\n", ")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "f8846142-77f2-4d60-a74e-c3bc3c3ed3ee", "metadata": { "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:22.231217Z", + "iopub.status.busy": "2024-11-12T03:47:22.231114Z", + "iopub.status.idle": "2024-11-12T03:47:22.232787Z", + "shell.execute_reply": "2024-11-12T03:47:22.232524Z", + "shell.execute_reply.started": "2024-11-12T03:47:22.231204Z" + }, "slideshow": { "slide_type": "" }, @@ -619,10 +857,17 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 16, "id": "4e0174d7-a57b-49d9-89a3-5c756adc0d8c", "metadata": { "editable": true, + "execution": { + "iopub.execute_input": "2024-11-12T03:47:22.233391Z", + "iopub.status.busy": "2024-11-12T03:47:22.233232Z", + "iopub.status.idle": "2024-11-12T03:47:47.501666Z", + "shell.execute_reply": "2024-11-12T03:47:47.501347Z", + "shell.execute_reply.started": "2024-11-12T03:47:22.233369Z" + }, "slideshow": { "slide_type": "" }, @@ -633,27 +878,30 @@ "name": "stderr", "output_type": "stream", "text": [ - "GPU available: True (mps), used: False\n", - "TPU available: False, using: 0 TPU cores\n", - "HPU available: False, using: 0 HPUs\n", - "/Users/lily/micromamba/envs/train-gnn-to-electric-field/lib/python3.12/site-packages/pytorch_lightning/trainer/setup.py:177: GPU available but not used. You can set it by doing `Trainer(accelerator='gpu')`.\n", "Featurizing dataset: 0it [00:00, ?it/s]\n", - "Featurizing batch: 0%| | 0/40 [00:00 Date: Tue, 12 Nov 2024 15:39:11 +1100 Subject: [PATCH 04/14] Use macos-latest instead of macos-12 --- .github/workflows/examples-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index bacb6515..cda1c20b 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macOS-12, ubuntu-latest] + os: [macOS-latest, ubuntu-latest] python-version: ["3.11", "3.12"] pydantic-version: ["2"] include-rdkit: [true] From 691ebfff5ac41dc140467760f10fdd0642e66009 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 16:23:04 +1100 Subject: [PATCH 05/14] conda -> micromamba in examples CI --- .github/workflows/examples-ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index cda1c20b..7119b457 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -68,17 +68,17 @@ jobs: - name: Uninstall OpenEye if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" + run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" - name: Uninstall RDKit if: matrix.include-rdkit == false - run: conda remove --force rdkit --yes || echo "rdkit not installed" + run: micromamba remove --force rdkit --yes || echo "rdkit not installed" - name: Python information run: | which python - conda info - conda list + micromamba info + micromamba list - name: Check toolkit installations shell: bash -l -c "python -u {0}" From 2d183ded91ad2eaf0a8abb35c2417a6fa7623f0a Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 16:48:23 +1100 Subject: [PATCH 06/14] Update setup-micromamba to v2 --- .github/workflows/examples-ci.yaml | 102 ++++++++++++++--------------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index 7119b457..3546574f 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -28,65 +28,63 @@ jobs: name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false - matrix: - os: [macOS-latest, ubuntu-latest] - python-version: ["3.11", "3.12"] - pydantic-version: ["2"] - include-rdkit: [true] - include-openeye: [false] - include-dgl: [true] - + fail-fast: false + matrix: + os: [macOS-latest, ubuntu-latest] + python-version: ["3.11", "3.12"] + pydantic-version: ["2"] + include-rdkit: [true] + include-openeye: [false] + include-dgl: [true] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + + - name: Build information + run: | + uname -a + df -h + ulimit -a - - name: Build information - run: | - uname -a - df -h - ulimit -a + - name: Install environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: devtools/conda-envs/examples_env.yaml + create-args: >- + python=${{ matrix.python-version }} + pydantic=${{ matrix.pydantic-version }} - - name: Install environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: devtools/conda-envs/examples_env.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} + - name: Install package + run: | + python -m pip install . --no-deps - - name: Install package - run: | - python -m pip install . --no-deps + - uses: ./.github/actions/include-openeye + if: matrix.include-openeye == true + with: + openeye-license-text: ${{ secrets.OE_LICENSE }} + openeye-license-file: ${{ env.OE_LICENSE }} - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} + - name: Uninstall OpenEye + if: matrix.include-openeye == false + run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" + - name: Uninstall RDKit + if: matrix.include-rdkit == false + run: micromamba remove --force rdkit --yes || echo "rdkit not installed" - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: micromamba remove --force rdkit --yes || echo "rdkit not installed" - - - name: Python information - run: | - which python - micromamba info - micromamba list + - name: Python information + run: | + which python + micromamba info + micromamba list - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' + - name: Check toolkit installations + shell: bash -l -c "python -u {0}" + run: | + from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE + assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' + assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - name: Run example notebooks - run: | - python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --dist loadscope examples + - name: Run example notebooks + run: | + python -m pytest -r fE -v -x --tb=short -nauto --nbval-lax --dist loadscope examples From 75adacad418b9163053038531d0fc6f91ae15ef0 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 12 Nov 2024 16:48:52 +1100 Subject: [PATCH 07/14] Remove defaults channel from examples environment --- devtools/conda-envs/examples_env.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/devtools/conda-envs/examples_env.yaml b/devtools/conda-envs/examples_env.yaml index e0d83e0c..eabe0639 100644 --- a/devtools/conda-envs/examples_env.yaml +++ b/devtools/conda-envs/examples_env.yaml @@ -1,7 +1,6 @@ name: openff-nagl-test channels: - conda-forge - - defaults dependencies: # Base depends - python @@ -42,7 +41,6 @@ dependencies: # compatibility - apsw >=3.42 - # CI - nbval - pytest From 8870d78ad2232755eb34f8e16c7dabe6b41ba51f Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 12 Nov 2024 18:37:24 +1100 Subject: [PATCH 08/14] try telling pytorch not to use mps --- .github/workflows/examples-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index 3546574f..70eb31bd 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -22,6 +22,7 @@ defaults: env: OE_LICENSE: ${{ github.workspace }}/oe_license.txt + PYTORCH_ENABLE_MPS_FALLBACK: 0 jobs: example_tests: From ecf8cbd4757534397ef3d8f3d7a7090a6d98e2e3 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Thu, 30 Jan 2025 08:22:52 -0600 Subject: [PATCH 09/14] Drop Pydantic from CI --- .github/workflows/examples-ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/examples-ci.yaml b/.github/workflows/examples-ci.yaml index 70eb31bd..711e0dc3 100644 --- a/.github/workflows/examples-ci.yaml +++ b/.github/workflows/examples-ci.yaml @@ -26,14 +26,13 @@ env: jobs: example_tests: - name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} + name: Examples CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macOS-latest, ubuntu-latest] python-version: ["3.11", "3.12"] - pydantic-version: ["2"] include-rdkit: [true] include-openeye: [false] include-dgl: [true] @@ -53,7 +52,6 @@ jobs: environment-file: devtools/conda-envs/examples_env.yaml create-args: >- python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} - name: Install package run: | From 211629ecec6af0e81a14960f80b6084e90f3750b Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Thu, 30 Jan 2025 17:44:05 -0600 Subject: [PATCH 10/14] Add GPU-enabled CI (#170) * Add GPU-enabled CI * Update file reference * Remove other CI * Bump runner version * Try allocating 10 GB * Debug * Debug * Sync CUDA environment with DGL environment * Debug Torch/CUDA interaction * Try adding `pytorch-gpu` * Debug * tmp add print and trial test * check dgl * add torchdata package * add other torch packages required * Try bumping to newer DGL channel targeting PyTorch 2.1 * Add back `pytorch-gpu`? * Revert "tmp add print and trial test" This reverts commit 6c5f42cc4b7458264718af29f75bcc699ab4b276. * Revert more temporary changes, fix coverage * Syntax * Debug * Debug * Fix --------- Co-authored-by: Lily Wang --- .github/workflows/base-ci.yaml | 3 +- .github/workflows/dev-ci.yaml | 2 +- .github/workflows/gh-ci.yaml | 8 +-- .github/workflows/gpu.yaml | 98 ++++++++++++++++++++++++++ devtools/conda-envs/test_cuda_env.yaml | 12 ++-- 5 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/gpu.yaml diff --git a/.github/workflows/base-ci.yaml b/.github/workflows/base-ci.yaml index f6fcac98..b5d29d20 100644 --- a/.github/workflows/base-ci.yaml +++ b/.github/workflows/base-ci.yaml @@ -73,5 +73,4 @@ jobs: assert str(RDKIT_AVAILABLE).lower() == 'true' - name: Run tests - run: | - python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/ + run: python -m pytest -n logical --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ diff --git a/.github/workflows/dev-ci.yaml b/.github/workflows/dev-ci.yaml index 6b4e4407..40e9b868 100644 --- a/.github/workflows/dev-ci.yaml +++ b/.github/workflows/dev-ci.yaml @@ -106,5 +106,5 @@ jobs: - name: Run tests run: | - python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/ + python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index e842ff2c..55027c81 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -68,7 +68,6 @@ jobs: openeye-license-text: ${{ secrets.OE_LICENSE }} openeye-license-file: ${{ env.OE_LICENSE }} - - name: Uninstall OpenEye if: matrix.include-openeye == false run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" @@ -98,16 +97,15 @@ jobs: - name: Run tests run: | - python -m pytest -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/ + python -m pytest -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - name: codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml + files: ./coverage.xml verbose: True # name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} - pylint_check: runs-on: ubuntu-latest diff --git a/.github/workflows/gpu.yaml b/.github/workflows/gpu.yaml new file mode 100644 index 00000000..d1d4d751 --- /dev/null +++ b/.github/workflows/gpu.yaml @@ -0,0 +1,98 @@ +name: GPU-enabled CI +on: + workflow_dispatch: + pull_request: + branches: + - "main" + +defaults: + run: + shell: bash -l {0} + +jobs: + start-aws-runner: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + outputs: + mapping: ${{ steps.aws-start.outputs.mapping }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role + aws-region: us-east-1 + - name: Create cloud runner + id: aws-start + uses: omsf-eco-infra/gha-runner@v0.4.0 + with: + provider: "aws" + action: "start" + aws_image_id: ami-0d5079d9be06933e5 + aws_instance_type: g4dn.xlarge + # IAM default might be 5 GB? + aws_root_device_size: 125 + aws_region_name: us-east-1 + aws_home_dir: /home/ubuntu + env: + GH_PAT: ${{ secrets.GH_PAT }} + self-hosted-test: + runs-on: self-hosted + needs: + - start-aws-runner + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Print disk usage + run: "df -h" + + - name: Print Docker details + run: "docker version || true" + + - name: Setup Conda Environment + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: devtools/conda-envs/test_cuda_env.yaml + + - name: Install Package + run: python -m pip install . --no-deps + + - name: Double-check local installation + run: python -c "from openff.nagl import __version__; print(__version__)" + + - name: Check that PyTorch can see CUDA + run: python -c "import torch; assert torch.cuda.is_available()" + + - name: Check we can see DGL + run: python -c "import dgl; print(dgl.__version__)" + + - name: Run tests + run: python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ + + stop-aws-runner: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + needs: + - start-aws-runner + - self-hosted-test + if: ${{ always() }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role + aws-region: us-east-1 + - name: Stop instances + uses: omsf-eco-infra/gha-runner@v0.4.0 + with: + provider: "aws" + action: "stop" + instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }} + aws_region_name: us-east-1 + env: + GH_PAT: ${{ secrets.GH_PAT }} diff --git a/devtools/conda-envs/test_cuda_env.yaml b/devtools/conda-envs/test_cuda_env.yaml index 06e6ece0..cfb22a3e 100644 --- a/devtools/conda-envs/test_cuda_env.yaml +++ b/devtools/conda-envs/test_cuda_env.yaml @@ -2,7 +2,7 @@ name: openff-nagl-test-cuda channels: - openeye - - dglteam/label/cu117 + - dglteam/label/th21_cu118 - pytorch - nvidia - conda-forge @@ -29,10 +29,14 @@ dependencies: # gcn - cudatoolkit - - dgl ==1.1.2 - - pytorch >=2.0 + - dgl ~=2.1 + - torchdata + - torchvision + - torchaudio + - pytorch ==2.1 + - pytorch-gpu # is effectively a subpackage? - pytorch-lightning - - pytorch-cuda ==11.7 + - pytorch-cuda ==11.8 # parallelism - dask-jobqueue From b901b1d0ab083af5119cde1e06c27900f2a984e3 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:15:20 +1100 Subject: [PATCH 11/14] add weights_only=False (#183) * add weights_only=False * Revert "add weights_only=False" This reverts commit fb71d58f367eddf142b1ebd3433c0f92d2154c73. * Revert "Revert "add weights_only=False"" This reverts commit 6e19fb48a9e8cf6d350dabb74b7cc87bc9efecae. --- openff/nagl/nn/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openff/nagl/nn/_models.py b/openff/nagl/nn/_models.py index 5a05de2f..0c9b27e0 100644 --- a/openff/nagl/nn/_models.py +++ b/openff/nagl/nn/_models.py @@ -494,7 +494,7 @@ def load(cls, model: str, eval_mode: bool = True, **kwargs): models saved with ``torch.save``, as it expects a dictionary of hyperparameters and a state dictionary. """ - model_kwargs = torch.load(str(model), **kwargs) + model_kwargs = torch.load(str(model), weights_only=False, **kwargs) if isinstance(model_kwargs, dict): model = cls(**model_kwargs["hyperparameters"]) model.load_state_dict(model_kwargs["state_dict"]) From 6fb3ac099ca6faf8ecd4184f7547787f91e562a0 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:56:37 +1100 Subject: [PATCH 12/14] Add release notes for v0.5.2 (#185) --- docs/CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 15397391..61cacad4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,15 @@ The rules for this file: * accompany each entry with github issue/PR number (Issue #xyz) --> +## v0.5.2 -- 2025-02-14 + +### Fixed +- GNN.load loads models with `weights_only=False`, which was the default + way of loading in PyTorch pre v2.6. (Issue #181, PR #183) + +### Authors +- [@lilyminium] + ## v0.5.1 -- 2025-01-21 ### Changed From eeef0d077241fbf220b23b04d5a4143b2b8bf76d Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Thu, 6 Mar 2025 16:58:13 -0600 Subject: [PATCH 13/14] Constrain torchdata<=0.10.0 (#189) * Constrain torchdata<=0.10.0 * Also update examples environment --- devtools/conda-envs/examples_env.yaml | 3 +++ devtools/conda-envs/test_env_dgl_false.yaml | 3 +++ devtools/conda-envs/test_env_dgl_true.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/devtools/conda-envs/examples_env.yaml b/devtools/conda-envs/examples_env.yaml index eabe0639..597e8205 100644 --- a/devtools/conda-envs/examples_env.yaml +++ b/devtools/conda-envs/examples_env.yaml @@ -45,3 +45,6 @@ dependencies: - nbval - pytest - pytest-xdist + + # https://github.com/openforcefield/openff-docs/pull/81/files#diff-68677a278ca13dde111a8ae641890bc84d82d1a4e6922d4e498219d5127947c3R29-R30 + - torchdata<=0.10.0 diff --git a/devtools/conda-envs/test_env_dgl_false.yaml b/devtools/conda-envs/test_env_dgl_false.yaml index ebee3a64..ff03bf1e 100644 --- a/devtools/conda-envs/test_env_dgl_false.yaml +++ b/devtools/conda-envs/test_env_dgl_false.yaml @@ -36,3 +36,6 @@ dependencies: - pytest-cov - pytest-xdist - codecov + + # https://github.com/openforcefield/openff-docs/pull/81/files#diff-68677a278ca13dde111a8ae641890bc84d82d1a4e6922d4e498219d5127947c3R29-R30 + - torchdata<=0.10.0 diff --git a/devtools/conda-envs/test_env_dgl_true.yaml b/devtools/conda-envs/test_env_dgl_true.yaml index 9376d111..a6161e66 100644 --- a/devtools/conda-envs/test_env_dgl_true.yaml +++ b/devtools/conda-envs/test_env_dgl_true.yaml @@ -38,3 +38,5 @@ dependencies: - pytest-xdist - codecov + # https://github.com/openforcefield/openff-docs/pull/81/files#diff-68677a278ca13dde111a8ae641890bc84d82d1a4e6922d4e498219d5127947c3R29-R30 + - torchdata<=0.10.0 From cc30e0fe0f5bd78d18b551cffc72ff3aa991d89c Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Tue, 6 Jan 2026 12:46:17 -0600 Subject: [PATCH 14/14] Skip non-examples CI --- .github/workflows/base-ci.yaml | 76 -------------- .github/workflows/dev-ci.yaml | 110 ------------------- .github/workflows/gh-ci.yaml | 187 --------------------------------- .github/workflows/gpu.yaml | 102 ------------------ 4 files changed, 475 deletions(-) delete mode 100644 .github/workflows/base-ci.yaml delete mode 100644 .github/workflows/dev-ci.yaml delete mode 100644 .github/workflows/gh-ci.yaml delete mode 100644 .github/workflows/gpu.yaml diff --git a/.github/workflows/base-ci.yaml b/.github/workflows/base-ci.yaml deleted file mode 100644 index d7e95662..00000000 --- a/.github/workflows/base-ci.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: Base tests -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - main_tests: - name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, openeye=${{ matrix.include-openeye }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-latest, ubuntu-latest] - python-version: ["3.11", "3.12"] - include-openeye: [false, true] - - steps: - - uses: actions/checkout@v6 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/base.yaml - create-args: >- - python=${{ matrix.python-version }} - - - name: Install package - run: | - python -m pip install . --no-deps - - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: conda remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == 'true' - - - name: Run tests - run: python -m pytest -n logical --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ diff --git a/.github/workflows/dev-ci.yaml b/.github/workflows/dev-ci.yaml deleted file mode 100644 index bc042286..00000000 --- a/.github/workflows/dev-ci.yaml +++ /dev/null @@ -1,110 +0,0 @@ -name: Upstream nightly version CI -on: - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - workflow_dispatch: - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - DGL_HOME: ${{ github.workspace }}/dgl - -jobs: - nightly_check: - name: Nightly check - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-latest, ubuntu-latest] - python-version: ["3.11", "3.12"] - - steps: - - uses: actions/checkout@v6 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: devtools/conda-envs/nightly.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=2 - - - name: Install nightly pytorch - run: | - python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U - - - name: Download DGL source - run: | - git clone --recurse-submodules https://github.com/dmlc/dgl.git - - - name: Set up DGL - if: matrix.os != 'ubuntu-latest' - run: | - # from https://docs.dgl.ai/en/latest/install/index.html#macos - cd dgl/ - mkdir build && cd build - cmake -DUSE_OPENMP=off -DUSE_LIBXSMM=OFF .. - make -j4 - cd ../.. - - - name: Set up DGL (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - cd dgl/ - mkdir build && cd build - cmake -DBUILD_TYPE=dev -DUSE_CUDA=OFF -DUSE_LIBXSMM=OFF .. - make - cd ../.. - - - name: Install DGL Python bindings - run: | - cd dgl/python - python setup.py install - python setup.py build_ext --inplace - cd ../.. - - - uses: ./.github/actions/include-openeye - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == 'true' - assert str(RDKIT_AVAILABLE).lower() == 'true' - - - name: Check Python environment - run: | - pip list - - - name: Import DGL - run: | - python -c "import dgl; import dgl.nn" - - - name: Install package - run: | - python -m pip install . --no-deps - - - name: Run tests - run: | - python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml deleted file mode 100644 index a75ba3bc..00000000 --- a/.github/workflows/gh-ci.yaml +++ /dev/null @@ -1,187 +0,0 @@ -name: GH Actions CI -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - # weekly tests, Sundays at midnight - - cron: "0 0 * * 0" - -concurrency: - # Specific group naming so CI is only cancelled - # within same PR or on merge to main - group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} - cancel-in-progress: true - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - main_tests: - name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, rdkit=${{ matrix.include-rdkit }}, openeye=${{ matrix.include-openeye }}, dgl=${{ matrix.include-dgl }}), pydantic=${{ matrix.pydantic-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macOS-latest, ubuntu-latest] - python-version: ["3.11", "3.12"] - pydantic-version: ["1", "2"] - include-rdkit: [false, true] - include-openeye: [false, true] - include-dgl: [false, true] - exclude: - - include-rdkit: false - include-openeye: false - - - steps: - - uses: actions/checkout@v6 - - - name: Build information - run: | - uname -a - df -h - ulimit -a - - - name: Install environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/test_env_dgl_${{ matrix.include-dgl }}.yaml - create-args: >- - python=${{ matrix.python-version }} - pydantic=${{ matrix.pydantic-version }} - - - name: Install package - run: | - python -m pip install . --no-deps - - - uses: ./.github/actions/include-openeye - if: matrix.include-openeye == true - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - name: Uninstall OpenEye - if: matrix.include-openeye == false - run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed" - - - name: Uninstall RDKit - if: matrix.include-rdkit == false - run: micromamba remove --force rdkit --yes || echo "rdkit not installed" - - # See https://github.com/openforcefield/openff-nagl/issues/103 - - name: Rewrite DGL config - if: matrix.include-dgl == true - run: | - mkdir -p ~/.dgl - echo '{"backend": "pytorch"}' > ~/.dgl/config.json - - - name: Check toolkit installations - shell: bash -l -c "python -u {0}" - run: | - from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE - assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}' - assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}' - - - name: Check DGL installation - if: matrix.include-dgl == true - run: | - python -c "import dgl" - - - name: Run tests - run: | - python -m pytest -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - - - name: codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - verbose: True - # name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} - - pylint_check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.11" - - - name: Install Pylint - run: | - which pip - which python - pip install pylint - - - name: Run Pylint - env: - PYLINTRC: .pylintrc - run: | - pylint openff.nagl - - - pypi_check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.11" - - - name: Install dependencies - run: | - pip install setuptools twine - - - name: Build package - run: | - python3 -m pip install --upgrade build - python3 -m build - - - name: Check package build - run: | - DISTRIBUTION=$(ls -t1 dist/openff_nagl-*.tar.gz | head -n 1) - test -n "${DISTRIBUTION}" || { echo "no distribution dist/openff_nagl-*.tar.gz found"; exit 1; } - echo "twine check $DISTRIBUTION" - twine check $DISTRIBUTION - - install_from_source_conda: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.11", "3.12"] - - steps: - - uses: actions/checkout@v6 - - - name: Install conda - uses: mamba-org/setup-micromamba@v2 - with: - environment-name: openff-nagl - create-args: >- - python=${{ matrix.python-version }} - - - name: Build from source - run: | - micromamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml - python --version - python -m pip install . --no-deps - micromamba list - - - name: Check success - run: | - python -c "import openff.nagl ; print(openff.nagl.__version__)" diff --git a/.github/workflows/gpu.yaml b/.github/workflows/gpu.yaml deleted file mode 100644 index 910fc299..00000000 --- a/.github/workflows/gpu.yaml +++ /dev/null @@ -1,102 +0,0 @@ -name: GPU-enabled CI -on: - workflow_dispatch: - pull_request: - branches: - - "main" - -defaults: - run: - shell: bash -l {0} - -env: - OE_LICENSE: ${{ github.workspace }}/oe_license.txt - -jobs: - start-aws-runner: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - outputs: - mapping: ${{ steps.aws-start.outputs.mapping }} - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v5 - with: - role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role - aws-region: us-east-1 - - name: Create cloud runner - id: aws-start - uses: omsf/start-aws-gha-runner@v1.1.1 - with: - aws_image_id: ami-0d5079d9be06933e5 - aws_instance_type: g4dn.xlarge - # IAM default might be 5 GB? - aws_root_device_size: 125 - aws_region_name: us-east-1 - aws_home_dir: /home/ubuntu - env: - GH_PAT: ${{ secrets.GH_PAT }} - self-hosted-test: - runs-on: self-hosted - needs: - - start-aws-runner - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Print disk usage - run: "df -h" - - - name: Print Docker details - run: "docker version || true" - - - name: Setup Conda Environment - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: devtools/conda-envs/test_cuda_env.yaml - - - name: Install Package - run: python -m pip install . --no-deps - - - name: Double-check local installation - run: python -c "from openff.nagl import __version__; print(__version__)" - - - name: Check that PyTorch can see CUDA - run: python -c "import torch; assert torch.cuda.is_available()" - - - name: Check we can see DGL - run: python -c "import dgl; print(dgl.__version__)" - - - uses: ./.github/actions/include-openeye - with: - openeye-license-text: ${{ secrets.OE_LICENSE }} - openeye-license-file: ${{ env.OE_LICENSE }} - - - name: Run tests - run: python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ - - stop-aws-runner: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - needs: - - start-aws-runner - - self-hosted-test - if: ${{ always() }} - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v5 - with: - role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role - aws-region: us-east-1 - - name: Stop instances - uses: omsf/stop-aws-gha-runner@v1.0.0 - with: - instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }} - aws_region_name: us-east-1 - env: - GH_PAT: ${{ secrets.GH_PAT }}