From edc8530a0123c381f8ceb5b29a416f268d53ba16 Mon Sep 17 00:00:00 2001 From: Vincent Michaud-Rioux Date: Thu, 26 Oct 2023 13:53:35 +0000 Subject: [PATCH] Revert params and add diff names for cov.xml --- .github/workflows/tests_gpu_cu11.yml | 6 +++--- .github/workflows/tests_gpu_kokkos.yml | 6 +++--- .github/workflows/tests_linux.yml | 10 +++++----- .github/workflows/tests_linux_x86_mpi_gpu.yml | 4 ++-- .github/workflows/tests_without_binary.yml | 4 ++-- mpitests/test_adjoint_jacobian.py | 9 +++++---- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests_gpu_cu11.yml b/.github/workflows/tests_gpu_cu11.yml index 22da362012..8d1eb742ff 100644 --- a/.github/workflows/tests_gpu_cu11.yml +++ b/.github/workflows/tests_gpu_cu11.yml @@ -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 @@ -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' }} @@ -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 diff --git a/.github/workflows/tests_gpu_kokkos.yml b/.github/workflows/tests_gpu_kokkos.yml index b090031111..f97ce05ffa 100644 --- a/.github/workflows/tests_gpu_kokkos.yml +++ b/.github/workflows/tests_gpu_kokkos.yml @@ -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 @@ -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' }} @@ -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 diff --git a/.github/workflows/tests_linux.yml b/.github/workflows/tests_linux.yml index f9357f9a7c..ae25bd85ac 100644 --- a/.github/workflows/tests_linux.yml +++ b/.github/workflows/tests_linux.yml @@ -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" @@ -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 @@ -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 @@ -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' }} @@ -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 diff --git a/.github/workflows/tests_linux_x86_mpi_gpu.yml b/.github/workflows/tests_linux_x86_mpi_gpu.yml index 937cc1d830..6c387ac6ec 100644 --- a/.github/workflows/tests_linux_x86_mpi_gpu.yml +++ b/.github/workflows/tests_linux_x86_mpi_gpu.yml @@ -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 @@ -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 diff --git a/.github/workflows/tests_without_binary.yml b/.github/workflows/tests_without_binary.yml index 845b215e96..9aca764fd2 100644 --- a/.github/workflows/tests_without_binary.yml +++ b/.github/workflows/tests_without_binary.yml @@ -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 }} @@ -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 }} \ No newline at end of file diff --git a/mpitests/test_adjoint_jacobian.py b/mpitests/test_adjoint_jacobian.py index 76624ca02a..166ada4d3e 100644 --- a/mpitests/test_adjoint_jacobian.py +++ b/mpitests/test_adjoint_jacobian.py @@ -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)