Skip to content

fix(neuron): detect correct Neuron device for docker tests #421

fix(neuron): detect correct Neuron device for docker tests

fix(neuron): detect correct Neuron device for docker tests #421

name: Optimum neuron / Test INF2 seq2seq
on:
push:
branches: [ main ]
paths:
- 'pyproject.toml'
- 'optimum/commands/export/neuronx.py'
- 'optimum/exporters/**.py'
- 'optimum/neuron/modeling_base.py'
- 'optimum/neuron/modeling_traced.py'
- 'optimum/neuron/modeling_seq2seq.py'
- 'optimum/neuron/models/inference/t5/**.py'
- 'optimum/neuron/utils/**.py'
- 'tests/inference/seq2seq/**.py'
- '.github/workflows/test_inf2_seq2seq.yml'
pull_request:
branches: [ main ]
paths:
- 'pyproject.toml'
- 'optimum/commands/export/neuronx.py'
- 'optimum/exporters/**.py'
- 'optimum/neuron/modeling_base.py'
- 'optimum/neuron/modeling_traced.py'
- 'optimum/neuron/modeling_seq2seq.py'
- 'optimum/neuron/models/inference/t5/**.py'
- 'optimum/neuron/utils/**.py'
- 'tests/inference/seq2seq/**.py'
- '.github/workflows/test_inf2_seq2seq.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: true
jobs:
sanity:
name: Sanity
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run sanity check
uses: ./.github/actions/sanity-check
with:
hf_token: ${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CACHE }}
do-the-job:
name: Run INF2 tests
needs: sanity
runs-on:
group: aws-inf2-8xlarge
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Neuronx runtime
uses: ./.github/actions/install_neuronx_runtime
- name: Setup virtual environment
uses: ./.github/actions/setup_venv
- name: Run export cli seq2seq tests
run: |
source aws_neuron_venv_pytorch/bin/activate
HF_TOKEN=${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CI }} pytest tests/inference/seq2seq/test_export_cli.py
- name: Run single core seq2seq tests
run: |
source aws_neuron_venv_pytorch/bin/activate
export HF_TOKEN=${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CI }}
pytest tests/inference/seq2seq/test_export.py
pytest tests/inference/seq2seq/test_generate.py
pytest tests/inference/seq2seq/test_hub.py
- name: Run parallel seq2seq tests
run: |
source aws_neuron_venv_pytorch/bin/activate
HF_TOKEN=${{ secrets.HF_TOKEN_OPTIMUM_NEURON_CI }} pytest tests/inference/seq2seq/test_parallel.py