Skip to content

Commit 0d784cf

Browse files
committed
Merge commit 'fb0b0bd018' into qwen3.8-metal-perf
# Conflicts: # docs/source/en/quantization/finegrained_fp8.md # docs/source/en/quantization/mxfp4.md # docs/source/en/quantization/nvfp4.md # src/transformers/integrations/finegrained_fp8.py # src/transformers/integrations/hub_kernels.py # src/transformers/quantizers/quantizer_finegrained_fp8.py
2 parents c9fd884 + fb0b0bd commit 0d784cf

1,877 files changed

Lines changed: 75332 additions & 41971 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.

‎.gitattributes‎

Lines changed: 0 additions & 642 deletions
Large diffs are not rendered by default.

‎.github/workflows/benchmark.yml‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎.github/workflows/benchmark_v2.yml‎

Lines changed: 0 additions & 93 deletions
This file was deleted.

‎.github/workflows/benchmark_v2_a10_caller.yml‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎.github/workflows/benchmark_v2_mi300_caller.yml‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929

3030
if: ${{ contains(github.event.head_commit.message, '[build-ci-image]') || contains(github.event.head_commit.message, '[push-ci-image]') && '!cancelled()' || github.event_name == 'schedule' }}
3131

32+
# `enforcement: audit` on the Wiz scan below, and on the two GPU images in
33+
# build-docker-images.yml: these carry the CVEs of a base we do not choose, and the
34+
# clusters only require that a scan exists, not that it passed.
3235
strategy:
3336
matrix:
3437
file: ["quality", "consistency", "custom-tokenizers", "torch-light", "exotic-models"]
@@ -58,19 +61,39 @@ jobs:
5861
with:
5962
username: ${{ secrets.DOCKERHUB_USERNAME }}
6063
password: ${{ secrets.DOCKERHUB_PASSWORD }}
64+
# `--load` rather than `--push`: the Wiz CLI reads the local image store and never
65+
# pulls, so the image is scanned here and pushed by the step after the scan.
6166
-
6267
# `docker/docker-bake.hcl` builds `ci-base.dockerfile` first, on the Python from `.python-version`
6368
name: Build ${{ matrix.file }}.dockerfile
6469
env:
6570
REF: ${{ github.sha }}
6671
TARGET: ${{ matrix.file }}
67-
PUSH: ${{ contains(github.event.head_commit.message, 'ci-image]') || github.event_name == 'schedule' }}
6872
run: |
6973
PYTHON_VERSION="$(cat .python-version)"
7074
export PYTHON_VERSION
71-
args=(-f docker/docker-bake.hcl "$TARGET")
72-
if [ "$PUSH" = "true" ]; then args+=(--push); fi
73-
docker buildx bake "${args[@]}"
75+
docker buildx bake -f docker/docker-bake.hcl --load "$TARGET"
76+
-
77+
name: Scan ${{ matrix.file }}.dockerfile
78+
uses: huggingface/wiz-image-action/scan@53a5b4af184193adf1773753f29b3f903445e31b # v1.3.0
79+
with:
80+
image: huggingface/transformers-${{ matrix.file }}${{ env.TAG_SUFFIX }}
81+
dockerfile: docker/${{ matrix.file }}.dockerfile
82+
clientId: ${{ vars.WIZ_CLI_CLIENT_ID }}
83+
clientSecret: ${{ secrets.WIZ_CLI_CLIENT_SECRET }}
84+
enforcement: audit
85+
-
86+
name: Push ${{ matrix.file }}.dockerfile
87+
env:
88+
IMAGE: huggingface/transformers-${{ matrix.file }}${{ env.TAG_SUFFIX }}
89+
run: docker push "$IMAGE"
90+
-
91+
name: Register ${{ matrix.file }}.dockerfile with Wiz
92+
uses: huggingface/wiz-image-action/register@53a5b4af184193adf1773753f29b3f903445e31b # v1.3.0
93+
with:
94+
image: huggingface/transformers-${{ matrix.file }}${{ env.TAG_SUFFIX }}
95+
clientId: ${{ vars.WIZ_CLI_CLIENT_ID }}
96+
clientSecret: ${{ secrets.WIZ_CLI_CLIENT_SECRET }}
7497

7598
notify:
7699
permissions: {}

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

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,41 @@ jobs:
4747
name: Read Python version
4848
id: python
4949
run: echo "version=$(cat .python-version)" >> "$GITHUB_OUTPUT"
50+
# Build, scan, push and register as separate steps, because the build needs
51+
# `build-contexts`, which wiz-image-action/build-push does not take. `load: true`
52+
# because the Wiz CLI reads the local image store and never pulls.
5053
-
51-
name: Build and push
54+
name: Build
5255
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
5356
with:
5457
context: ./docker/transformers-all-latest-gpu
5558
build-contexts: gpu-common=./docker/gpu-common
5659
build-args: |
5760
REF=main
5861
PYTHON_VERSION=${{ steps.python.outputs.version }}
59-
push: true
62+
load: true
6063
tags: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
64+
-
65+
name: Scan
66+
uses: huggingface/wiz-image-action/scan@53a5b4af184193adf1773753f29b3f903445e31b # v1.3.0
67+
with:
68+
image: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
69+
dockerfile: docker/transformers-all-latest-gpu/Dockerfile
70+
clientId: ${{ vars.WIZ_CLI_CLIENT_ID }}
71+
clientSecret: ${{ secrets.WIZ_CLI_CLIENT_SECRET }}
72+
enforcement: audit
73+
-
74+
name: Push
75+
env:
76+
IMAGE: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
77+
run: docker push "$IMAGE"
78+
-
79+
name: Register with Wiz
80+
uses: huggingface/wiz-image-action/register@53a5b4af184193adf1773753f29b3f903445e31b # v1.3.0
81+
with:
82+
image: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
83+
clientId: ${{ vars.WIZ_CLI_CLIENT_ID }}
84+
clientSecret: ${{ secrets.WIZ_CLI_CLIENT_SECRET }}
6185

