Repository navigation
fix(lammps): load models on the GPU selected by Kokkos - #6154
Miller10101010 wants to merge 3 commits into
Conversation
for more information, see https://pre-commit.ci
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
OutisLi
left a comment
There was a problem hiding this comment.
The two model-loading paths now use the Kokkos device. The regression needs a way to actually run on the affected setup.
| if os.environ.get("DPA4SPIN_KOKKOS_REQUIRED") != "1": | ||
| pytest.skip("requires the matching Kokkos LAMMPS build") | ||
| torch = pytest.importorskip("torch") | ||
| if torch.cuda.device_count() < 2: |
There was a problem hiding this comment.
The hosted Kokkos test step sets CUDA_VISIBLE_DEVICES: 0, so the new cases always skip there, even on a runner with two physical GPUs. Please keep the ordinary one-GPU suite unchanged, but provide a dedicated/opt-in two-visible-device invocation for this test that fails rather than skips when validation is requested. If there is no suitable hosted runner, document the invocation and attach exact-head, non-skipped two-GPU results for both styles.
There was a problem hiding this comment.
Updated in e5d9d6d.
Added an opt-in two-GPU mode. I ran CUDA_VISIBLE_DEVICES=0,1 DEEPMD_KOKKOS_TWO_GPUS_REQUIRED=1 python -m pytest -q source/lmp/tests/test_kokkos_model_device.py on two AISI A800s with the matching Kokkos lmp on PATH. Both deepmd/kk and dpa4spin/kk reported the requested device for GPU 0 and GPU 1, and the energies and forces matched across devices (2 passed, 0 skipped). With only one GPU visible, both cases failed as intended.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6154 +/- ##
==========================================
- Coverage 78.09% 77.32% -0.77%
==========================================
Files 1214 1219 +5
Lines 147782 147555 -227
Branches 5246 5243 -3
==========================================
- Hits 115410 114104 -1306
- Misses 30392 31477 +1085
+ Partials 1980 1974 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
njzjz-bot
left a comment
There was a problem hiding this comment.
Python shard 8 fails all three test_kokkos_report_commands_preserve_pytest_status cases. The fixture executes only the shell tail under bash -euo pipefail, so it never runs the prologue that defines LAMMPS_BUILD_DIR, which the new PATH export reads. Please pass str(build / "lammps") in the fixture's subprocess environment and add test_kokkos_model_device.py to the stub's expected spin.xml test list. I ran the exact fixture function locally: all three cases failed before those two updates and passed after them, preserving both failure-propagation checks and the report inventory assertions. This checks the reporting harness only; the two-A800 validation is separate.
Agent: dot
Use the CUDA device selected by Kokkos when loading a model for
deepmd/kkordpa4spin/kk. This honors an explicit device selection even when it differs from the node-local MPI rank.Tested on a two-A800 node with a single rank explicitly selecting GPU 1. Both styles loaded on the selected device. Two regression tests passed, including energy and force comparisons on devices 0 and 1.
Closes #5994.
Summary by CodeRabbit