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

Test pypi catalyst #5886

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
10 changes: 10 additions & 0 deletions .github/workflows/install_deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ inputs:
description: Indicate if PennyLane-Lightning should be installed from the master branch
required: false
default: 'true'
install_catalyst_test_pypi:
description: Indicate if catalyst should be installed from the test pypi location
required: false
type: boolean
default: 'false'
additional_pip_packages:
description: Additional packages to install. Values will be passed to pip install {value}
required: false
Expand Down Expand Up @@ -100,6 +105,11 @@ runs:
if: inputs.install_pennylane_lightning_master == 'true'
run: pip install -i https://test.pypi.org/simple/ PennyLane-Lightning --pre --upgrade

- name: Install Catalyst from Test Pypi
shell: bash
if: inputs.install_catalyst_test_pypi
albi3ro marked this conversation as resolved.
Show resolved Hide resolved
run: pip install -i https://test.pypi.org/simple/ PennyLane-Catalyst==0.7.0.dev0 --upgrade;

- name: Freeze dependencies
shell: bash
if: inputs.requirements_file != ''
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,39 @@ jobs:
requirements_file: ${{ strategy.job-index == 0 && 'all_interfaces.txt' || '' }}
disable_new_opmath: ${{ inputs.disable_new_opmath }}

catalyst-tests:
needs:
- setup-ci-load
strategy:
max-parallel: >-
${{
fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).catalyst-tests
|| fromJSON(needs.setup-ci-load.outputs.matrix-max-parallel).default
}}
matrix:
python-version: >-
${{
fromJSON(needs.setup-ci-load.outputs.python-version).catalyst-tests
|| fromJSON(needs.setup-ci-load.outputs.python-version).default
}}
if: ${{ !contains(fromJSON(needs.setup-ci-load.outputs.jobs-to-skip), 'catalyst-tests') }}
uses: ./.github/workflows/unit-test.yml
with:
job_name: catalyst-tests (${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: catalyst-tests-coverage
python_version: ${{ matrix.python-version }}
pipeline_mode: ${{ inputs.pipeline_mode }}
install_jax: true
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: true
install_catalyst_test_pypi: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: catalyst
additional_pip_packages: matplotlib
requirements_file: ${{ strategy.job-index == 0 && 'catalyst.txt' || '' }}
disable_new_opmath: ${{ inputs.disable_new_opmath }}

external-libraries-tests:
needs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ on:
required: false
type: boolean
default: true
install_catalyst_test_pypi:
description: Indicate if catalyst should be installed from the test pypi location
required: false
type: boolean
default: false
pytest_test_directory:
description: The directory where the PennyLane tests are that should be run by PyTest
required: false
Expand Down Expand Up @@ -148,6 +153,7 @@ jobs:
install_jax: ${{ inputs.install_jax }}
additional_pip_packages: ${{ inputs.additional_pip_packages }}
install_pennylane_lightning_master: ${{ inputs.install_pennylane_lightning_master }}
install_catalyst_test_pypi: ${{ inputs.install_catalyst_test_pypi }}
requirements_file: ${{ inputs.requirements_file }}

- name: Set PyTest Args
Expand Down
2 changes: 1 addition & 1 deletion tests/drawer/test_draw_catalyst.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
catalyst = pytest.importorskip("catalyst")
mpl = pytest.importorskip("matplotlib")

pytestmark = pytest.mark.external
pytestmark = pytest.mark.catalyst


class TestCatalystDraw:
Expand Down
1 change: 0 additions & 1 deletion tests/ops/functions/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ def circuit(theta):
assert np.allclose(matrix, expected_matrix)

@pytest.mark.catalyst
@pytest.mark.external
def test_catalyst(self):
"""Test with Catalyst interface"""

Expand Down
2 changes: 1 addition & 1 deletion tests/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
catalyst = pytest.importorskip("catalyst")
jax = pytest.importorskip("jax")

pytestmark = pytest.mark.external
pytestmark = pytest.mark.catalyst

from jax import numpy as jnp # pylint:disable=wrong-import-order, wrong-import-position
from jax.core import ShapedArray # pylint:disable=wrong-import-order, wrong-import-position
Expand Down
1 change: 0 additions & 1 deletion tests/transforms/core/test_transform_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ class TestTransformDispatcher: # pylint: disable=too-many-public-methods
"""Test the transform function (validate and dispatch)."""

@pytest.mark.catalyst
@pytest.mark.external
def test_error_on_qjit(self):
"""Test that an error is raised on when applying a transform to a qjit object."""

Expand Down
Loading