ivangabriele commited on
Commit
19ca323
·
verified ·
1 Parent(s): a6a4402

ci(github): remove actions

Browse files
.github/ISSUE_TEMPLATE/bug-report.yml DELETED
@@ -1,67 +0,0 @@
1
- name: "\U0001F41B Bug Report"
2
- description: Submit a bug report to help us improve TRL
3
- labels: [ "bug" ]
4
- body:
5
- - type: markdown
6
- attributes:
7
- value: |
8
- Thanks for taking the time to fill out this bug report! 🤗
9
-
10
- 🚩 If it is your first time submitting, be sure to check our [bug report guidelines](https://github.com/huggingface/trl/blob/main/CONTRIBUTING.md#did-you-find-a-bug)
11
-
12
- - type: textarea
13
- id: reproduction
14
- validations:
15
- required: true
16
- attributes:
17
- label: Reproduction
18
- description: |
19
- Please provide a code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
20
- If you have code snippets, error messages, stack traces please provide them here as well.
21
- Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
22
- Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.
23
-
24
- value: |
25
- ```python
26
- from trl import ...
27
-
28
- ```
29
-
30
- outputs:
31
-
32
- ```
33
- Traceback (most recent call last):
34
- File "example.py", line 42, in <module>
35
- ...
36
- ```
37
-
38
- - type: textarea
39
- id: system-info
40
- attributes:
41
- label: System Info
42
- description: |
43
- Please provide information about your system: platform, Python version, PyTorch version, Transformers version, devices, TRL version, ...
44
- You can get this information by running `trl env` in your terminal.
45
-
46
- placeholder: Copy-paste the output of `trl env`
47
- validations:
48
- required: true
49
-
50
- - type: checkboxes
51
- id: terms
52
- attributes:
53
- label: Checklist
54
- description: |
55
- Before submitting, please confirm that you've completed each of the following.
56
- If an item doesn't apply to your issue, check it anyway to show you've reviewed it.
57
- options:
58
- - label: "I have checked that my issue isn't already filed (see [open issues](https://github.com/huggingface/trl/issues?q=is%3Aissue))"
59
- required: true
60
- - label: "I have included my system information"
61
- required: true
62
- - label: "Any code provided is minimal, complete, and reproducible ([more on MREs](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks))"
63
- required: true
64
- - label: "Any code provided is properly formatted in code blocks, (no screenshot, [more on code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks))"
65
- required: true
66
- - label: "Any traceback provided is complete"
67
- required: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/ISSUE_TEMPLATE/feature-request.yml DELETED
@@ -1,31 +0,0 @@
1
- name: "\U0001F680 Feature request"
2
- description: Submit a proposal/request for a new TRL feature
3
- labels: [ "Feature request" ]
4
- body:
5
- - type: textarea
6
- id: feature-request
7
- validations:
8
- required: true
9
- attributes:
10
- label: Feature request
11
- description: |
12
- A clear and concise description of the feature proposal. Please provide a link to the paper and code in case they exist.
13
-
14
- - type: textarea
15
- id: motivation
16
- validations:
17
- required: true
18
- attributes:
19
- label: Motivation
20
- description: |
21
- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too.
22
-
23
-
24
- - type: textarea
25
- id: contribution
26
- validations:
27
- required: true
28
- attributes:
29
- label: Your contribution
30
- description: |
31
- Is there any way that you could help, e.g. by submitting a PR? Make sure to read the CONTRIBUTING.MD [readme](https://github.com/huggingface/trl/blob/main/CONTRIBUTING.md)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/ISSUE_TEMPLATE/new-trainer-addition.yml DELETED
@@ -1,32 +0,0 @@
1
- name: "\U0001F31F New trainer addition"
2
- description: Submit a proposal/request to implement a new trainer for a post-training method
3
- labels: [ "New trainer" ]
4
-
5
- body:
6
- - type: textarea
7
- id: description-request
8
- validations:
9
- required: true
10
- attributes:
11
- label: Method description
12
- description: |
13
- Put any and all important information relative to the method
14
-
15
- - type: checkboxes
16
- id: information-tasks
17
- attributes:
18
- label: Open source status
19
- description: |
20
- Please note that if the method implementation isn't available or model weights with training datasets aren't available, we are less likely to implement it in `trl`.
21
- options:
22
- - label: "The method implementation is available"
23
- - label: "The model weights are available"
24
- - label: "The training datasets are available"
25
-
26
- - type: textarea
27
- id: additional-info
28
- attributes:
29
- label: Provide useful links for the implementation
30
- description: |
31
- Please provide information regarding the implementation, the weights, and the authors.
32
- Please mention the authors by @gh-username if you're aware of their usernames.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/PULL_REQUEST_TEMPLATE.md DELETED
@@ -1,31 +0,0 @@
1
- # What does this PR do?
2
-
3
- <!--
4
- Congratulations! You've made it this far! You're not quite done yet though.
5
-
6
- Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.
7
-
8
- Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.
9
-
10
- Once you're done, someone will review your PR shortly. They may suggest changes to make the code even better.
11
- -->
12
-
13
- <!-- Remove if not applicable -->
14
-
15
- Fixes # (issue)
16
-
17
-
18
- ## Before submitting
19
- - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
20
- - [ ] Did you read the [contributor guideline](https://github.com/huggingface/trl/blob/main/CONTRIBUTING.md#create-a-pull-request),
21
- Pull Request section?
22
- - [ ] Was this discussed/approved via a GitHub issue? Please add a link
23
- to it if that's the case.
24
- - [ ] Did you make sure to update the documentation with your changes?
25
- - [ ] Did you write any new necessary tests?
26
-
27
-
28
- ## Who can review?
29
-
30
- Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
31
- members/contributors who may be interested in your PR.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/codeql/custom-queries.qls DELETED
@@ -1,19 +0,0 @@
1
- import codeql
2
-
3
- from WorkflowString interpolation, Workflow workflow
4
- where
5
- interpolation.getStringValue().matches("${{ github.event.issue.title }}") or
6
- interpolation.getStringValue().matches("${{ github.event.issue.body }}") or
7
- interpolation.getStringValue().matches("${{ github.event.pull_request.title }}") or
8
- interpolation.getStringValue().matches("${{ github.event.pull_request.body }}") or
9
- interpolation.getStringValue().matches("${{ github.event.review.body }}") or
10
- interpolation.getStringValue().matches("${{ github.event.comment.body }}") or
11
- interpolation.getStringValue().matches("${{ github.event.inputs.* }}") or
12
- interpolation.getStringValue().matches("${{ github.event.head_commit.message }}")
13
- interpolation.getStringValue().matches("${{ github.event.* }}") and
14
- (
15
- step.getKey() = "run" or // Injection in run
16
- step.getKey() = "env" or // Injection via env
17
- step.getKey() = "with" // Injection via with
18
- )
19
- select workflow, "🚨 Do not use directly as input of action"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/build_documentation.yml DELETED
@@ -1,19 +0,0 @@
1
- name: Build documentation
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- - doc-builder*
8
- - v*-release
9
-
10
- jobs:
11
- build:
12
- uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
13
- with:
14
- commit_sha: ${{ github.sha }}
15
- package: trl
16
- version_tag_suffix: ""
17
- custom_container: huggingface/transformers-doc-builder
18
- secrets:
19
- hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/build_pr_documentation.yml DELETED
@@ -1,19 +0,0 @@
1
- name: Build PR Documentation
2
-
3
- on:
4
- pull_request:
5
-
6
- concurrency:
7
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8
- cancel-in-progress: true
9
-
10
- jobs:
11
- build:
12
- if: github.event.pull_request.draft == false
13
- uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
14
- with:
15
- commit_sha: ${{ github.event.pull_request.head.sha }}
16
- pr_number: ${{ github.event.number }}
17
- package: trl
18
- version_tag_suffix: ""
19
- custom_container: huggingface/transformers-doc-builder
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/clear_cache.yml DELETED
@@ -1,33 +0,0 @@
1
- name: "Cleanup Cache"
2
-
3
- on:
4
- workflow_dispatch:
5
- schedule:
6
- - cron: "0 0 * * *"
7
-
8
- jobs:
9
- cleanup:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Check out code
13
- uses: actions/checkout@v4
14
-
15
- - name: Cleanup
16
- run: |
17
- gh extension install actions/gh-actions-cache
18
-
19
- REPO=${{ github.repository }}
20
-
21
- echo "Fetching list of cache key"
22
- cacheKeysForPR=$(gh actions-cache list -R $REPO | cut -f 1 )
23
-
24
- ## Setting this to not fail the workflow while deleting cache keys.
25
- set +e
26
- echo "Deleting caches..."
27
- for cacheKey in $cacheKeysForPR
28
- do
29
- gh actions-cache delete $cacheKey -R $REPO --confirm
30
- done
31
- echo "Done"
32
- env:
33
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/codeQL.yml DELETED
@@ -1,26 +0,0 @@
1
- name: "CodeQL Analysis - Workflows"
2
-
3
- on:
4
- workflow_dispatch:
5
-
6
- jobs:
7
- analyze:
8
- name: "Analyze GitHub Workflows"
9
- runs-on: ubuntu-latest
10
- permissions:
11
- security-events: write
12
- actions: read
13
- contents: read
14
-
15
- steps:
16
- - name: "Checkout repository"
17
- uses: actions/checkout@v4
18
-
19
- - name: "Initialize CodeQL"
20
- uses: github/codeql-action/init@v2
21
- with:
22
- languages: "yaml"
23
- queries: +security-and-quality, ./.github/codeql/custom-queries.qls
24
-
25
- - name: "Perform CodeQL Analysis"
26
- uses: github/codeql-action/analyze@v2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/docker-build.yml DELETED
@@ -1,95 +0,0 @@
1
- name: Build Docker images (scheduled)
2
-
3
- on:
4
- workflow_dispatch:
5
- workflow_call:
6
- schedule:
7
- - cron: "0 1 * * *"
8
-
9
- concurrency:
10
- group: docker-image-builds
11
- cancel-in-progress: false
12
-
13
- env:
14
- CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
15
-
16
- jobs:
17
- trl-latest:
18
- name: "Latest TRL GPU"
19
- runs-on: ubuntu-latest
20
- steps:
21
- - name: Cleanup disk
22
- run: |
23
- sudo ls -l /usr/local/lib/
24
- sudo ls -l /usr/share/
25
- sudo du -sh /usr/local/lib/
26
- sudo du -sh /usr/share/
27
- sudo rm -rf /usr/local/lib/android
28
- sudo rm -rf /usr/share/dotnet
29
- sudo du -sh /usr/local/lib/
30
- sudo du -sh /usr/share/
31
- - name: Set up Docker Buildx
32
- uses: docker/setup-buildx-action@v1
33
- - name: Check out code
34
- uses: actions/checkout@v4
35
- - name: Login to DockerHub
36
- uses: docker/login-action@v1
37
- with:
38
- username: ${{ secrets.DOCKERHUB_USERNAME }}
39
- password: ${{ secrets.DOCKERHUB_PASSWORD }}
40
-
41
- - name: Build and Push GPU
42
- uses: docker/build-push-action@v4
43
- with:
44
- context: ./docker/trl-latest-gpu
45
- push: true
46
- tags: huggingface/trl-latest-gpu
47
-
48
- - name: Post to Slack
49
- if: always()
50
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
51
- with:
52
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
53
- title: 🤗 Results of the trl-latest-gpu Docker Image build
54
- status: ${{ job.status }}
55
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
56
-
57
- trl-source:
58
- name: "Latest TRL + HF ecosystem from source"
59
- runs-on: ubuntu-latest
60
- steps:
61
- - name: Cleanup disk
62
- run: |
63
- sudo ls -l /usr/local/lib/
64
- sudo ls -l /usr/share/
65
- sudo du -sh /usr/local/lib/
66
- sudo du -sh /usr/share/
67
- sudo rm -rf /usr/local/lib/android
68
- sudo rm -rf /usr/share/dotnet
69
- sudo du -sh /usr/local/lib/
70
- sudo du -sh /usr/share/
71
- - name: Set up Docker Buildx
72
- uses: docker/setup-buildx-action@v1
73
- - name: Check out code
74
- uses: actions/checkout@v4
75
- - name: Login to DockerHub
76
- uses: docker/login-action@v1
77
- with:
78
- username: ${{ secrets.DOCKERHUB_USERNAME }}
79
- password: ${{ secrets.DOCKERHUB_PASSWORD }}
80
-
81
- - name: Build and Push GPU
82
- uses: docker/build-push-action@v4
83
- with:
84
- context: ./docker/trl-source-gpu
85
- push: true
86
- tags: huggingface/trl-source-gpu
87
-
88
- - name: Post to Slack
89
- if: always()
90
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
91
- with:
92
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
93
- title: 🤗 Results of the trl-source-gpu Docker Image build
94
- status: ${{ job.status }}
95
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/issue_auto_labeller.yml DELETED
@@ -1,15 +0,0 @@
1
- name: "Hugging Face Issue Labeler"
2
- on:
3
- issues:
4
- types: opened
5
-
6
- jobs:
7
- triage:
8
- runs-on: ubuntu-latest
9
- permissions:
10
- issues: write
11
- steps:
12
- - uses: actions/checkout@v3
13
- - uses: August-murr/auto-labeler@main
14
- with:
15
- hf-api-key: ${{ secrets.CI_HF_API_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/pr_style_bot.yml DELETED
@@ -1,127 +0,0 @@
1
- name: PR Style Bot
2
-
3
- on:
4
- workflow_dispatch:
5
-
6
-
7
- permissions:
8
- contents: write
9
- pull-requests: write
10
-
11
- jobs:
12
- run-style-bot:
13
- if: >
14
- contains(github.event.comment.body, '@bot /style') &&
15
- github.event.issue.pull_request != null
16
- runs-on: ubuntu-latest
17
-
18
- steps:
19
- - name: Extract PR details
20
- id: pr_info
21
- uses: actions/github-script@v6
22
- with:
23
- script: |
24
- const prNumber = context.payload.issue.number;
25
- const { data: pr } = await github.rest.pulls.get({
26
- owner: context.repo.owner,
27
- repo: context.repo.repo,
28
- pull_number: prNumber
29
- });
30
-
31
- // We capture both the branch ref and the "full_name" of the head repo
32
- // so that we can check out the correct repository & branch (including forks).
33
- core.setOutput("prNumber", prNumber);
34
- core.setOutput("headRef", pr.head.ref);
35
- core.setOutput("headRepoFullName", pr.head.repo.full_name);
36
-
37
- - name: Check out PR branch
38
- uses: actions/checkout@v3
39
- env:
40
- HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
41
- HEADREF: ${{ steps.pr_info.outputs.headRef }}
42
- with:
43
- # Instead of checking out the base repo, use the contributor's repo name
44
- repository: ${{ env.HEADREPOFULLNAME }}
45
- ref: ${{ env.HEADREF }}
46
- # You may need fetch-depth: 0 for being able to push
47
- fetch-depth: 0
48
- token: ${{ secrets.GITHUB_TOKEN }}
49
-
50
- - name: Debug
51
- env:
52
- HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
53
- HEADREF: ${{ steps.pr_info.outputs.headRef }}
54
- PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
55
- run: |
56
- echo "PR number: ${{ env.PRNUMBER }}"
57
- echo "Head Ref: ${{ env.HEADREF }}"
58
- echo "Head Repo Full Name: ${{ env.HEADREPOFULLNAME }}"
59
-
60
- - name: Set up Python
61
- uses: actions/setup-python@v4
62
-
63
- - name: Install dependencies
64
- run: |
65
- pip install ruff pre-commit
66
-
67
- - name: Download Makefile from main branch
68
- run: |
69
- curl -o main_Makefile https://raw.githubusercontent.com/huggingface/trl/main/Makefile
70
-
71
- - name: Compare Makefiles
72
- run: |
73
- if ! diff -q main_Makefile Makefile; then
74
- echo "Error: The Makefile has changed. Please ensure it matches the main branch."
75
- exit 1
76
- fi
77
- echo "No changes in Makefile. Proceeding..."
78
- rm -rf main_Makefile
79
-
80
- - name: Run make style and make quality
81
- run: |
82
- make precommit || true
83
-
84
- - name: Commit and push changes
85
- id: commit_and_push
86
- env:
87
- HEADREPOFULLNAME: ${{ steps.pr_info.outputs.headRepoFullName }}
88
- HEADREF: ${{ steps.pr_info.outputs.headRef }}
89
- PRNUMBER: ${{ steps.pr_info.outputs.prNumber }}
90
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91
- run: |
92
- echo "HEADREPOFULLNAME: ${{ env.HEADREPOFULLNAME }}, HEADREF: ${{ env.HEADREF }}"
93
- # Configure git with the Actions bot user
94
- git config user.name "github-actions[bot]"
95
- git config user.email "github-actions[bot]@users.noreply.github.com"
96
-
97
- # Make sure your 'origin' remote is set to the contributor's fork
98
- git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ env.HEADREPOFULLNAME }}.git"
99
-
100
- # If there are changes after running style/quality, commit them
101
- if [ -n "$(git status --porcelain)" ]; then
102
- git add .
103
- git commit -m "Apply style fixes"
104
- # Push to the original contributor's forked branch
105
- git push origin HEAD:${{ env.HEADREF }}
106
- echo "changes_pushed=true" >> $GITHUB_OUTPUT
107
- else
108
- echo "No changes to commit."
109
- echo "changes_pushed=false" >> $GITHUB_OUTPUT
110
- fi
111
-
112
- - name: Comment on PR with workflow run link
113
- if: steps.commit_and_push.outputs.changes_pushed == 'true'
114
- uses: actions/github-script@v6
115
- with:
116
- script: |
117
- const prNumber = parseInt(process.env.prNumber, 10);
118
- const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
119
-
120
- await github.rest.issues.createComment({
121
- owner: context.repo.owner,
122
- repo: context.repo.repo,
123
- issue_number: prNumber,
124
- body: `Style fixes have been applied. [View the workflow run here](${runUrl}).`
125
- });
126
- env:
127
- prNumber: ${{ steps.pr_info.outputs.prNumber }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/slow-tests.yml DELETED
@@ -1,98 +0,0 @@
1
- name: Slow tests (on push)
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- paths:
7
- # Run only when python files are modified
8
- - "trl/**.py"
9
- - "examples/**.py"
10
- env:
11
- RUN_SLOW: "yes"
12
- IS_GITHUB_CI: "1"
13
- SLACK_API_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
14
-
15
-
16
- jobs:
17
- run_all_tests_single_gpu:
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- docker-image-name: ["huggingface/trl-latest-gpu:latest", "huggingface/trl-source-gpu:latest"]
22
- runs-on:
23
- group: aws-g4dn-2xlarge
24
- env:
25
- CUDA_VISIBLE_DEVICES: "0"
26
- TEST_TYPE: "single_gpu_${{ matrix.docker-image-name }}"
27
- container:
28
- image: ${{ matrix.docker-image-name }}
29
- options: --gpus all --shm-size "16gb" -e NVIDIA_DISABLE_REQUIRE=true
30
- defaults:
31
- run:
32
- shell: bash
33
- steps:
34
- - uses: actions/checkout@v4
35
- - name: Pip install
36
- run: |
37
- source activate trl
38
- pip install -e ".[test]" --no-deps
39
- pip install pytest-reportlog parameterized
40
-
41
- - name: Run slow SFT tests on single GPU
42
- if: always()
43
- run: |
44
- source activate trl
45
- make slow_tests
46
-
47
- - name: Generate Report
48
- if: always()
49
- run: |
50
- pip install slack_sdk tabulate
51
- python scripts/log_reports.py >> $GITHUB_STEP_SUMMARY
52
-
53
-
54
- run_all_tests_multi_gpu:
55
- strategy:
56
- fail-fast: false
57
- matrix:
58
- docker-image-name: ["huggingface/trl-latest-gpu:latest", "huggingface/trl-source-gpu:latest"]
59
- runs-on:
60
- group: aws-g4dn-2xlarge
61
- env:
62
- CUDA_VISIBLE_DEVICES: "0,1"
63
- TEST_TYPE: "multi_gpu_${{ matrix.docker-image-name }}"
64
- container:
65
- image: ${{ matrix.docker-image-name }}
66
- options: --gpus all --shm-size "16gb" -e NVIDIA_DISABLE_REQUIRE=true
67
- defaults:
68
- run:
69
- shell: bash
70
- steps:
71
- - uses: actions/checkout@v4
72
- - name: Pip install
73
- run: |
74
- source activate trl
75
- pip install -e ".[test]" --no-deps
76
- pip install pytest-reportlog parameterized
77
-
78
- - name: Run slow SFT tests on Multi GPU
79
- if: always()
80
- run: |
81
- source activate trl
82
- make slow_tests
83
-
84
- - name: Run end-to-end examples tests on multi GPU
85
- if: always()
86
- run: |
87
- source activate trl
88
- pip install deepspeed
89
- make test_examples
90
-
91
- - name: Generate Reports
92
- if: always()
93
- run: |
94
- pip install slack_sdk tabulate
95
- python scripts/log_reports.py >> $GITHUB_STEP_SUMMARY
96
- python scripts/log_example_reports.py --text_file_name temp_results_sft_tests.txt >> $GITHUB_STEP_SUMMARY
97
- python scripts/log_example_reports.py --text_file_name temp_results_dpo_tests.txt >> $GITHUB_STEP_SUMMARY
98
- rm *.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/tests.yml DELETED
@@ -1,252 +0,0 @@
1
- name: Tests
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- paths:
8
- # Run only when relevant files are modified
9
- - ".github/**.yml"
10
- - "examples/**.py"
11
- - "scripts/**.py"
12
- - "tests/**.py"
13
- - "trl/**.py"
14
- - "setup.py"
15
-
16
- env:
17
- TQDM_DISABLE: 1
18
- CI_SLACK_CHANNEL: ${{ secrets.CI_PUSH_MAIN_CHANNEL }}
19
-
20
- jobs:
21
- check_code_quality:
22
- name: Check code quality
23
- runs-on: ubuntu-latest
24
- if: github.event.pull_request.draft == false
25
- steps:
26
- - uses: actions/checkout@v4
27
- - name: Set up Python 3.12
28
- uses: actions/setup-python@v5
29
- with:
30
- python-version: 3.12
31
- - uses: pre-commit/action@v3.0.1
32
- with:
33
- extra_args: --all-files
34
-
35
- tests:
36
- name: Tests
37
- strategy:
38
- matrix:
39
- python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
40
- fail-fast: false
41
- runs-on:
42
- group: aws-g4dn-2xlarge
43
- container:
44
- image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
45
- options: --gpus all
46
- defaults:
47
- run:
48
- shell: bash
49
- if: github.event.pull_request.draft == false
50
- steps:
51
- - name: Git checkout
52
- uses: actions/checkout@v4
53
-
54
- - name: Set up Python ${{ matrix.python-version }}
55
- uses: actions/setup-python@v5
56
- with:
57
- python-version: ${{ matrix.python-version }}
58
-
59
- - name: Install Make and Git
60
- run: |
61
- apt-get update && apt-get install -y make git curl
62
-
63
- - name: Install uv
64
- run: |
65
- curl -LsSf https://astral.sh/uv/install.sh | sh
66
-
67
- - name: Create Python virtual environment
68
- run: |
69
- uv venv
70
- uv pip install --upgrade setuptools wheel
71
-
72
- - name: Install dependencies
73
- run: |
74
- source .venv/bin/activate
75
- uv pip install ".[dev]"
76
-
77
- - name: Test with pytest
78
- run: |
79
- source .venv/bin/activate
80
- make test
81
-
82
- - name: Post to Slack
83
- if: github.ref == 'refs/heads/main' && always() # Check if the branch is main
84
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
85
- with:
86
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
87
- title: Results with Python ${{ matrix.python-version }} and latest dependencies
88
- status: ${{ job.status }}
89
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
90
-
91
- tests_dev:
92
- name: Tests with dev dependencies
93
- runs-on:
94
- group: aws-g4dn-2xlarge
95
- container:
96
- image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
97
- options: --gpus all
98
- defaults:
99
- run:
100
- shell: bash
101
- if: github.event.pull_request.draft == false
102
- steps:
103
- - name: Git checkout
104
- uses: actions/checkout@v4
105
-
106
- - name: Set up Python 3.12
107
- uses: actions/setup-python@v5
108
- with:
109
- python-version: '3.12'
110
-
111
- - name: Install Make and Git
112
- run: |
113
- apt-get update && apt-get install -y make git curl
114
-
115
- - name: Install uv
116
- run: |
117
- curl -LsSf https://astral.sh/uv/install.sh | sh
118
-
119
- - name: Create Python virtual environment
120
- run: |
121
- uv venv
122
- uv pip install --upgrade setuptools wheel
123
-
124
- - name: Install dependencies
125
- run: |
126
- source .venv/bin/activate
127
- uv pip install ".[dev]"
128
- uv pip install -U git+https://github.com/huggingface/accelerate.git
129
- uv pip install -U git+https://github.com/huggingface/datasets.git
130
- uv pip install -U git+https://github.com/huggingface/transformers.git
131
-
132
-
133
- - name: Test with pytest
134
- run: |
135
- source .venv/bin/activate
136
- make test
137
-
138
- - name: Post to Slack
139
- if: github.ref == 'refs/heads/main' && always() # Check if the branch is main
140
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
141
- with:
142
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
143
- title: Results with Python 3.12 and dev dependencies
144
- status: ${{ job.status }}
145
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
146
-
147
- tests_wo_optional_deps:
148
- name: Tests without optional dependencies
149
- runs-on:
150
- group: aws-g4dn-2xlarge
151
- container:
152
- image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
153
- options: --gpus all
154
- defaults:
155
- run:
156
- shell: bash
157
- if: github.event.pull_request.draft == false
158
- steps:
159
- - name: Git checkout
160
- uses: actions/checkout@v4
161
-
162
- - name: Set up Python 3.12
163
- uses: actions/setup-python@v5
164
- with:
165
- python-version: '3.12'
166
-
167
- - name: Install Make and Git
168
- run: |
169
- apt-get update && apt-get install -y make git curl
170
-
171
- - name: Install uv
172
- run: |
173
- curl -LsSf https://astral.sh/uv/install.sh | sh
174
-
175
- - name: Create Python virtual environment
176
- run: |
177
- uv venv
178
- uv pip install --upgrade setuptools wheel
179
-
180
- - name: Install dependencies
181
- run: |
182
- source .venv/bin/activate
183
- uv pip install ".[test]"
184
-
185
- - name: Test with pytest
186
- run: |
187
- source .venv/bin/activate
188
- make test
189
-
190
- - name: Post to Slack
191
- if: github.ref == 'refs/heads/main' && always() # Check if the branch is main
192
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
193
- with:
194
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
195
- title: Results with Python 3.12 without optional dependencies
196
- status: ${{ job.status }}
197
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
198
-
199
- tests_min_versions:
200
- name: Tests with minimum versions
201
- runs-on:
202
- group: aws-g4dn-2xlarge
203
- container:
204
- image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
205
- options: --gpus all
206
- defaults:
207
- run:
208
- shell: bash
209
- if: github.event.pull_request.draft == false
210
- steps:
211
- - name: Git checkout
212
- uses: actions/checkout@v4
213
-
214
- - name: Set up Python 3.12
215
- uses: actions/setup-python@v5
216
- with:
217
- python-version: '3.12'
218
-
219
- - name: Install Make and Git
220
- run: |
221
- apt-get update && apt-get install -y make git curl
222
-
223
- - name: Install uv
224
- run: |
225
- curl -LsSf https://astral.sh/uv/install.sh | sh
226
-
227
- - name: Create Python virtual environment
228
- run: |
229
- uv venv
230
- uv pip install --upgrade setuptools wheel
231
-
232
- - name: Install dependencies
233
- run: |
234
- source .venv/bin/activate
235
- uv pip install ".[dev]"
236
- uv pip install accelerate==1.4.0
237
- uv pip install datasets==3.0.0
238
- uv pip install transformers==4.51.0
239
-
240
- - name: Test with pytest
241
- run: |
242
- source .venv/bin/activate
243
- make test
244
-
245
- - name: Post to Slack
246
- if: github.ref == 'refs/heads/main' && always() # Check if the branch is main
247
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
248
- with:
249
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
250
- title: Results with Python 3.12 and minimum dependencies versions
251
- status: ${{ job.status }}
252
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/tests_latest.yml DELETED
@@ -1,66 +0,0 @@
1
- name: Tests latest TRL release with dev dependencies
2
-
3
- on:
4
- schedule:
5
- - cron: '0 0 * * *' # Runs daily at midnight UTC
6
-
7
- workflow_dispatch:
8
-
9
- env:
10
- TQDM_DISABLE: 1
11
- CI_SLACK_CHANNEL: ${{ secrets.CI_PUSH_MAIN_CHANNEL }}
12
-
13
- jobs:
14
- tests:
15
- name: Tests latest TRL release with dev dependencies
16
- runs-on:
17
- group: aws-g4dn-2xlarge
18
- container:
19
- image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel
20
- options: --gpus all
21
- defaults:
22
- run:
23
- shell: bash
24
- steps:
25
- - name: Git checkout
26
- uses: actions/checkout@v4
27
- with: { ref: v0.18-release }
28
-
29
- - name: Set up Python 3.12
30
- uses: actions/setup-python@v5
31
- with:
32
- python-version: '3.12'
33
-
34
- - name: Install Make and Git
35
- run: |
36
- apt-get update && apt-get install -y make git curl
37
-
38
- - name: Install uv
39
- run: |
40
- curl -LsSf https://astral.sh/uv/install.sh | sh
41
-
42
- - name: Create Python virtual environment
43
- run: |
44
- uv venv
45
- uv pip install --upgrade setuptools wheel
46
-
47
- - name: Install dependencies
48
- run: |
49
- source .venv/bin/activate
50
- uv pip install ".[dev]"
51
- uv pip install -U git+https://github.com/huggingface/accelerate.git
52
- uv pip install -U git+https://github.com/huggingface/datasets.git
53
- uv pip install -U git+https://github.com/huggingface/transformers.git
54
-
55
- - name: Test with pytest
56
- run: |
57
- source .venv/bin/activate
58
- make test
59
-
60
- - name: Post to Slack
61
- uses: huggingface/hf-workflows/.github/actions/post-slack@main
62
- with:
63
- slack_channel: ${{ env.CI_SLACK_CHANNEL }}
64
- title: Results of latest TRL with Python 3.12 and dev dependencies
65
- status: ${{ job.status }}
66
- slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/trufflehog.yml DELETED
@@ -1,18 +0,0 @@
1
- on:
2
- push:
3
-
4
- name: Secret Leaks
5
-
6
- jobs:
7
- trufflehog:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: Checkout code
11
- uses: actions/checkout@v4
12
- with:
13
- fetch-depth: 0
14
- - name: Secret Scanning
15
- uses: trufflesecurity/trufflehog@853e1e8d249fd1e29d0fcc7280d29b03df3d643d
16
- with:
17
- # exclude buggy postgres detector that is causing false positives and not relevant to our codebase
18
- extra_args: --results=verified,unknown --exclude-detectors=postgres
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.github/workflows/upload_pr_documentation.yml DELETED
@@ -1,16 +0,0 @@
1
- name: Upload PR Documentation
2
-
3
- on:
4
- workflow_run:
5
- workflows: ["Build PR Documentation"]
6
- types:
7
- - completed
8
-
9
- jobs:
10
- build:
11
- uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main
12
- with:
13
- package_name: trl
14
- secrets:
15
- hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
16
- comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}