Skip to content

Commit

Permalink
feat: adding the JAX tests to the matrix to avoid segmentation faults.
Browse files Browse the repository at this point in the history
  • Loading branch information
YushaArif99 committed Sep 26, 2024
1 parent f212079 commit 2474911
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/update-s2s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
geometry/test_solvers, geometry/test_subpix, geometry/test_transform, geometry/test_vector,
augmentation/test_augmentation, augmentation/test_auto, augmentation/test_container ]
compile : [ F ]
target : ["tensorflow", "jax" ]
steps:
- name: Checkout ivy-integration-tests
uses: actions/checkout@v4
Expand Down Expand Up @@ -52,9 +53,9 @@ jobs:
id: tests
run: |
if [ "${{ steps.jobs.outputs.html_url }}" = "null" ]; then
docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis ivyllc/ivy:latest ivy-integration-tests/update_s2s.sh kornia ${{ matrix.file }} linux-nightly ${{ matrix.compile }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} ${{ secrets.IVY_API_KEY }}
docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis ivyllc/ivy:latest ivy-integration-tests/update_s2s.sh kornia ${{ matrix.file }} linux-nightly ${{ matrix.compile }} ${{ matrix.target }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} ${{ secrets.IVY_API_KEY }}
else
docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis ivyllc/ivy:latest ivy-integration-tests/update_s2s.sh kornia ${{ matrix.file }} linux-nightly ${{ matrix.compile }} ${{ steps.jobs.outputs.html_url }} ${{ secrets.IVY_API_KEY }}
docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis ivyllc/ivy:latest ivy-integration-tests/update_s2s.sh kornia ${{ matrix.file }} linux-nightly ${{ matrix.compile }} ${{ matrix.target }} ${{ steps.jobs.outputs.html_url }} ${{ secrets.IVY_API_KEY }}
fi
- name: Prepare Artifact Name
Expand Down
9 changes: 6 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest

TARGET_FRAMEWORKS = ["numpy", "jax", "tensorflow", "torch"]
S2S_TARGET_FRAMEWORKS = ["tensorflow", "jax"]
S2S_TARGET_FRAMEWORKS = ["tensorflow"]
BACKEND_COMPILE = False
TARGET = "all"
S2S = False
Expand Down Expand Up @@ -48,8 +48,11 @@ def pytest_configure(config):
def pytest_generate_tests(metafunc):
configs = list()
if S2S:
for target in S2S_TARGET_FRAMEWORKS:
configs.append((target, "s2s", BACKEND_COMPILE))
if TARGET != "all":
configs.append((TARGET, "s2s", BACKEND_COMPILE))
else:
for target in S2S_TARGET_FRAMEWORKS:
configs.append((target, "s2s", BACKEND_COMPILE))
elif TARGET not in ["jax", "numpy", "tensorflow", "torch"]:
for target in TARGET_FRAMEWORKS:
configs.append((target, "transpile", BACKEND_COMPILE))
Expand Down
9 changes: 5 additions & 4 deletions update_s2s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ integration=$1
file=$2
binaries=$3
backend_compile=$4
workflow_link=$5
api_key=$6
target=$5
workflow_link=$6
api_key=$7

export VERSION=$binaries # set the branch to pull the binaries from

Expand All @@ -30,10 +31,10 @@ EOF
set +e
if [ "$backend_compile" = "T" ]; then
touch test_logs.txt
COLUMNS=200 pytest $integration/$file.py --backend-compile --source-to-source -p no:warnings --tb=long --json-report --json-report-file=test_report.json
COLUMNS=200 pytest $integration/$file.py --backend-compile --source-to-source --target=$target -p no:warnings --tb=long --json-report --json-report-file=test_report.json
pytest_exit_code=$?
else
COLUMNS=200 pytest $integration/$file.py -p no:warnings --source-to-source --tb=long --json-report --json-report-file=test_report.json > test_logs.txt
COLUMNS=200 pytest $integration/$file.py -p no:warnings --source-to-source --target=$target --tb=long --json-report --json-report-file=test_report.json > test_logs.txt
pytest_exit_code=$?
fi
set -e
Expand Down

0 comments on commit 2474911

Please sign in to comment.