|
| 1 | +name: Tests (experimental) |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + # Run only when relevant files are modified |
| 7 | + - "trl/experimental/**" |
| 8 | + - "tests/experimental/**" |
| 9 | + |
| 10 | +env: |
| 11 | + TQDM_DISABLE: 1 |
| 12 | + PYTORCH_CUDA_ALLOC_CONF: "expandable_segments:True" |
| 13 | + TRL_EXPERIMENTAL_SILENCE: 1 |
| 14 | + |
| 15 | +jobs: |
| 16 | + check_code_quality: |
| 17 | + name: Check code quality |
| 18 | + runs-on: ubuntu-latest |
| 19 | + if: github.event.pull_request.draft == false |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + - name: Set up Python 3.13 |
| 23 | + uses: actions/setup-python@v5 |
| 24 | + with: |
| 25 | + python-version: 3.13 |
| 26 | + - uses: pre-commit/[email protected] |
| 27 | + with: |
| 28 | + extra_args: --all-files |
| 29 | + |
| 30 | + tests: |
| 31 | + name: Tests (experimental) |
| 32 | + runs-on: |
| 33 | + group: aws-g4dn-2xlarge |
| 34 | + container: |
| 35 | + image: pytorch/pytorch:2.8.0-cuda12.8-cudnn9-devel |
| 36 | + options: --gpus all |
| 37 | + defaults: |
| 38 | + run: |
| 39 | + shell: bash |
| 40 | + steps: |
| 41 | + - name: Git checkout |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Set up Python 3.13 |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: 3.13 |
| 48 | + |
| 49 | + - name: Install Make and Git |
| 50 | + run: | |
| 51 | + apt-get update && apt-get install -y make git curl |
| 52 | +
|
| 53 | + - name: Install uv |
| 54 | + run: | |
| 55 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
| 56 | +
|
| 57 | + - name: Create Python virtual environment |
| 58 | + run: | |
| 59 | + uv venv |
| 60 | + uv pip install --upgrade setuptools wheel |
| 61 | +
|
| 62 | + - name: Install dependencies |
| 63 | + run: | |
| 64 | + source .venv/bin/activate |
| 65 | + uv pip install ".[dev]" |
| 66 | +
|
| 67 | + - name: Test with pytest |
| 68 | + run: | |
| 69 | + source .venv/bin/activate |
| 70 | + make test_experimental |
0 commit comments