Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallelize gpu test #1042

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests_gpu_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ jobs:
OMP_PROC_BIND: false
run: |
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
Copy link
Member

@multiphaseCFD multiphaseCFD Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @josephleekl . Do we want to install pytest-xdist? How can we confiugre the maping between cpu cores and gpu devices or instances (MIG)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note here: benchmarks are required for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! pytest-xdist is already installed from requirements-dev.txt . We're just using the single GPU device, but might be possible that if we partition into MIG and map directly, it will be more performant.

I have posted some preliminary timings in the PR description; for now GPU tests seem to take longer... I'll investigate more when I have time!

PL_DEVICE=${DEVICENAME} python -m pytest -n 2 tests/ -k "not unitary_correct" $COVERAGE_FLAGS
PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "unitary_correct" $COVERAGE_FLAGS

- name: Test wheels for Lightning-GPU
if : matrix.pl_backend == 'lightning_gpu'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests_lkcuda_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ jobs:
run: |
cd main/
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "not test_native_mcm" $COVERAGE_FLAGS
PL_DEVICE=${DEVICENAME} python -m pytest -n 2 tests/ -k "not unitary_correct and not test_native_mcm" $COVERAGE_FLAGS
PL_DEVICE=${DEVICENAME} python -m pytest tests/ -k "unitary_correct and not test_native_mcm" $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
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.41.0-dev5"
__version__ = "0.41.0-dev6"
Loading