6286
- name: Post to Slack
6387
if: always()
@@ -230,14 +254,16 @@ jobs:
230254
username: ${{ secrets.DOCKERHUB_USERNAME }}
231255
password: ${{ secrets.DOCKERHUB_PASSWORD }}
232256
-
233-
name: Build and push
234-
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
257+
name: Build, scan and push
258+
uses: huggingface/wiz-image-action/build-push@53a5b4af184193adf1773753f29b3f903445e31b # v1.3.0
235259
with:
260+
image: huggingface/transformers-pytorch-amd-gpu${{ inputs.image_postfix }}
236261
context: ./docker/transformers-pytorch-amd-gpu
237262
build-args: |
238263
REF=${{ github.sha }}
239-
push: true
240-
tags: huggingface/transformers-pytorch-amd-gpu${{ inputs.image_postfix }}
264+
clientId: ${{ vars.WIZ_CLI_CLIENT_ID }}
265+
clientSecret: ${{ secrets.WIZ_CLI_CLIENT_SECRET }}
266+
enforcement: audit
241267

242268
- name: Post to Slack
243269
if: always()

‎.github/workflows/docs-check-trigger.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Docs check trigger
22

3-
# Runs whenever someone submits a review on a PR and continues if the PR is approved by a maintainer and targets the main branch. It writes the PR number to a small file, saves it, and passes it to the next step.
3+
# Runs when someone submits a review on a PR. If a maintainer approved the PR
4+
# and it targets main, this saves the PR number and the approved commit for the
5+
# `approval` job in `docs-check.yml`.
6+
#
7+
# The approved commit comes from the review itself. When an approval comes a few
8+
# seconds after a push, the run can still point to the commit before it.
49

510
on:
611
pull_request_review:
@@ -17,14 +22,16 @@ jobs:
1722
contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.review.author_association)
1823
runs-on: ubuntu-22.04
1924
steps:
20-
- name: Record PR number
25+
- name: Record PR number and approved commit
2126
env:
2227
PR_NUMBER: ${{ github.event.pull_request.number }}
28+
REVIEW_SHA: ${{ github.event.review.commit_id }}
2329
run: |
2430
mkdir -p docs-check-pr
2531
echo "${PR_NUMBER}" > docs-check-pr/number
32+
echo "${REVIEW_SHA}" > docs-check-pr/sha
2633
27-
- name: Upload PR number
34+
- name: Upload PR number and approved commit
2835
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2936
with:
3037
name: docs-check-pr

‎.github/workflows/docs-check.yml‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
name: Docs check
22

3-
# Shows a `docs-check` status on each PR: green if it doesn't need docs, red if it
4-
# does, and pending until a maintainer approves it. The code that does this lives
5-
# in transformers-ci (this file only calls it), and the rules are in `.ai/docs-check-rules.md`.
3+
# Adds a `docs-check` status to each PR. It's green if the PR doesn't need docs,
4+
# red if it does, and pending until a maintainer approves the PR. The rules for
5+
# what needs docs are in `.ai/docs-check-rules.md`. The code is in
6+
# transformers-ci. This file only calls it.
67
#
78
# There are two jobs:
8-
# - `approval` runs after a maintainer approves a PR. It asks whether the PR
9-
# needs docs, leaves a comment if it does, and sets the status.
10-
# - `push` runs when a PR is opened or updated. It doesn't ask again and
11-
# reuses the last answer, so editing `docs/source/en` turns the status green.
9+
# - `approval` runs after a maintainer approves a PR. It asks Serge whether the
10+
# PR needs docs, comments if it does, and sets the status. Runs for the same
11+
# PR wait for each other, so Serge isn't asked about one PR twice at once.
12+
# - `push` runs when a PR is opened or updated. It reuses the last answer
13+
# instead of asking again, so editing `docs/source/en` turns the status green.
1214
#
13-
# For now the status is only a signal. It doesn't block merging. Neither job runs
14-
# any code from the PR.
15+
# The status doesn't block merging. None of the jobs runs code from the PR.
1516

1617
on:
1718
workflow_run:
@@ -31,7 +32,7 @@ jobs:
3132
github.event.workflow_run.event == 'pull_request_review' &&
3233
github.event.workflow_run.conclusion == 'success'
3334
concurrency:
34-
group: docs-check-${{ github.event.workflow_run.head_sha }}
35+
group: docs-check-approval-${{ github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_branch }}
3536
cancel-in-progress: false
3637
permissions:
3738
actions: read

‎.github/workflows/extras-smoke-test.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
permissions:
1616
contents: read
1717
name: Get supported Python versions
18+
if: github.repository == 'huggingface/transformers'
1819
runs-on: ubuntu-latest
1920
outputs:
2021
versions: ${{ steps.extract-versions.outputs.versions }}
@@ -125,6 +126,7 @@ jobs:
125126
precheck-slack:
126127
permissions: {}
127128
name: Check Slack token availability
129+
if: github.repository == 'huggingface/transformers'
128130
runs-on: ubuntu-latest
129131
outputs:
130132
has_slack_token: ${{ steps.chk.outputs.has_token }}

0 commit comments

Comments
 (0)