Skip to content

Commit f8073cb

Browse files
Implement CI test workflow for experimental module (#4330)
Co-authored-by: Quentin Gallouédec <[email protected]>
1 parent 55854c8 commit f8073cb

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ on:
1212
- "tests/**.py"
1313
- "trl/**.py"
1414
- "pyproject.toml"
15+
# Exclude if only experimental code/tests
16+
- "!trl/experimental/**"
17+
- "!tests/experimental/**"
1518

1619
env:
1720
TQDM_DISABLE: 1
1821
CI_SLACK_CHANNEL: ${{ secrets.CI_PUSH_MAIN_CHANNEL }}
1922
PYTORCH_CUDA_ALLOC_CONF: "expandable_segments:True"
20-
TRL_EXPERIMENTAL_SILENCE: 1
2123

2224
jobs:
2325
check_code_quality:

0 commit comments

Comments
 (0)