Skip to content

Commit 81cfa46

Browse files
authored
test larger cpu runner (#1170)
* test larger cpu runner * update omsf runner version * nvidia-smi throws an error if there is no GPU * Try a large * just run slow tets * try xlarge (should fail but thats okay) * lets see if the intel flavor is any faster * see if this changes the runtime at all * go back to working runner instance type * bump size of disk * check time on a t3 med * try xlarge * try t3a.xlarge * now t3a.2xl * now t3.2xl * use platforms that actually will work * need empty set not dict * pin buggy mypy * fix mypy pin * see if large works * check t3.2xlarge * make sure we load the marks correctly * I think we are using the wrong instance family * don't run itergration tests on the CPU
1 parent 192b582 commit 81cfa46

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

.github/workflows/cpu-long-tests.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
uses: omsf/start-aws-gha-runner@v1.0.0
2222
with:
2323
aws_image_id: ami-0b7f661c228e6a4bb
24-
aws_instance_type: t3a.small # TODO try t3a.medium next
24+
aws_instance_type: c7i.xlarge
2525
aws_home_dir: /home/ubuntu
26+
aws_root_device_size: 125
2627
env:
2728
GH_PAT: ${{ secrets.GH_PAT }}
2829

@@ -46,9 +47,6 @@ jobs:
4647
- name: Print Docker details
4748
run: "docker version || true"
4849

49-
- name: Check for nvidia-smi
50-
run: "nvidia-smi"
51-
5250
- name: "Setup Micromamba"
5351
uses: mamba-org/setup-micromamba@v2
5452
with:
@@ -88,12 +86,11 @@ jobs:
8886
8987
- name: "Run tests"
9088
env:
91-
# Set the OFE_SLOW_TESTS to True if running a Cron job
9289
OFE_SLOW_TESTS: "true"
9390
DUECREDIT_ENABLE: 'yes'
9491
OFE_INTEGRATION_TESTS: FALSE
9592
run: |
96-
pytest -n logical -vv --durations=10
93+
pytest -n logical -vv --durations=10 openfecli/tests/ openfe/tests/
9794
9895
stop-aws-runner:
9996
runs-on: ubuntu-latest

.github/workflows/mypy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: "Install steps"
4444
run: |
4545
python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main
46-
python -m pip install mypy
46+
python -m pip install "mypy<1.16.0"
4747
python -m pip install types-setuptools
4848
python -m pip install --no-deps -e .
4949

openfe/tests/protocols/conftest.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def afe_solv_transformation_json() -> str:
223223
"""
224224
d = resources.files('openfe.tests.data.openmm_afe')
225225
fname = "AHFEProtocol_json_results.gz"
226-
226+
227227
with gzip.open((d / fname).as_posix(), 'r') as f: # type: ignore
228228
return f.read().decode() # type: ignore
229229

@@ -240,3 +240,31 @@ def md_json() -> str:
240240

241241
with gzip.open((d / fname).as_posix(), 'r') as f: # type: ignore
242242
return f.read().decode() # type: ignore
243+
244+
@pytest.fixture
245+
def get_available_openmm_platforms() -> set[str]:
246+
"""
247+
OpenMM Platforms that are available and functional on system
248+
"""
249+
import openmm
250+
from openmm import Platform
251+
# Get platforms that openmm was built with
252+
platforms = {Platform.getPlatform(i).getName() for i in range(Platform.getNumPlatforms())}
253+
254+
# Now check if we can actually use the platforms
255+
working_platforms = set()
256+
for platform in platforms:
257+
system = openmm.System()
258+
system.addParticle(1.0)
259+
integrator = openmm.VerletIntegrator(0.001)
260+
try:
261+
context = openmm.Context(system, integrator, Platform.getPlatformByName(platform))
262+
working_platforms.add(platform)
263+
del context
264+
except openmm.OpenMMException:
265+
continue
266+
finally:
267+
del system, integrator
268+
269+
270+
return working_platforms

openfe/tests/protocols/openmm_ahfe/test_ahfe_slow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
@pytest.mark.parametrize('platform', ['CPU', 'CUDA'])
1616
def test_openmm_run_engine(
1717
platform,
18-
available_platforms,
18+
get_available_openmm_platforms,
1919
benzene_modifications,
2020
tmpdir
2121
):
22-
if platform not in available_platforms:
22+
if platform not in get_available_openmm_platforms:
2323
pytest.skip(f"OpenMM Platform: {platform} not available")
2424

2525
# Run a really short calculation to check everything is going well

openfe/tests/protocols/openmm_rfe/test_hybrid_top_slow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
def test_openmm_run_engine(
1818
benzene_vacuum_system,
1919
platform,
20-
available_platforms,
20+
get_available_openmm_platforms,
2121
benzene_modifications,
2222
tmpdir
2323
):
24-
if platform not in available_platforms:
24+
if platform not in get_available_openmm_platforms:
2525
pytest.skip(f"OpenMM Platform: {platform} not available")
2626
# this test actually runs MD
2727
# these settings are a small self to self sim, that has enough eq that

0 commit comments

Comments
 (0)