Skip to content

Commit 7d10c0b

Browse files
authored
Merge branch 'main' into llava_onevision1_5_support
2 parents 78cf6cf + d4dcef7 commit 7d10c0b

1,609 files changed

Lines changed: 51414 additions & 79737 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.circleci/config.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
- run: uv pip install -U -e .
4747
- run: echo 'export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)"' >> "$BASH_ENV" && source "$BASH_ENV"
4848
- run: mkdir -p test_preparation
49-
- run: python utils/tests_fetcher.py | tee tests_fetched_summary.txt
50-
- run: python utils/tests_fetcher.py --filter_tests
49+
- run: python utils/tests_fetcher.py | tee tests_fetched_summary.txt || true
50+
- run: python utils/tests_fetcher.py --filter_tests || true
5151
- run: export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)" && echo $GIT_COMMIT_MESSAGE && python .circleci/create_circleci_config.py --fetcher_folder test_preparation
5252
- run: |
5353
if [ ! -s test_preparation/generated_config.yml ]; then
@@ -98,8 +98,8 @@ jobs:
9898
- run: uv pip install -U -e .
9999
- run: echo 'export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)"' >> "$BASH_ENV" && source "$BASH_ENV"
100100
- run: mkdir -p test_preparation
101-
- run: python utils/tests_fetcher.py --fetch_all | tee tests_fetched_summary.txt
102-
- run: python utils/tests_fetcher.py --filter_tests
101+
- run: python utils/tests_fetcher.py --fetch_all | tee tests_fetched_summary.txt || true
102+
- run: python utils/tests_fetcher.py --filter_tests || true
103103
- run: export "GIT_COMMIT_MESSAGE=$(git show -s --format=%s)" && echo $GIT_COMMIT_MESSAGE && python .circleci/create_circleci_config.py --fetcher_folder test_preparation
104104
- run: |
105105
if [ ! -s test_preparation/generated_config.yml ]; then

‎.github/scripts/codeowners_for_review_action‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ tests/generation/ @gante
2222
/src/transformers/models/auto/ @ArthurZucker
2323
/src/transformers/utils/ @ArthurZucker @Rocketknight1
2424
/src/transformers/loss/ @ArthurZucker
25-
/src/transformers/onnx/ @michaelbenayoun
2625

2726
# Specific files come after the sections/globs, so they take priority
2827
/.circleci/config.yml @ArthurZucker @ydshieh

