forked from huggingface/transformers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into reenable-fa2-sdpa
- Loading branch information
Showing
272 changed files
with
17,012 additions
and
1,487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Send message to slack | ||
|
||
description: 'Send results to slack' | ||
author: 'Hugging Face' | ||
inputs: | ||
slack_channel: | ||
required: true | ||
type: string | ||
title: | ||
required: true | ||
type: string | ||
status: | ||
required: true | ||
type: string | ||
slack_token: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create content to post | ||
id: create-message | ||
run: | | ||
if [ "${{ inputs.status }}" == "success" ]; then | ||
echo STATUS_MESSAGE='🟢 Tests are passing!' >> $GITHUB_ENV | ||
else | ||
echo STATUS_MESSAGE='🔴 Tests failed! Please check the GitHub action link below' >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
|
||
- name: Post Canceled results Slack channel | ||
id: post-slack | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 | ||
with: | ||
# Slack channel id, channel name, or user id to post message. | ||
# See also: https://api.slack.com/methods/chat.postMessage#channels | ||
channel-id: ${{ inputs.slack_channel }} | ||
# For posting a rich message using Block Kit | ||
payload: | | ||
{ | ||
"text": "${{ inputs.title }}", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "${{ inputs.title }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ env.STATUS_MESSAGE }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "*Click the button for more details about the commit*"}, | ||
"accessory": { | ||
"type": "button", | ||
"text": {"type": "plain_text", "text": "Check Commit results"}, | ||
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": {"type": "mrkdwn", "text": "*Click here for more details about the action ran*"}, | ||
"accessory": { | ||
"type": "button", | ||
"text": {"type": "plain_text", "text": "Check Action results"}, | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ inputs.slack_token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Doctest job | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
job_splits: | ||
required: true | ||
type: string | ||
split_keys: | ||
required: true | ||
type: string | ||
|
||
env: | ||
HF_HOME: /mnt/cache | ||
TRANSFORMERS_IS_CI: yes | ||
RUN_SLOW: yes | ||
OMP_NUM_THREADS: 16 | ||
MKL_NUM_THREADS: 16 | ||
SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }} | ||
TF_FORCE_GPU_ALLOW_GROWTH: true | ||
|
||
jobs: | ||
run_doctests: | ||
name: " " | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
split_keys: ${{ fromJson(inputs.split_keys) }} | ||
runs-on: [single-gpu, nvidia-gpu, t4, ci] | ||
container: | ||
image: huggingface/transformers-all-latest-gpu | ||
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | ||
steps: | ||
- name: Update clone | ||
working-directory: /transformers | ||
run: git fetch && git checkout ${{ github.sha }} | ||
|
||
- name: Reinstall transformers in edit mode (remove the one installed during docker image build) | ||
working-directory: /transformers | ||
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .[flax] | ||
|
||
- name: GPU visibility | ||
working-directory: /transformers | ||
run: | | ||
python3 utils/print_env.py | ||
- name: Show installed libraries and their versions | ||
run: pip freeze | ||
|
||
- name: Get doctest files | ||
working-directory: /transformers | ||
run: | | ||
echo "${{ toJson(fromJson(inputs.job_splits)[matrix.split_keys]) }}" > doc_tests.txt | ||
cat doc_tests.txt | ||
- name: Set `split_keys` | ||
shell: bash | ||
run: | | ||
echo "${{ matrix.split_keys }}" | ||
split_keys=${{ matrix.split_keys }} | ||
split_keys=${split_keys//'/'/'_'} | ||
echo "split_keys" | ||
echo "split_keys=$split_keys" >> $GITHUB_ENV | ||
- name: Run doctests | ||
working-directory: /transformers | ||
run: | | ||
cat doc_tests.txt | ||
python3 -m pytest -v --make-reports doc_tests_gpu_${{ env.split_keys }} --doctest-modules $(cat doc_tests.txt) -sv --doctest-continue-on-failure --doctest-glob="*.md" | ||
- name: Failure short reports | ||
if: ${{ failure() }} | ||
continue-on-error: true | ||
run: cat /transformers/reports/doc_tests_gpu_${{ env.split_keys }}/failures_short.txt | ||
|
||
- name: "Test suite reports artifacts: doc_tests_gpu_test_reports_${{ env.split_keys }}" | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: doc_tests_gpu_test_reports_${{ env.split_keys }} | ||
path: /transformers/reports/doc_tests_gpu_${{ env.split_keys }} |
Oops, something went wrong.