Skip to content

Enable prefill for running CausalLM using ET runtime #431

Enable prefill for running CausalLM using ET runtime

Enable prefill for running CausalLM using ET runtime #431

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
python install_dev.py
else
pip install '.[tests]'
pip install executorch==${{ matrix.executorch-version }}
pip install git+https://github.com/pytorch-labs/tokenizers
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