‎.github/workflows/benchmark.yml‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,19 @@ jobs:
2828
(github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-benchmark') )||
2929
(github.event_name == 'push' && github.ref == 'refs/heads/main')
3030
container:
31-
image: huggingface/transformers-pytorch-gpu
31+
image: huggingface/transformers-all-latest-gpu
3232
options: --gpus all --privileged --ipc host
3333
steps:
3434
- name: Get repo
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@v5
3636
with:
37-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
37+
fetch-depth: 1
3838

3939
- name: Install benchmark script dependencies
4040
run: python3 -m pip install -r benchmark_v2/requirements.txt kernels
4141

4242
- name: Reinstall transformers in edit mode (remove the one installed during docker image build)
43-
working-directory: /transformers
44-
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e ".[torch]" && python3 -m pip uninstall -y torchvision # temp fix
43+
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e ".[torch]"
4544

4645
- name: Run benchmark
4746
run: |
@@ -52,7 +51,7 @@ jobs:
5251
commit_id=$GITHUB_SHA
5352
fi
5453
commit_msg=$(git show -s --format=%s | cut -c1-70)
55-
python3 benchmark_v2/run_benchmarks.py -b 32 -s 128 -n 256 --branch-name "$BRANCH_NAME" --commit-id "$commit_id" --commit-message "$commit_msg" --model-id "$MODEL_ID" --log-level INFO --push-result-to-dataset "$DATASET_ID"
54+
python3 benchmark_v2/run_benchmarks.py -b 32 -s 128 -n 256 --level 2 --branch-name "$BRANCH_NAME" --commit-id "$commit_id" --commit-message "$commit_msg" --model-id "$MODEL_ID" --log-level INFO --push-result-to-dataset "$DATASET_ID"
5655
env:
5756
HF_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
5857
PUSH_TO_HUB_TOKEN: ${{ secrets.PUSH_TO_HUB_TOKEN }}

‎.github/workflows/benchmark_v2_a10_caller.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
uses: ./.github/workflows/benchmark_v2.yml
1010
with:
1111
runner: aws-g5-4xlarge-cache-use1-public-80
12-
container_image: huggingface/transformers-pytorch-gpu
12+
container_image: huggingface/transformers-all-latest-gpu
1313
container_options: --gpus all --privileged --ipc host --shm-size "16gb"
1414
commit_sha: ${{ github.sha }}
1515
run_id: ${{ github.run_id }}

‎.github/workflows/build-docker-images.yml‎

Lines changed: 44 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,20 @@ jobs:
4545
REF=main
4646
push: true
4747
tags: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
48-
# Push CI images still need to be re-built daily
49-
-
50-
name: Build and push (for Push CI) in a daily basis
51-
# This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
52-
# The later case is useful for manual image building for debugging purpose. Use another tag in this case!
53-
if: inputs.image_postfix != '-push-ci'
54-
uses: docker/build-push-action@v5
55-
with:
56-
context: ./docker/transformers-all-latest-gpu
57-
build-args: |
58-
REF=main
59-
push: true
60-
tags: huggingface/transformers-all-latest-gpu-push-ci
6148

6249
- name: Post to Slack
6350
if: always()
6451
uses: huggingface/hf-workflows/.github/actions/post-slack@main
6552
with:
6653
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
67-
title: 🤗 Results of the transformers-all-latest-gpu-push-ci docker build
54+
title: 🤗 Results of the transformers-all-latest-gpu docker build
6855
status: ${{ job.status }}
6956
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
7057

71-
latest-torch-deepspeed-docker:
72-
name: "Latest PyTorch + DeepSpeed"
58+
flash-attn-ci-image:
59+
name: "PyTorch with Flash Attn [dev]"
7360
runs-on:
74-
group: aws-g4dn-2xlarge-cache
61+
group: aws-general-8-plus
7562
steps:
7663
-
7764
name: Set up Docker Buildx
@@ -89,24 +76,26 @@ jobs:
8976
name: Build and push
9077
uses: docker/build-push-action@v5
9178
with:
92-
context: ./docker/transformers-pytorch-deepspeed-latest-gpu
79+
context: ./docker/transformers-all-latest-gpu
9380
build-args: |
9481
REF=main
82+
PYTORCH=2.8.0
83+
TORCHCODEC=0.7.0
84+
FLASH_ATTN=yes
9585
push: true
96-
tags: huggingface/transformers-pytorch-deepspeed-latest-gpu${{ inputs.image_postfix }}
86+
tags: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}:flash-attn
9787

9888
- name: Post to Slack
9989
if: always()
10090
uses: huggingface/hf-workflows/.github/actions/post-slack@main
10191
with:
102-
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER}}
103-
title: 🤗 Results of the transformers-pytorch-deepspeed-latest-gpu docker build
92+
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
93+
title: 🤗 Results of the transformers-all-latest-gpu docker build
10494
status: ${{ job.status }}
10595
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
10696

