ONNX Runtime Training / Python - Test #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ONNX Runtime Training / Python - Test | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 7 * * * # every day at 7am UTC | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- labeled | |
- reopened | |
- unlabeled | |
- synchronize | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: ${{ | |
(github.event_name == 'push') || | |
(github.event_name == 'workflow_dispatch') || | |
contains( github.event.pull_request.labels.*.name, 'training') || | |
contains( github.event.pull_request.labels.*.name, 'onnxruntime-training') | |
}} | |
runs-on: | |
group: aws-g6-4xlarge-plus | |
container: | |
image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | |
options: --gpus all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
env: | |
TORCH_CUDA_ARCH_LIST: "5.0 6.0 7.0 7.5 8.0 8.6 9.0+PTX" | |
run: | | |
pip install --upgrade pip | |
pip install --no-cache-dir "torch<2.6" torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 | |
pip install --no-cache-dir torch-ort onnxruntime-training && python -m torch_ort.configure | |
pip install --no-cache-dir evaluate absl-py rouge_score seqeval sacrebleu nltk scikit-learn | |
pip install .[tests,onnxruntime-training] | |
- name: Test with pytest (trainer) | |
run: | | |
RUN_SLOW=1 pytest tests/onnxruntime-training/test_trainer.py --durations=0 -vvvv | |
env: | |
HF_DATASETS_TRUST_REMOTE_CODE: 1 | |
- name: Test with pytest (examples) | |
run: | | |
RUN_SLOW=1 pytest tests/onnxruntime-training/test_examples.py --durations=0 -vvvv | |
env: | |
HF_DATASETS_TRUST_REMOTE_CODE: 1 |