Skip to content

[not to merge] executorch.export recipe integration #329

[not to merge] executorch.export recipe integration

[not to merge] executorch.export recipe integration #329

Workflow file for this run

name: ExecuTorch E2E / Python - Test
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
discover-tests:
runs-on: ubuntu-22.04
outputs:
model_names: ${{ steps.set-matrix.outputs.model_names }}
steps:
- uses: actions/checkout@v3
- name: Find model tests
id: set-matrix
run: |
# Find all test files and extract model names correctly
MODEL_NAMES=$(find tests/models -name "test_modeling_*.py" -type f | sed 's|tests/models/test_modeling_||' | sed 's|\.py$||' | paste -sd "," -)
echo "model_names=[\"${MODEL_NAMES//,/\",\"}\"]" >> $GITHUB_OUTPUT
# Display all discovered models
echo "Discovered models:"
echo "$MODEL_NAMES" | tr ',' '\n' | sort | awk '{print "- " $0}'
run-tests:
needs: discover-tests
strategy:
fail-fast: false
matrix:
test-modeling: ${{ fromJson(needs.discover-tests.outputs.model_names) }}
executorch-version: ['0.6.0', 'nightly']
python-version: ['3.11']
os: [macos-15, ubuntu-22.04]
# Custom job name, now shortened and cleaner
name: ${{ matrix.test-modeling }} (et=${{ matrix.executorch-version }}, py=${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
MODEL_NAME: ${{ matrix.test-modeling }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for ExecuTorch
run: |
if [ "${{ matrix.executorch-version }}" == "nightly" ]; then
export NIGHTLY_VERSION=dev20250507
pip install executorch==0.7.0.${NIGHTLY_VERSION} \
torch==2.8.0.${NIGHTLY_VERSION} \
torchvision==0.22.0.${NIGHTLY_VERSION} \
torchaudio==2.6.0.${NIGHTLY_VERSION} \
torchao==0.12.0.${NIGHTLY_VERSION} \
--extra-index-url "https://download.pytorch.org/whl/nightly/cpu"
else
pip install executorch==${{ matrix.executorch-version }}
fi
pip install '.[tests]'
if [ "${{ matrix.test-modeling }}" == "gemma3" ]; then
git clone https://github.com/huggingface/transformers.git
pushd transformers
git checkout a57274466f7f72efaa2662d1738cdaf28ae8071f
pip install -e .
popd
fi
pip list
- name: Run tests
run: |
RUN_SLOW=1 pytest tests/models/test_modeling_${{ matrix.test-modeling }}.py -s -vvvv --durations=0 --log-cli-level=INFO