107-
# Can't build 2 images in a single job `latest-torch-deepspeed-docker` (for `nvcr.io/nvidia`)
108-
latest-torch-deepspeed-docker-for-push-ci-daily-build:
109-
name: "Latest PyTorch + DeepSpeed (Push CI - Daily Build)"
97+
latest-torch-deepspeed-docker:
98+
name: "Latest PyTorch + DeepSpeed"
11099
runs-on:
111100
group: aws-general-8-plus
112101
steps:
@@ -122,33 +111,27 @@ jobs:
122111
with:
123112
username: ${{ secrets.DOCKERHUB_USERNAME }}
124113
password: ${{ secrets.DOCKERHUB_PASSWORD }}
125-
# Push CI images still need to be re-built daily
126114
-
127-
name: Build and push (for Push CI) in a daily basis
128-
# This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
129-
# The later case is useful for manual image building for debugging purpose. Use another tag in this case!
130-
if: inputs.image_postfix != '-push-ci'
115+
name: Build and push
131116
uses: docker/build-push-action@v5
132117
with:
133118
context: ./docker/transformers-pytorch-deepspeed-latest-gpu
134119
build-args: |
135120
REF=main
136121
push: true
137-
tags: huggingface/transformers-pytorch-deepspeed-latest-gpu-push-ci
122+
tags: huggingface/transformers-pytorch-deepspeed-latest-gpu${{ inputs.image_postfix }}
138123

139124
- name: Post to Slack
140125
if: always()
141126
uses: huggingface/hf-workflows/.github/actions/post-slack@main
142127
with:
143-
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
144-
title: 🤗 Results of the transformers-pytorch-deepspeed-latest-gpu-push-ci docker build
128+
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER}}
129+
title: 🤗 Results of the transformers-pytorch-deepspeed-latest-gpu docker build
145130
status: ${{ job.status }}
146131
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
147132

148133
doc-builder:
149134
name: "Doc builder"
150-
# Push CI doesn't need this image
151-
if: inputs.image_postfix != '-push-ci'
152135
runs-on:
153136
group: aws-general-8-plus
154137
steps:
@@ -181,12 +164,10 @@ jobs:
181164
status: ${{ job.status }}
182165
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
183166

184-
latest-pytorch:
185-
name: "Latest PyTorch [dev]"
186-
# Push CI doesn't need this image
187-
if: inputs.image_postfix != '-push-ci'
167+
latest-pytorch-amd:
168+
name: "Latest PyTorch (AMD) [dev]"
188169
runs-on:
189-
group: aws-general-8-plus
170+
group: aws-highcpu-32-priv
190171
steps:
191172
-
192173
name: Set up Docker Buildx
@@ -204,69 +185,51 @@ jobs:
204185
name: Build and push
205186
uses: docker/build-push-action@v5
206187
with:
207-
context: ./docker/transformers-pytorch-gpu
188+
context: ./docker/transformers-pytorch-amd-gpu
208189
build-args: |
209190
REF=main
210191
push: true
211-
tags: huggingface/transformers-pytorch-gpu
192+
tags: huggingface/transformers-pytorch-amd-gpu${{ inputs.image_postfix }}
212193

213194
- name: Post to Slack
214195
if: always()
215196
uses: huggingface/hf-workflows/.github/actions/post-slack@main
216197
with:
217198
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
218-
title: 🤗 Results of the huggingface/transformers-pytorch-gpudocker build
199+
title: 🤗 Results of the huggingface/transformers-pytorch-amd-gpu build
219200
status: ${{ job.status }}
220201
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
221202

