From 1782bbd41d5014cfbc0775baed443d2eed0b679d Mon Sep 17 00:00:00 2001 From: Joseph Lee <40768758+josephleekl@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:52:50 -0500 Subject: [PATCH 1/3] Upgrade LK/LGPU CI tests to use cuda 12.4 (#1023) ### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [X] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [ ] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** Lightning Kokkos CUDA C++ tests fail to compile due to [bug](https://forums.developer.nvidia.com/t/compiling-a-catch2-application-with-nvcc-std-c-20-leads-a-crash-in-cudafe/255088) with CUDA 12.2 + Catch2. CI instance is now upgraded to CUDA 12.4, and all GPU CI tests ([LK, LGPU/LTensor]x[C++, Python]) need to be updated to load CUDA 12.4. **Description of the Change:** Update github workflow to load CUDA 12.4. Also change Lightning Kokkos C++ test to use `Release` build instead of `RelWithDebInfo` due to segmentation fault when combined with coverage collection. The relevant test and line is [here](https://github.com/PennyLaneAI/pennylane-lightning/blob/e9a3b80823a2dc52f747ff20f91031512d0dbd63/pennylane_lightning/core/src/simulators/lightning_kokkos/gates/tests/Test_StateVectorKokkos_Param.cpp#L2062). **Benefits:** Will be able to run Lightning Kokkos C++ tests with CUDA. **Possible Drawbacks:** **Related GitHub Issues:** [sc-80288] --------- Co-authored-by: ringo-but-quantum --- .github/CHANGELOG.md | 3 +++ .github/workflows/tests_gpu_cpp.yml | 5 +++-- .github/workflows/tests_gpu_python.yml | 5 +++-- .github/workflows/tests_lkcuda_cpp.yml | 14 +++++++++----- .github/workflows/tests_lkcuda_python.yml | 12 ++++++++---- pennylane_lightning/core/_version.py | 2 +- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 9c289a9b8..f1f0d74eb 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -92,6 +92,9 @@ ### Bug fixes +* Update CUDA version to 12.4 for GPU tests on CI. + [(#1023)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1023) + * Fix Lightning Kokkos `[[maybe_unused]]` and `exp2` errors with hipcc. [(#1018)](https://github.com/PennyLaneAI/pennylane-lightning/pull/1018) diff --git a/.github/workflows/tests_gpu_cpp.yml b/.github/workflows/tests_gpu_cpp.yml index a23c89af4..d66f7722b 100644 --- a/.github/workflows/tests_gpu_cpp.yml +++ b/.github/workflows/tests_gpu_cpp.yml @@ -40,14 +40,15 @@ jobs: strategy: max-parallel: 1 matrix: - cuda_version: ["12"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] steps: - name: Validate GPU version and installed compiler run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/${{ matrix.cuda_version }} + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version diff --git a/.github/workflows/tests_gpu_python.yml b/.github/workflows/tests_gpu_python.yml index 44198bf71..4044e72e6 100644 --- a/.github/workflows/tests_gpu_python.yml +++ b/.github/workflows/tests_gpu_python.yml @@ -40,14 +40,15 @@ jobs: strategy: max-parallel: 1 matrix: - cuda_version: ["12"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] steps: - name: Validate GPU version and installed compiler run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/${{ matrix.cuda_version }} + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version diff --git a/.github/workflows/tests_lkcuda_cpp.yml b/.github/workflows/tests_lkcuda_cpp.yml index 0e1da0e2d..cba4e7c86 100644 --- a/.github/workflows/tests_lkcuda_cpp.yml +++ b/.github/workflows/tests_lkcuda_cpp.yml @@ -48,15 +48,17 @@ jobs: max-parallel: 1 matrix: os: [ubuntu-22.04] - exec_model: ["CUDA"] kokkos_version: ["4.5.00"] + exec_model: ["CUDA"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] steps: - name: Validate GPU version and installed compiler run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/12.2 + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version @@ -110,8 +112,10 @@ jobs: matrix: os: [ubuntu-22.04] pl_backend: ["lightning_kokkos"] - exec_model: ["CUDA"] kokkos_version: ["4.5.00"] + exec_model: ["CUDA"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] name: C++ Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}) runs-on: @@ -124,7 +128,7 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/12.2 + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version @@ -190,7 +194,7 @@ jobs: run: | cd main cmake . -BBuild -G Ninja \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTS=ON \ -DENABLE_PYTHON=OFF \ -DSCIPY_OPENBLAS=$(python -c "import scipy_openblas32; print(scipy_openblas32.get_lib_dir())") \ diff --git a/.github/workflows/tests_lkcuda_python.yml b/.github/workflows/tests_lkcuda_python.yml index 8cb9332b0..c4b849710 100644 --- a/.github/workflows/tests_lkcuda_python.yml +++ b/.github/workflows/tests_lkcuda_python.yml @@ -53,15 +53,17 @@ jobs: max-parallel: 1 matrix: os: [ubuntu-22.04] - exec_model: ["CUDA"] kokkos_version: ["4.5.00"] + exec_model: ["CUDA"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] steps: - name: Validate GPU version and installed compiler run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/12.2 + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version @@ -115,8 +117,10 @@ jobs: matrix: os: [ubuntu-22.04] pl_backend: ["lightning_kokkos", "all"] - exec_model: ["CUDA"] kokkos_version: ["4.5.00"] + exec_model: ["CUDA"] + cuda_version_maj: ["12"] + cuda_version_min: ["4"] name: Python Tests (${{ matrix.pl_backend }}, kokkos-${{ matrix.kokkos_version }}, model-${{ matrix.exec_model }}) runs-on: @@ -129,7 +133,7 @@ jobs: run: | source /etc/profile.d/modules.sh module use /opt/modules - module load cuda/12.2 + module load cuda/${{ matrix.cuda_version_maj }}.${{ matrix.cuda_version_min }} echo "${PATH}" >> $GITHUB_PATH echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV nvcc --version diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 69b64a365..87a488e55 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.40.0-dev36" +__version__ = "0.40.0-dev37" From f4d2a18dd56ac3e56133c119610cbf2fb59c69c4 Mon Sep 17 00:00:00 2001 From: ringo-but-quantum Date: Mon, 16 Dec 2024 20:17:02 +0000 Subject: [PATCH 2/3] Auto update version from '0.40.0-dev36' to '0.40.0-dev38' --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 69b64a365..48a152c2d 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.40.0-dev36" +__version__ = "0.40.0-dev38" From c3ba71dc5f53e2b833b19f22b070a233af9bf1a3 Mon Sep 17 00:00:00 2001 From: ringo-but-quantum Date: Mon, 16 Dec 2024 20:22:01 +0000 Subject: [PATCH 3/3] Auto update version from '0.40.0-dev37' to '0.40.0-dev38' --- pennylane_lightning/core/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 87a488e55..48a152c2d 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.40.0-dev37" +__version__ = "0.40.0-dev38"