Skip to content

Commit

Permalink
Revert params and add diff names for cov.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentmr committed Oct 26, 2023
1 parent 220c900 commit edc8530
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests_gpu_cu11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

env:
CI_CUDA_ARCH: 86
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage_lgpu.xml --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
TF_VERSION: 2.10.0
TORCH_VERSION: 1.11.0+cpu
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
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
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv coverage_lgpu.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Install all backend devices
if: ${{ matrix.pl_backend == 'all' }}
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
PL_DEVICE=lightning.gpu python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device lightning.gpu --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device lightning.gpu --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv coverage_lgpu.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests_gpu_kokkos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

env:
CI_CUDA_ARCH: 86
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage_lkokkos_gpu.xml --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
KOKKOS_VERSION: e542e989af99cb87881ee2a0d06916541ee76006
TF_VERSION: 2.10.0
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=20000
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append 2> /dev/null || echo Something went wrong with pl-device-test shot=None
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS 2> /dev/null || echo Something went wrong with Pytest
mv coverage.xml coverage-${{ github.job }}.xml
mv coverage_lkokkos_gpu.xml coverage-${{ github.job }}.xml
- name: Install all backend devices
if: ${{ matrix.pl_backend == 'all' }}
Expand All @@ -316,7 +316,7 @@ jobs:
PL_DEVICE=lightning.kokkos python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device lightning.kokkos --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device lightning.kokkos --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv coverage_lkokkos_gpu.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
env:
TF_VERSION: 2.10.0
TORCH_VERSION: 1.11.0+cpu
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage_tests_linux.xml --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
OMP_NUM_THREADS: "2"

Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $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
mv coverage_tests_linux.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -272,7 +272,7 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $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
mv coverage_tests_linux.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -446,7 +446,7 @@ jobs:
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $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 }}.xml
mv coverage_tests_linux.xml coverage-${{ github.job }}.xml
- name: Install all backend devices
if: ${{ matrix.pl_backend == 'all' }}
Expand All @@ -468,7 +468,7 @@ jobs:
PL_DEVICE=lightning.kokkos python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device lightning.kokkos --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device lightning.kokkos --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
mv coverage.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
mv coverage_tests_linux.xml coverage-${{ github.job }}-${{ matrix.pl_backend }}.xml
- name: Upload code coverage results
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_linux_x86_mpi_gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
#pull_request:

env:
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage-${{ github.job }}.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage_lgpu_mpi.xml --no-flaky-report -p no:warnings --tb=native"
GCC_VERSION: 11
OMP_NUM_THREADS: "2"
CI_CUDA_ARCH: 86
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
run: |
source /etc/profile.d/modules.sh && module use /opt/modules/ && module load ${{ matrix.mpilib }}
PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun -np 2 python -m pytest ./mpitests $COVERAGE_FLAGS
mv coverage-${{ github.job }}.xml coverage-${{ github.job }}-lightning_gpu_${{ matrix.mpilib }}-main.xml
mv coverage_lgpu_mpi.xml coverage-${{ github.job }}-lightning_gpu_${{ matrix.mpilib }}-main.xml
# PL_DEVICE=lightning.gpu /opt/mpi/${{ matrix.mpilib }}/bin/mpirun --oversubscribe -n 4 pytest -s -x mpitests/test_device.py -k test_create_device $COVERAGE_FLAGS
- name: Upload code coverage results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_without_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:


env:
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage_nobin.xml --no-flaky-report -p no:warnings --tb=native"

concurrency:
group: tests_without_binary-${{ github.ref }}-${{ inputs.lightning-version }}-${{ inputs.pennylane-version }}
Expand Down Expand Up @@ -90,6 +90,6 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./main/coverage.xml
files: ./main/coverage_nobin.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 5 additions & 4 deletions mpitests/test_adjoint_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,11 @@ def circuit_compare(params, excitations):
jac_func = qml.jacobian(circuit)
jac_func_comp = qml.jacobian(circuit_compare)

np.random.seed(1337)
params = 1.0e-3 * np.random.rand(len(doubles))
comm = MPI.COMM_WORLD
params = comm.bcast(params, root=0)
# np.random.seed(1337)
# params = 1.0e-3 * np.random.rand(len(doubles))
# comm = MPI.COMM_WORLD
# params = comm.bcast(params, root=0)
params = qml.numpy.array([0.0] * len(doubles), requires_grad=True)

jacs = jac_func(params, excitations=doubles)
jacs_comp = jac_func_comp(params, excitations=doubles)
Expand Down

0 comments on commit edc8530

Please sign in to comment.