Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI has no job that runs the mumax+ tests, because the hosted runners have no GPU (the only workflow today builds release wheels). This adds a separate, optional workflow (
gpu-sim.yml) that builds the Python package and runs the pytest suite on a simulated NVIDIA H100 provided by PantheonSim, via thepantheongpu/setup-pantheonsimaction (pinned by SHA). I am the author of PantheonSim, so please weigh this accordingly.It is not meant to be a required check, and it does not replace testing on real GPUs. A simulator cannot reproduce hardware-specific behavior or timing, so I see it as a way to catch CUDA-only breakage in pull requests when nobody has a GPU handy.
What it does
pip install .(both the single and double precision modules) and CUDA 13.0, then runspytest -m "not slow and not mumax3" testwithvgpu run.CMakeLists.txthardcodesCMAKE_CUDA_ARCHITECTURES native, which needs a GPU at configure time, so asedin the CI checkout replaces that line with90-virtualandCMAKE_CUDA_RUNTIME_LIBRARY Shared. No source file in the repository is changed. If you would rather have a CMake option for the architecture, I am happy to send that instead.src/cmdinstalls its executable to$CONDA_PREFIX/bin, so the job setsCONDA_PREFIXto its venv.library-path: 'false').workflow_dispatchandpull_requestagainstdev, path-filtered tosrc/,mumaxplus/,test/,CMakeLists.txt,setup.py,pyproject.tomland the workflow itself. A concurrency group cancels older runs, and ccache is used for the CUDA objects.What was left out
slowandmumax3tests, as in the README.test_average.py::TestAverage::test_average_zeeman_energy_geometryexpects0.5 * E1 == E2tortol=1e-12. The stray field between the two magnets (an FFT) adds float32 rounding noise, and the simulated cuFFT rounds differently from the real one. With the stray field source disabled the simulator gives exactly half, like a real GPU.test_strayfield.py::TestEnableStrayFields::test_enable_as_stray_field_sourceuses random grid sizes and an absolute tolerance of 1e-10 on float32 sums. It is marginal on real hardware as well (I saw differences up to 6e-11 on an RTX 3060, against the 1e-10 limit), and it failed in about one of seven simulator runs. Loosening that tolerance would make it stable everywhere.Result on a fork
453 passed, 102 deselected(the 102 are theslow/mumax3tests and the two above). The whole job took about 45 minutes on a cold run: about 16 minutes of that is the action building the simulator the first time, the package build takes about 5 minutes, and the tests about 24 minutes (test_frozenspins_inhomogeneousalone is about 10 minutes on the hosted runner).Run: https://github.com/saqibkh/plus/actions/runs/42464335925