|
| 1 | +name: RL tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'torchtune/recipes/dev/**grpo**' |
| 7 | + - 'torchtune/recipes/configs/dev/**grpo**' |
| 8 | + - 'torchtune/dev/rl/**' |
| 9 | + - 'torchtune/dev/grpo/**' |
| 10 | + pull_request: |
| 11 | + paths: |
| 12 | + - 'torchtune/recipes/dev/**grpo**' |
| 13 | + - 'torchtune/recipes/configs/dev/**grpo**' |
| 14 | + - 'torchtune/dev/rl/**' |
| 15 | + - 'torchtune/dev/grpo/**' |
| 16 | + schedule: |
| 17 | + # Runs at midnight evvery day |
| 18 | + - cron: '0 0 * * *' |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: gpu-test-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +permissions: |
| 25 | + id-token: write |
| 26 | + contents: read |
| 27 | + |
| 28 | +defaults: |
| 29 | + run: |
| 30 | + shell: bash -l -eo pipefail {0} |
| 31 | + |
| 32 | +jobs: |
| 33 | + gpu_test: |
| 34 | + if: github.repository_owner == 'pytorch' |
| 35 | + runs-on: linux.g5.12xlarge.nvidia.gpu |
| 36 | + strategy: |
| 37 | + matrix: |
| 38 | + python-version: ['3.9', '3.10', '3.11'] |
| 39 | + torch-version: ["stable", "nightly"] |
| 40 | + # Do not run against nightlies on PR |
| 41 | + exclude: |
| 42 | + - torch-version: ${{ github.event_name == 'pull_request' && 'nightly' }} |
| 43 | + steps: |
| 44 | + - name: Check out repo |
| 45 | + uses: actions/checkout@v4 |
| 46 | + - name: Setup conda env |
| 47 | + uses: conda-incubator/setup-miniconda@v2 |
| 48 | + with: |
| 49 | + auto-update-conda: true |
| 50 | + miniconda-version: "latest" |
| 51 | + activate-environment: test |
| 52 | + python-version: ${{ matrix.python-version }} |
| 53 | + - name: Update pip |
| 54 | + run: python -m pip install --upgrade pip |
| 55 | + - name: Install nightly versions of PyTorch packages (if applicable) |
| 56 | + if: ${{ matrix.torch-version == 'nightly' }} |
| 57 | + run: python -m pip install --pre torch torchvision torchao --index-url https://download.pytorch.org/whl/nightly/cu126 |
| 58 | + - name: Install torch stable (if applicable) |
| 59 | + if: ${{ matrix.torch-version == 'stable' }} |
| 60 | + run: python -m pip install torch torchvision torchao |
| 61 | + - name: Install recipe-specific dependencies |
| 62 | + run: python -m pip install lm-eval==0.4.8 |
| 63 | + - name: Install the torchtune library with dev options |
| 64 | + run: python -m pip install -e ".[dev]" |
| 65 | + - name: Install the torchtune libary with async_rl options |
| 66 | + if: ${{ matrix.python-version != '3.9' }} |
| 67 | + run: python -m pip install -e ".[async_rl]" |
| 68 | + - name: Run recipe and unit tests with coverage |
| 69 | + run: pytest tests/torchtune/dev/rl tests/recipes/dev --run-rl-tests --with-integration --cov=. --cov-report=xml --durations=20 -vv |
| 70 | + - name: Upload coverage to Codecov |
| 71 | + uses: codecov/codecov-action@v3 |
0 commit comments