Skip to content

Commit

Permalink
Upgrade LK/LGPU CI tests to use cuda 12.4 (#1023)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
  • Loading branch information
josephleekl and ringo-but-quantum authored Dec 16, 2024
1 parent e9a3b80 commit 1782bbd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests_gpu_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests_gpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/tests_lkcuda_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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())") \
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.40.0-dev36"
__version__ = "0.40.0-dev37"

0 comments on commit 1782bbd

Please sign in to comment.