Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nightly tests #142

Merged
merged 27 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5eea53c
install pytorch before dgl?
lilyminium Oct 13, 2024
cdd1db1
check dgl is broken pre-repo install [skip ci]
lilyminium Oct 13, 2024
4a9a626
add a pip list to see whats installed
lilyminium Oct 14, 2024
928d113
switch to pip install [skip ci]
lilyminium Oct 14, 2024
0702355
try not installing pytorch specifically [skip ci]
lilyminium Oct 14, 2024
09ece25
work backwards [skip ci]
lilyminium Oct 14, 2024
f139736
add pytorch spec [skip ci]
lilyminium Oct 14, 2024
df3525a
build dgl from src [skip ci]
lilyminium Oct 16, 2024
eab1562
use own make build for both os [skip ci]
lilyminium Oct 16, 2024
9498efb
fix errors [skip ci]
lilyminium Oct 16, 2024
03a1366
add ubuntu back in? [skip ci]
lilyminium Oct 16, 2024
298e69b
fix schema [skip ci]
lilyminium Oct 16, 2024
bd42884
include openeye [skip ci]
lilyminium Oct 17, 2024
b0779cf
make import check more detailed [skip ci]
lilyminium Oct 17, 2024
ce31ec1
add dgl home variable [skip ci]
lilyminium Oct 17, 2024
ac2520f
update env variables [skip ci]
lilyminium Oct 17, 2024
064238e
fix case [skip ci]
lilyminium Oct 17, 2024
833edab
use pip to install pytorch [skip ci]
lilyminium Oct 17, 2024
f8c7344
lower pytorch versions [skip ci]
lilyminium Oct 17, 2024
211415a
split out ubuntu build [skip ci]
lilyminium Oct 17, 2024
faba53b
remove conda check [skip ci]
lilyminium Oct 17, 2024
7ccc3e0
unspecify openmm flag [skip ci]
lilyminium Oct 17, 2024
3ea33c7
fix get_schema call [skip ci]
lilyminium Oct 17, 2024
22ab13d
parallelize make [skip ci]
lilyminium Oct 17, 2024
2167475
huh. unparallelize make [skip ci]
lilyminium Oct 17, 2024
fd5e540
try switching back to pytorch nightly [skip ci]
lilyminium Oct 17, 2024
48057aa
only test on 3.11+ [skip ci]
lilyminium Oct 18, 2024
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
68 changes: 55 additions & 13 deletions .github/workflows/dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
defaults:
run:
shell: bash -l {0}

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
DGL_HOME: ${{ github.workspace }}/dgl

jobs:
nightly_check:
Expand All @@ -22,8 +26,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-12, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
os: [macOS-13, macOS-latest, ubuntu-latest]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -42,25 +46,63 @@ jobs:
python=${{ matrix.python-version }}
pydantic=2

- name: Install nightly pytorch-lightning and DGL
- name: Install nightly pytorch
run: |
python -m pip install --pre dgl -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install --pre dglgo -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U
python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U

- name: Install package
- name: Download DGL source
run: |
python -m pip install . --no-deps
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 ../..

- name: Python information
- 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: |
which python
conda info
conda list
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"
python -c "import dgl; import dgl.nn"

- name: Install package
run: |
python -m pip install . --no-deps

- name: Run tests
run: |
Expand Down
16 changes: 12 additions & 4 deletions devtools/conda-envs/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: openff-nagl-test
channels:
- openeye
- pytorch-nightly
- conda-forge
- pytorch-nightly
- defaults
dependencies:
# Base depends
Expand All @@ -18,13 +18,16 @@ dependencies:
- pydantic <3
- rdkit
- scipy
- openeye-toolkits

# gnn
- pytorch
- torchvision
- torchaudio

# database
- pyarrow

# gcn
- pytorch

# parallelism
- dask-jobqueue

Expand All @@ -49,6 +52,11 @@ dependencies:
- sqlite
- xmltodict

# building
- make
- cmake
- cython

# Pip-only installs
- pip:
- git+https://github.com/openforcefield/openff-utilities.git@main
Expand Down
10 changes: 8 additions & 2 deletions openff/nagl/nn/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,15 @@ class _LazyDGLMoleculeDataset(Dataset):

@property
def schema(self):
self.get_schema()

@classmethod
def get_schema(cls):
import pyarrow as pa

return pa.schema([pa.field("pickled", pa.binary())])



def __len__(self):
return self.n_entries
Expand Down Expand Up @@ -370,15 +376,15 @@ def from_arrow_dataset(
input_dataset = ds.dataset(path, format=format)

with pa.OSFile(str(output_path), "wb") as sink:
with pa.ipc.new_file(sink, cls.schema) as writer:
with pa.ipc.new_file(sink, cls.get_schema()) as writer:
input_batches = input_dataset.to_batches(columns=columns)
for input_batch in input_batches:
with get_mapper_to_processes(n_processes=n_processes) as mapper:
pickled = list(mapper(converter, input_batch.to_pylist()))

output_batch = pa.RecordBatch.from_arrays(
[pa.array(pickled)],
schema=cls.schema
schema=cls.get_schema()
)
writer.write_batch(output_batch)

Expand Down