222-
latest-pytorch-amd:
223-
name: "Latest PyTorch (AMD) [dev]"
203+
cache-latest-pytorch-amd:
204+
name: "Cache Latest Pytorch (AMD) Image"
205+
needs: latest-pytorch-amd
224206
runs-on:
225-
group: aws-highcpu-32-priv
207+
group: amd-mi325-1gpu
226208
steps:
227-
-
228-
name: Set up Docker Buildx
229-
uses: docker/setup-buildx-action@v3
230-
-
231-
name: Check out code
232-
uses: actions/checkout@v4
233209
-
234210
name: Login to DockerHub
235211
uses: docker/login-action@v3
236212
with:
237213
username: ${{ secrets.DOCKERHUB_USERNAME }}
238214
password: ${{ secrets.DOCKERHUB_PASSWORD }}
239-
-
240-
name: Build and push
241-
uses: docker/build-push-action@v5
242-
with:
243-
context: ./docker/transformers-pytorch-amd-gpu
244-
build-args: |
245-
REF=main
246-
push: true
247-
tags: huggingface/transformers-pytorch-amd-gpu${{ inputs.image_postfix }}
248-
# Push CI images still need to be re-built daily
249-
-
250-
name: Build and push (for Push CI) in a daily basis
251-
# This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
252-
# The later case is useful for manual image building for debugging purpose. Use another tag in this case!
253-
if: inputs.image_postfix != '-push-ci'
254-
uses: docker/build-push-action@v5
255-
with:
256-
context: ./docker/transformers-pytorch-amd-gpu
257-
build-args: |
258-
REF=main
259-
push: true
260-
tags: huggingface/transformers-pytorch-amd-gpu-push-ci
215+
216+
-
217+
name: Pull and save docker image to cache
218+
run: |
219+
image="huggingface/transformers-pytorch-amd-gpu"
220+
final_path="/mnt/image-cache/transformers-pytorch-amd-gpu.tar"
221+
tmp_path="${final_path}.tmp"
261222
262-
- name: Post to Slack
263-
if: always()
264-
uses: huggingface/hf-workflows/.github/actions/post-slack@main
265-
with:
266-
slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
267-
title: 🤗 Results of the huggingface/transformers-pytorch-amd-gpu-push-ci build
268-
status: ${{ job.status }}
269-
slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
223+
echo "Pulling image: ${image}"
224+
docker pull "${image}"
225+
226+
echo "Saving to temp file: ${tmp_path}"
227+
docker save "${image}" -o "${tmp_path}"
228+
229+
echo "Moving to final path: ${final_path}"
230+
mv -f "${tmp_path}" "${final_path}"
231+
232+
echo "Cache populated successfully at ${final_path}"
270233
271234
latest-pytorch-deepspeed-amd:
272235
name: "PyTorch + DeepSpeed (AMD) [dev]"
@@ -294,19 +257,6 @@ jobs:
294257
REF=main
295258
push: true
296259
tags: huggingface/transformers-pytorch-deepspeed-amd-gpu${{ inputs.image_postfix }}
297-
# Push CI images still need to be re-built daily
298-
-
299-
name: Build and push (for Push CI) in a daily basis
300-
# This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
301-
# The later case is useful for manual image building for debugging purpose. Use another tag in this case!
302-
if: inputs.image_postfix != '-push-ci'
303-
uses: docker/build-push-action@v5
304-
with:
305-
context: ./docker/transformers-pytorch-deepspeed-amd-gpu
306-
build-args: |
307-
REF=main
308-
push: true
309-
tags: huggingface/transformers-pytorch-deepspeed-amd-gpu-push-ci
310260

311261
- name: Post to Slack
312262
if: always()
@@ -319,8 +269,6 @@ jobs:
319269

320270
latest-quantization-torch-docker:
321271
name: "Latest Pytorch + Quantization [dev]"
322-
# Push CI doesn't need this image
323-
if: inputs.image_postfix != '-push-ci'
324272
runs-on:
325273
group: aws-general-8-plus
326274
steps:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Check Permissions Advisor
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
workflow_name:
8+
description: 'Workflow file name'
9+
type: string
10+
run_count:
11+
description: 'Number of runs to analyze'
12+
type: string
13+
default: "10"
14+
15+
jobs:
16+
advisor:
17+
uses: huggingface/security-workflows/.github/workflows/permissions-advisor-reusable.yml@main
18+
permissions:
19+
actions: read
20+
contents: read
21+
with:
22+
workflow_name: ${{ inputs.workflow_name }}
23+
run_count: ${{ fromJSON(inputs.run_count) }}

0 commit comments

Comments
 (0)