AdithyaSK HF Staff commited on
Commit
451328f
·
verified ·
1 Parent(s): 1d6d33d

Stage Harbor release files 12501-13000

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. tasks/tasksmith-333d8be2d5aa/tests/source/.circleci/parse_test_outputs.py +70 -0
  2. tasks/tasksmith-333d8be2d5aa/tests/source/.gitattributes +4 -0
  3. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/bug-report.yml +127 -0
  4. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/config.yml +12 -0
  5. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/feature-request.yml +31 -0
  6. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/i18n.md +46 -0
  7. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/migration.yml +72 -0
  8. tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/new-model-addition.yml +31 -0
  9. tasks/tasksmith-333d8be2d5aa/tests/source/.github/PULL_REQUEST_TEMPLATE.md +79 -0
  10. tasks/tasksmith-333d8be2d5aa/tests/source/.github/conda/build.sh +1 -0
  11. tasks/tasksmith-333d8be2d5aa/tests/source/.github/conda/meta.yaml +56 -0
  12. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/TROUBLESHOOT.md +9 -0
  13. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/add-model-like.yml +80 -0
  14. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/benchmark.yml +74 -0
  15. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-ci-docker-images.yml +77 -0
  16. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-docker-images.yml +393 -0
  17. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-nightly-ci-docker-images.yml +67 -0
  18. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-past-ci-docker-images.yml +101 -0
  19. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build_documentation.yml +23 -0
  20. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build_pr_documentation.yml +18 -0
  21. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/check_failed_model_tests.yml +129 -0
  22. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/check_tiny_models.yml +82 -0
  23. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/doctest_job.yml +83 -0
  24. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/doctests.yml +89 -0
  25. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/model_jobs.yml +139 -0
  26. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/model_jobs_amd.yml +129 -0
  27. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/push-important-models.yml +136 -0
  28. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/release-conda.yml +47 -0
  29. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-nightly-caller.yml +43 -0
  30. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-nightly-past-ci-caller.yml +99 -0
  31. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-past-caller.yml +40 -0
  32. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi210-caller.yml +25 -0
  33. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi250-caller.yml +25 -0
  34. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi300-caller.yml +25 -0
  35. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd.yml +335 -0
  36. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-caller.yml +54 -0
  37. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push.yml +653 -0
  38. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-caller.yml +14 -0
  39. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-mi210-caller.yml +55 -0
  40. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-mi250-caller.yml +55 -0
  41. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd.yml +349 -0
  42. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-caller.yml +78 -0
  43. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled.yml +574 -0
  44. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/slack-report.yml +101 -0
  45. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/ssh-runner.yml +114 -0
  46. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/stale.yml +29 -0
  47. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/trufflehog.yml +18 -0
  48. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/update_metdata.yml +27 -0
  49. tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/upload_pr_documentation.yml +16 -0
  50. tasks/tasksmith-333d8be2d5aa/tests/source/.gitignore +169 -0
tasks/tasksmith-333d8be2d5aa/tests/source/.circleci/parse_test_outputs.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import argparse
3
+
4
+ def parse_pytest_output(file_path):
5
+ skipped_tests = {}
6
+ skipped_count = 0
7
+ with open(file_path, 'r') as file:
8
+ for line in file:
9
+ match = re.match(r'^SKIPPED \[(\d+)\] (tests/.*): (.*)$', line)
10
+ if match:
11
+ skipped_count += 1
12
+ test_file, test_line, reason = match.groups()
13
+ skipped_tests[reason] = skipped_tests.get(reason, []) + [(test_file, test_line)]
14
+ for k,v in sorted(skipped_tests.items(), key=lambda x:len(x[1])):
15
+ print(f"{len(v):4} skipped because: {k}")
16
+ print("Number of skipped tests:", skipped_count)
17
+
18
+ def parse_pytest_failure_output(file_path):
19
+ failed_tests = {}
20
+ failed_count = 0
21
+ with open(file_path, 'r') as file:
22
+ for line in file:
23
+ match = re.match(r'^FAILED (tests/.*) - (.*): (.*)$', line)
24
+ if match:
25
+ failed_count += 1
26
+ _, error, reason = match.groups()
27
+ failed_tests[reason] = failed_tests.get(reason, []) + [error]
28
+ for k,v in sorted(failed_tests.items(), key=lambda x:len(x[1])):
29
+ print(f"{len(v):4} failed because `{v[0]}` -> {k}")
30
+ print("Number of failed tests:", failed_count)
31
+ if failed_count>0:
32
+ exit(1)
33
+
34
+ def parse_pytest_errors_output(file_path):
35
+ print(file_path)
36
+ error_tests = {}
37
+ error_count = 0
38
+ with open(file_path, 'r') as file:
39
+ for line in file:
40
+ match = re.match(r'^ERROR (tests/.*) - (.*): (.*)$', line)
41
+ if match:
42
+ error_count += 1
43
+ _, test_error, reason = match.groups()
44
+ error_tests[reason] = error_tests.get(reason, []) + [test_error]
45
+ for k,v in sorted(error_tests.items(), key=lambda x:len(x[1])):
46
+ print(f"{len(v):4} errored out because of `{v[0]}` -> {k}")
47
+ print("Number of errors:", error_count)
48
+ if error_count>0:
49
+ exit(1)
50
+
51
+ def main():
52
+ parser = argparse.ArgumentParser()
53
+ parser.add_argument("--file", help="file to parse")
54
+ parser.add_argument("--skip", action="store_true", help="show skipped reasons")
55
+ parser.add_argument("--fail", action="store_true", help="show failed tests")
56
+ parser.add_argument("--errors", action="store_true", help="show failed tests")
57
+ args = parser.parse_args()
58
+
59
+ if args.skip:
60
+ parse_pytest_output(args.file)
61
+
62
+ if args.fail:
63
+ parse_pytest_failure_output(args.file)
64
+
65
+ if args.errors:
66
+ parse_pytest_errors_output(args.file)
67
+
68
+
69
+ if __name__ == "__main__":
70
+ main()
tasks/tasksmith-333d8be2d5aa/tests/source/.gitattributes ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ *.py eol=lf
2
+ *.rst eol=lf
3
+ *.md eol=lf
4
+ *.mdx eol=lf
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/bug-report.yml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F41B Bug Report"
2
+ description: Submit a bug report to help us improve transformers
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
+ Before you submit your bug report:
11
+
12
+ - If it is your first time submitting, be sure to check our [bug report guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#did-you-find-a-bug)
13
+ - Try our [docs bot](https://huggingface.co/spaces/huggingchat/hf-docs-chat) -- it might be able to help you with your issue
14
+
15
+ - type: textarea
16
+ id: system-info
17
+ attributes:
18
+ label: System Info
19
+ description: Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.
20
+ placeholder: transformers version, platform, python version, ...
21
+ validations:
22
+ required: true
23
+
24
+ - type: textarea
25
+ id: who-can-help
26
+ attributes:
27
+ label: Who can help?
28
+ description: |
29
+ Your issue will be replied to more quickly if you can figure out the right person to tag with @
30
+ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
31
+
32
+ All issues are read by one of the core maintainers, so if you don't know who to tag, just leave this blank and
33
+ a core maintainer will ping the right person.
34
+
35
+ Please tag fewer than 3 people.
36
+
37
+ Models:
38
+
39
+ - text models: @ArthurZucker
40
+ - vision models: @amyeroberts, @qubvel
41
+ - speech models: @ylacombe, @eustlb
42
+ - graph models: @clefourrier
43
+
44
+ Library:
45
+
46
+ - flax: @sanchit-gandhi
47
+ - generate: @zucchini-nlp (visual-language models) or @gante (all others)
48
+ - pipelines: @Rocketknight1
49
+ - tensorflow: @gante and @Rocketknight1
50
+ - tokenizers: @ArthurZucker and @itazap
51
+ - trainer: @muellerzr @SunMarc
52
+
53
+ Integrations:
54
+
55
+ - deepspeed: HF Trainer/Accelerate: @muellerzr
56
+ - ray/raytune: @richardliaw, @amogkam
57
+ - Big Model Inference: @SunMarc
58
+ - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
59
+
60
+ Documentation: @stevhliu
61
+
62
+ Model hub:
63
+
64
+ - for issues with a model, report at https://discuss.huggingface.co/ and tag the model's creator.
65
+
66
+ HF projects:
67
+
68
+ - accelerate: [different repo](https://github.com/huggingface/accelerate)
69
+ - datasets: [different repo](https://github.com/huggingface/datasets)
70
+ - diffusers: [different repo](https://github.com/huggingface/diffusers)
71
+ - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
72
+
73
+ Maintained examples (not research project or legacy):
74
+
75
+ - Flax: @sanchit-gandhi
76
+ - PyTorch: See Models above and tag the person corresponding to the modality of the example.
77
+ - TensorFlow: @Rocketknight1
78
+
79
+ Research projects are not maintained and should be taken as is.
80
+
81
+ placeholder: "@Username ..."
82
+
83
+ - type: checkboxes
84
+ id: information-scripts-examples
85
+ attributes:
86
+ label: Information
87
+ description: 'The problem arises when using:'
88
+ options:
89
+ - label: "The official example scripts"
90
+ - label: "My own modified scripts"
91
+
92
+ - type: checkboxes
93
+ id: information-tasks
94
+ attributes:
95
+ label: Tasks
96
+ description: "The tasks I am working on are:"
97
+ options:
98
+ - label: "An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)"
99
+ - label: "My own task or dataset (give details below)"
100
+
101
+ - type: textarea
102
+ id: reproduction
103
+ validations:
104
+ required: true
105
+ attributes:
106
+ label: Reproduction
107
+ description: |
108
+ Please provide a code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
109
+ If you have code snippets, error messages, stack traces please provide them here as well.
110
+ 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
111
+ Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.
112
+
113
+ placeholder: |
114
+ Steps to reproduce the behavior:
115
+
116
+ 1.
117
+ 2.
118
+ 3.
119
+
120
+
121
+ - type: textarea
122
+ id: expected-behavior
123
+ validations:
124
+ required: true
125
+ attributes:
126
+ label: Expected behavior
127
+ description: "A clear and concise description of what you would expect to happen."
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ blank_issues_enabled: true
2
+ version: 2.1
3
+ contact_links:
4
+ - name: Model checkpoints on the Hugging Face Hub
5
+ url: https://huggingface.co/models
6
+ about: Open a Pull request / Discussion related to a specific model checkpoint directly on the Hugging Face Hub
7
+ - name: Website Related
8
+ url: https://github.com/huggingface/hub-docs/issues
9
+ about: Feature requests and bug reports related to the website
10
+ - name: Forum
11
+ url: https://discuss.huggingface.co/
12
+ about: General usage questions and community discussions
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/feature-request.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F680 Feature request"
2
+ description: Submit a proposal/request for a new transformers 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/transformers/blob/main/CONTRIBUTING.md)
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/i18n.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: 🌐 Translating a new language?
3
+ about: Start a new translation effort in your language
4
+ title: '[i18n-<languageCode>] Translating docs to <languageName>'
5
+ labels: WIP
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ <!--
11
+ Note: Please search to see if an issue already exists for the language you are trying to translate.
12
+ -->
13
+
14
+ Hi!
15
+
16
+ Let's bring the documentation to all the <languageName>-speaking community 🌐 (currently 0 out of 267 complete)
17
+
18
+ Who would want to translate? Please follow the 🤗 [TRANSLATING guide](https://github.com/huggingface/transformers/blob/main/docs/TRANSLATING.md). Here is a list of the files ready for translation. Let us know in this issue if you'd like to translate any, and we'll add your name to the list.
19
+
20
+ Some notes:
21
+
22
+ * Please translate using an informal tone (imagine you are talking with a friend about transformers 🤗).
23
+ * Please translate in a gender-neutral way.
24
+ * Add your translations to the folder called `<languageCode>` inside the [source folder](https://github.com/huggingface/transformers/tree/main/docs/source).
25
+ * Register your translation in `<languageCode>/_toctree.yml`; please follow the order of the [English version](https://github.com/huggingface/transformers/blob/main/docs/source/en/_toctree.yml).
26
+ * Once you're finished, open a pull request and tag this issue by including #issue-number in the description, where issue-number is the number of this issue. Please ping @stevhliu and @MKhalusova for review.
27
+ * 🙋 If you'd like others to help you with the translation, you can also post in the 🤗 [forums](https://discuss.huggingface.co/).
28
+
29
+ ## Get Started section
30
+
31
+ - [ ] [index.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/index.md) https://github.com/huggingface/transformers/pull/20180
32
+ - [ ] [quicktour.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/quicktour.md) (waiting for initial PR to go through)
33
+ - [ ] [installation.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/installation.md).
34
+
35
+ ## Tutorial section
36
+ - [ ] [pipeline_tutorial.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/pipeline_tutorial.md)
37
+ - [ ] [autoclass_tutorial.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/autoclass_tutorial.md)
38
+ - [ ] [preprocessing.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/preprocessing.md)
39
+ - [ ] [training.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/training.md)
40
+ - [ ] [accelerate.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/accelerate.md)
41
+ - [ ] [model_sharing.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/model_sharing.md)
42
+ - [ ] [multilingual.md](https://github.com/huggingface/transformers/blob/main/docs/source/en/multilingual.md)
43
+
44
+ <!--
45
+ Keep on adding more as you go 🔥
46
+ -->
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/migration.yml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F4DA Migration from pytorch-pretrained-bert or pytorch-transformers"
2
+ description: Report a problem when migrating from pytorch-pretrained-bert or pytorch-transformers to transformers
3
+ labels: [ "migration" ]
4
+ body:
5
+ - type: textarea
6
+ id: system-info
7
+ attributes:
8
+ label: System Info
9
+ description: Please share your system info with us. You can run the command `transformers-cli env` and copy-paste its output below.
10
+ render: shell
11
+ placeholder: transformers version, platform, python version, ...
12
+ validations:
13
+ required: true
14
+
15
+ - type: checkboxes
16
+ id: information-scripts-examples
17
+ attributes:
18
+ label: Information
19
+ description: 'The problem arises when using:'
20
+ options:
21
+ - label: "The official example scripts"
22
+ - label: "My own modified scripts"
23
+
24
+ - type: checkboxes
25
+ id: information-tasks
26
+ attributes:
27
+ label: Tasks
28
+ description: "The tasks I am working on are:"
29
+ options:
30
+ - label: "An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)"
31
+ - label: "My own task or dataset (give details below)"
32
+
33
+ - type: textarea
34
+ id: reproduction
35
+ validations:
36
+ required: true
37
+ attributes:
38
+ label: Reproduction
39
+ description: |
40
+ Please provide a code sample that reproduces the problem you ran into. It can be a Colab link or just a code snippet.
41
+ If you have code snippets, error messages, stack traces please provide them here as well.
42
+ 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
43
+ Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.
44
+
45
+ placeholder: |
46
+ Steps to reproduce the behavior:
47
+
48
+ 1.
49
+ 2.
50
+ 3.
51
+
52
+
53
+ - type: textarea
54
+ id: expected-behavior
55
+ validations:
56
+ required: true
57
+ attributes:
58
+ label: Expected behavior
59
+ description: "A clear and concise description of what you would expect to happen."
60
+ render: shell
61
+
62
+ - type: checkboxes
63
+ id: checklist
64
+ attributes:
65
+ label: Checklist
66
+ options:
67
+ - label: "I have read the migration guide in the readme.
68
+ ([pytorch-transformers](https://github.com/huggingface/transformers#migrating-from-pytorch-transformers-to-transformers);
69
+ [pytorch-pretrained-bert](https://github.com/huggingface/transformers#migrating-from-pytorch-pretrained-bert-to-transformers))"
70
+ required: true
71
+ - label: "I checked if a related official extension example runs on my machine."
72
+ required: true
tasks/tasksmith-333d8be2d5aa/tests/source/.github/ISSUE_TEMPLATE/new-model-addition.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F31F New model addition"
2
+ description: Submit a proposal/request to implement a new model
3
+ labels: [ "New model" ]
4
+
5
+ body:
6
+ - type: textarea
7
+ id: description-request
8
+ validations:
9
+ required: true
10
+ attributes:
11
+ label: Model description
12
+ description: |
13
+ Put any and all important information relative to the model
14
+
15
+ - type: checkboxes
16
+ id: information-tasks
17
+ attributes:
18
+ label: Open source status
19
+ description: |
20
+ Please note that if the model implementation isn't available or if the weights aren't open-source, we are less likely to implement it in `transformers`.
21
+ options:
22
+ - label: "The model implementation is available"
23
+ - label: "The model weights are available"
24
+
25
+ - type: textarea
26
+ id: additional-info
27
+ attributes:
28
+ label: Provide useful links for the implementation
29
+ description: |
30
+ Please provide information regarding the implementation, the weights, and the authors.
31
+ Please mention the authors by @gh-username if you're aware of their usernames.
tasks/tasksmith-333d8be2d5aa/tests/source/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
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/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
21
+ Pull Request section?
22
+ - [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
23
+ to it if that's the case.
24
+ - [ ] Did you make sure to update the documentation with your changes? Here are the
25
+ [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
26
+ [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
27
+ - [ ] Did you write any new necessary tests?
28
+
29
+
30
+ ## Who can review?
31
+
32
+ Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
33
+ members/contributors who may be interested in your PR.
34
+
35
+ <!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @
36
+
37
+ If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
38
+ Please tag fewer than 3 people.
39
+
40
+ Models:
41
+
42
+ - text models: @ArthurZucker
43
+ - vision models: @amyeroberts, @qubvel
44
+ - speech models: @ylacombe, @eustlb
45
+ - graph models: @clefourrier
46
+
47
+ Library:
48
+
49
+ - flax: @sanchit-gandhi
50
+ - generate: @zucchini-nlp (visual-language models) or @gante (all others)
51
+ - pipelines: @Rocketknight1
52
+ - tensorflow: @gante and @Rocketknight1
53
+ - tokenizers: @ArthurZucker
54
+ - trainer: @muellerzr and @SunMarc
55
+ - chat templates: @Rocketknight1
56
+
57
+ Integrations:
58
+
59
+ - deepspeed: HF Trainer/Accelerate: @muellerzr
60
+ - ray/raytune: @richardliaw, @amogkam
61
+ - Big Model Inference: @SunMarc
62
+ - quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber
63
+
64
+ Documentation: @stevhliu
65
+
66
+ HF projects:
67
+
68
+ - accelerate: [different repo](https://github.com/huggingface/accelerate)
69
+ - datasets: [different repo](https://github.com/huggingface/datasets)
70
+ - diffusers: [different repo](https://github.com/huggingface/diffusers)
71
+ - rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
72
+
73
+ Maintained examples (not research project or legacy):
74
+
75
+ - Flax: @sanchit-gandhi
76
+ - PyTorch: See Models above and tag the person corresponding to the modality of the example.
77
+ - TensorFlow: @Rocketknight1
78
+
79
+ -->
tasks/tasksmith-333d8be2d5aa/tests/source/.github/conda/build.sh ADDED
@@ -0,0 +1 @@
 
 
1
+ $PYTHON setup.py install # Python command to install the script.
tasks/tasksmith-333d8be2d5aa/tests/source/.github/conda/meta.yaml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% set name = "transformers" %}
2
+
3
+ package:
4
+ name: "{{ name|lower }}"
5
+ version: "{{ TRANSFORMERS_VERSION }}"
6
+
7
+ source:
8
+ path: ../../
9
+
10
+ build:
11
+ noarch: python
12
+
13
+ requirements:
14
+ host:
15
+ - python
16
+ - pip
17
+ - numpy >=1.17
18
+ - dataclasses
19
+ - huggingface_hub
20
+ - packaging
21
+ - filelock
22
+ - requests
23
+ - tqdm >=4.27
24
+ - sacremoses
25
+ - regex !=2019.12.17
26
+ - protobuf
27
+ - tokenizers >=0.11.1,!=0.11.3,<0.13
28
+ - pyyaml >=5.1
29
+ - safetensors
30
+ - fsspec
31
+ run:
32
+ - python
33
+ - numpy >=1.17
34
+ - dataclasses
35
+ - huggingface_hub
36
+ - packaging
37
+ - filelock
38
+ - requests
39
+ - tqdm >=4.27
40
+ - sacremoses
41
+ - regex !=2019.12.17
42
+ - protobuf
43
+ - tokenizers >=0.11.1,!=0.11.3,<0.13
44
+ - pyyaml >=5.1
45
+ - safetensors
46
+ - fsspec
47
+
48
+ test:
49
+ imports:
50
+ - transformers
51
+
52
+ about:
53
+ home: https://huggingface.co
54
+ license: Apache License 2.0
55
+ license_file: LICENSE
56
+ summary: "🤗Transformers: State-of-the-art Natural Language Processing for Pytorch and TensorFlow 2.0."
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/TROUBLESHOOT.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # Troubleshooting
2
+
3
+ This is a document explaining how to deal with various issues on github-actions self-hosted CI. The entries may include actual solutions or pointers to Issues that cover those.
4
+
5
+ ## GitHub Actions (self-hosted CI)
6
+
7
+ * Deepspeed
8
+
9
+ - if jit build hangs, clear out `rm -rf ~/.cache/torch_extensions/` reference: https://github.com/huggingface/transformers/pull/12723
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/add-model-like.yml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Add model like runner
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - none # put main here when this is fixed
7
+ #pull_request:
8
+ # paths:
9
+ # - "src/**"
10
+ # - "tests/**"
11
+ # - ".github/**"
12
+ # types: [opened, synchronize, reopened]
13
+
14
+ jobs:
15
+ run_tests_templates_like:
16
+ name: "Add new model like template tests"
17
+ runs-on: ubuntu-22.04
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ sudo apt -y update && sudo apt install -y libsndfile1-dev
24
+
25
+ - name: Load cached virtual environment
26
+ uses: actions/cache@v4
27
+ id: cache
28
+ with:
29
+ path: ~/venv/
30
+ key: v4-tests_model_like-${{ hashFiles('setup.py') }}
31
+
32
+ - name: Create virtual environment on cache miss
33
+ if: steps.cache.outputs.cache-hit != 'true'
34
+ run: |
35
+ python -m venv ~/venv && . ~/venv/bin/activate
36
+ pip install --upgrade pip!=21.3
37
+ pip install -e .[dev]
38
+
39
+ - name: Check transformers location
40
+ # make `transformers` available as package (required since we use `-e` flag) and check it's indeed from the repo.
41
+ run: |
42
+ . ~/venv/bin/activate
43
+ python setup.py develop
44
+ transformers_install=$(pip list -e | grep transformers)
45
+ transformers_install_array=($transformers_install)
46
+ transformers_loc=${transformers_install_array[-1]}
47
+ transformers_repo_loc=$(pwd .)
48
+ if [ "$transformers_loc" != "$transformers_repo_loc" ]; then
49
+ echo "transformers is from $transformers_loc but it shoud be from $transformers_repo_loc/src."
50
+ echo "A fix is required. Stop testing."
51
+ exit 1
52
+ fi
53
+
54
+ - name: Create model files
55
+ run: |
56
+ . ~/venv/bin/activate
57
+ transformers-cli add-new-model-like --config_file tests/fixtures/add_distilbert_like_config.json --path_to_repo .
58
+ make style
59
+ make fix-copies
60
+
61
+ - name: Run all PyTorch modeling test
62
+ run: |
63
+ . ~/venv/bin/activate
64
+ python -m pytest -n 2 --dist=loadfile -s --make-reports=tests_new_models tests/bert_new/test_modeling_bert_new.py
65
+
66
+ - name: Run style changes
67
+ run: |
68
+ . ~/venv/bin/activate
69
+ make style && make quality && make repo-consistency
70
+
71
+ - name: Failure short reports
72
+ if: ${{ always() }}
73
+ run: cat reports/tests_new_models/failures_short.txt
74
+
75
+ - name: Test suite reports artifacts
76
+ if: ${{ always() }}
77
+ uses: actions/upload-artifact@v4
78
+ with:
79
+ name: run_all_tests_new_models_test_reports
80
+ path: reports/tests_new_models
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/benchmark.yml ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (benchmark)
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ types: [ opened, labeled, reopened, synchronize ]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ HF_HOME: /mnt/cache
15
+
16
+ jobs:
17
+ benchmark:
18
+ name: Benchmark
19
+ strategy:
20
+ matrix:
21
+ group: [aws-g5-4xlarge-cache, aws-p4d-24xlarge-plus]
22
+ runs-on:
23
+ group: ${{ matrix.group }}
24
+ if: |
25
+ (github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-benchmark') )||
26
+ (github.event_name == 'push' && github.ref == 'refs/heads/main')
27
+ container:
28
+ image: huggingface/transformers-pytorch-gpu
29
+ options: --gpus all --privileged --ipc host
30
+ steps:
31
+ - name: Get repo
32
+ uses: actions/checkout@v4
33
+ with:
34
+ ref: ${{ github.event.pull_request.head.sha || github.sha }}
35
+
36
+ - name: Install libpq-dev & psql
37
+ run: |
38
+ apt update
39
+ apt install -y libpq-dev postgresql-client
40
+
41
+ - name: Install benchmark script dependencies
42
+ run: python3 -m pip install -r benchmark/requirements.txt
43
+
44
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
45
+ working-directory: /transformers
46
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e ".[torch]"
47
+
48
+ - name: Run database init script
49
+ run: |
50
+ psql -f benchmark/init_db.sql
51
+ env:
52
+ PGDATABASE: metrics
53
+ PGHOST: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGHOST }}
54
+ PGUSER: transformers_benchmarks
55
+ PGPASSWORD: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGPASSWORD }}
56
+
57
+ - name: Run benchmark
58
+ run: |
59
+ git config --global --add safe.directory /__w/transformers/transformers
60
+ if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
61
+ commit_id=$(echo "${{ github.event.pull_request.head.sha }}")
62
+ elif [ "$GITHUB_EVENT_NAME" = "push" ]; then
63
+ commit_id=$GITHUB_SHA
64
+ fi
65
+ commit_msg=$(git show -s --format=%s | cut -c1-70)
66
+ python3 benchmark/benchmarks_entrypoint.py "${{ github.head_ref || github.ref_name }}" "$commit_id" "$commit_msg"
67
+ env:
68
+ HF_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
69
+ # Enable this to see debug logs
70
+ # HF_HUB_VERBOSITY: debug
71
+ # TRANSFORMERS_VERBOSITY: debug
72
+ PGHOST: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGHOST }}
73
+ PGUSER: transformers_benchmarks
74
+ PGPASSWORD: ${{ secrets.TRANSFORMERS_BENCHMARKS_PGPASSWORD }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-ci-docker-images.yml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build pr ci-docker
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - push-ci-image # for now let's only build on this branch
7
+ repository_dispatch:
8
+ workflow_call:
9
+ inputs:
10
+ image_postfix:
11
+ required: true
12
+ type: string
13
+ schedule:
14
+ - cron: "6 0 * * *"
15
+
16
+
17
+ concurrency:
18
+ group: ${{ github.workflow }}
19
+ cancel-in-progress: true
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-22.04
24
+
25
+ if: ${{ contains(github.event.head_commit.message, '[build-ci-image]') || contains(github.event.head_commit.message, '[push-ci-image]') && '!cancelled()' || github.event_name == 'schedule' }}
26
+
27
+ strategy:
28
+ matrix:
29
+ file: ["quality", "consistency", "custom-tokenizers", "torch-light", "tf-light", "exotic-models", "torch-tf-light", "torch-jax-light", "jax-light", "examples-torch", "examples-tf"]
30
+ continue-on-error: true
31
+
32
+ steps:
33
+ -
34
+ name: Set tag
35
+ run: |
36
+ if ${{contains(github.event.head_commit.message, '[build-ci-image]')}}; then
37
+ echo "TAG=huggingface/transformers-${{ matrix.file }}:dev" >> "$GITHUB_ENV"
38
+ echo "setting it to DEV!"
39
+ else
40
+ echo "TAG=huggingface/transformers-${{ matrix.file }}" >> "$GITHUB_ENV"
41
+
42
+ fi
43
+ -
44
+ name: Set up Docker Buildx
45
+ uses: docker/setup-buildx-action@v3
46
+ -
47
+ name: Check out code
48
+ uses: actions/checkout@v4
49
+ -
50
+ name: Login to DockerHub
51
+ uses: docker/login-action@v3
52
+ with:
53
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
54
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
55
+ -
56
+ name: Build ${{ matrix.file }}.dockerfile
57
+ uses: docker/build-push-action@v5
58
+ with:
59
+ context: ./docker
60
+ build-args: |
61
+ REF=${{ github.sha }}
62
+ file: "./docker/${{ matrix.file }}.dockerfile"
63
+ push: ${{ contains(github.event.head_commit.message, 'ci-image]') || github.event_name == 'schedule' }}
64
+ tags: ${{ env.TAG }}
65
+
66
+ notify:
67
+ runs-on: ubuntu-22.04
68
+ if: ${{ contains(github.event.head_commit.message, '[build-ci-image]') || contains(github.event.head_commit.message, '[push-ci-image]') && '!cancelled()' || github.event_name == 'schedule' }}
69
+ steps:
70
+ - name: Post to Slack
71
+ if: ${{ contains(github.event.head_commit.message, '[push-ci-image]') && github.event_name != 'schedule' }}
72
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
73
+ with:
74
+ slack_channel: "#transformers-ci-circleci-images"
75
+ title: 🤗 New docker images for CircleCI are pushed.
76
+ status: ${{ job.status }}
77
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-docker-images.yml ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build docker images (scheduled)
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - build_ci_docker_image*
7
+ repository_dispatch:
8
+ workflow_call:
9
+ inputs:
10
+ image_postfix:
11
+ required: true
12
+ type: string
13
+ schedule:
14
+ - cron: "17 0 * * *"
15
+
16
+ concurrency:
17
+ group: docker-images-builds
18
+ cancel-in-progress: false
19
+
20
+ jobs:
21
+ latest-docker:
22
+ name: "Latest PyTorch + TensorFlow [dev]"
23
+ runs-on:
24
+ group: aws-general-8-plus
25
+ steps:
26
+ -
27
+ name: Set up Docker Buildx
28
+ uses: docker/setup-buildx-action@v3
29
+ -
30
+ name: Check out code
31
+ uses: actions/checkout@v4
32
+ -
33
+ name: Login to DockerHub
34
+ uses: docker/login-action@v3
35
+ with:
36
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
37
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
38
+ -
39
+ name: Build and push
40
+ uses: docker/build-push-action@v5
41
+ with:
42
+ context: ./docker/transformers-all-latest-gpu
43
+ build-args: |
44
+ REF=main
45
+ push: true
46
+ tags: huggingface/transformers-all-latest-gpu${{ inputs.image_postfix }}
47
+ # Push CI images still need to be re-built daily
48
+ -
49
+ name: Build and push (for Push CI) in a daily basis
50
+ # This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
51
+ # The later case is useful for manual image building for debugging purpose. Use another tag in this case!
52
+ if: inputs.image_postfix != '-push-ci'
53
+ uses: docker/build-push-action@v5
54
+ with:
55
+ context: ./docker/transformers-all-latest-gpu
56
+ build-args: |
57
+ REF=main
58
+ push: true
59
+ tags: huggingface/transformers-all-latest-gpu-push-ci
60
+
61
+ - name: Post to Slack
62
+ if: always()
63
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
64
+ with:
65
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
66
+ title: 🤗 Results of the transformers-all-latest-gpu-push-ci docker build
67
+ status: ${{ job.status }}
68
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
69
+
70
+ latest-torch-deepspeed-docker:
71
+ name: "Latest PyTorch + DeepSpeed"
72
+ runs-on:
73
+ group: aws-general-8-plus
74
+ steps:
75
+ -
76
+ name: Set up Docker Buildx
77
+ uses: docker/setup-buildx-action@v3
78
+ -
79
+ name: Check out code
80
+ uses: actions/checkout@v4
81
+ -
82
+ name: Login to DockerHub
83
+ uses: docker/login-action@v3
84
+ with:
85
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
86
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
87
+ -
88
+ name: Build and push
89
+ uses: docker/build-push-action@v5
90
+ with:
91
+ context: ./docker/transformers-pytorch-deepspeed-latest-gpu
92
+ build-args: |
93
+ REF=main
94
+ push: true
95
+ tags: huggingface/transformers-pytorch-deepspeed-latest-gpu${{ inputs.image_postfix }}
96
+
97
+ - name: Post to Slack
98
+ if: always()
99
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
100
+ with:
101
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER}}
102
+ title: 🤗 Results of the transformers-pytorch-deepspeed-latest-gpu docker build
103
+ status: ${{ job.status }}
104
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
105
+
106
+ # Can't build 2 images in a single job `latest-torch-deepspeed-docker` (for `nvcr.io/nvidia`)
107
+ latest-torch-deepspeed-docker-for-push-ci-daily-build:
108
+ name: "Latest PyTorch + DeepSpeed (Push CI - Daily Build)"
109
+ runs-on:
110
+ group: aws-general-8-plus
111
+ steps:
112
+ -
113
+ name: Set up Docker Buildx
114
+ uses: docker/setup-buildx-action@v3
115
+ -
116
+ name: Check out code
117
+ uses: actions/checkout@v4
118
+ -
119
+ name: Login to DockerHub
120
+ uses: docker/login-action@v3
121
+ with:
122
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
123
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
124
+ # Push CI images still need to be re-built daily
125
+ -
126
+ name: Build and push (for Push CI) in a daily basis
127
+ # This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
128
+ # The later case is useful for manual image building for debugging purpose. Use another tag in this case!
129
+ if: inputs.image_postfix != '-push-ci'
130
+ uses: docker/build-push-action@v5
131
+ with:
132
+ context: ./docker/transformers-pytorch-deepspeed-latest-gpu
133
+ build-args: |
134
+ REF=main
135
+ push: true
136
+ tags: huggingface/transformers-pytorch-deepspeed-latest-gpu-push-ci
137
+
138
+ - name: Post to Slack
139
+ if: always()
140
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
141
+ with:
142
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
143
+ title: 🤗 Results of the transformers-pytorch-deepspeed-latest-gpu-push-ci docker build
144
+ status: ${{ job.status }}
145
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
146
+
147
+ doc-builder:
148
+ name: "Doc builder"
149
+ # Push CI doesn't need this image
150
+ if: inputs.image_postfix != '-push-ci'
151
+ runs-on:
152
+ group: aws-general-8-plus
153
+ steps:
154
+ -
155
+ name: Set up Docker Buildx
156
+ uses: docker/setup-buildx-action@v3
157
+ -
158
+ name: Check out code
159
+ uses: actions/checkout@v4
160
+ -
161
+ name: Login to DockerHub
162
+ uses: docker/login-action@v3
163
+ with:
164
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
165
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
166
+ -
167
+ name: Build and push
168
+ uses: docker/build-push-action@v5
169
+ with:
170
+ context: ./docker/transformers-doc-builder
171
+ push: true
172
+ tags: huggingface/transformers-doc-builder
173
+
174
+ - name: Post to Slack
175
+ if: always()
176
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
177
+ with:
178
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
179
+ title: 🤗 Results of the huggingface/transformers-doc-builder docker build
180
+ status: ${{ job.status }}
181
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
182
+
183
+ latest-pytorch:
184
+ name: "Latest PyTorch [dev]"
185
+ # Push CI doesn't need this image
186
+ if: inputs.image_postfix != '-push-ci'
187
+ runs-on:
188
+ group: aws-general-8-plus
189
+ steps:
190
+ -
191
+ name: Set up Docker Buildx
192
+ uses: docker/setup-buildx-action@v3
193
+ -
194
+ name: Check out code
195
+ uses: actions/checkout@v4
196
+ -
197
+ name: Login to DockerHub
198
+ uses: docker/login-action@v3
199
+ with:
200
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
201
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
202
+ -
203
+ name: Build and push
204
+ uses: docker/build-push-action@v5
205
+ with:
206
+ context: ./docker/transformers-pytorch-gpu
207
+ build-args: |
208
+ REF=main
209
+ push: true
210
+ tags: huggingface/transformers-pytorch-gpu
211
+
212
+ - name: Post to Slack
213
+ if: always()
214
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
215
+ with:
216
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
217
+ title: 🤗 Results of the huggingface/transformers-pytorch-gpudocker build
218
+ status: ${{ job.status }}
219
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
220
+
221
+ latest-pytorch-amd:
222
+ name: "Latest PyTorch (AMD) [dev]"
223
+ runs-on:
224
+ group: aws-general-8-plus
225
+ steps:
226
+ -
227
+ name: Set up Docker Buildx
228
+ uses: docker/setup-buildx-action@v3
229
+ -
230
+ name: Check out code
231
+ uses: actions/checkout@v4
232
+ -
233
+ name: Login to DockerHub
234
+ uses: docker/login-action@v3
235
+ with:
236
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
237
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
238
+ -
239
+ name: Build and push
240
+ uses: docker/build-push-action@v5
241
+ with:
242
+ context: ./docker/transformers-pytorch-amd-gpu
243
+ build-args: |
244
+ REF=main
245
+ push: true
246
+ tags: huggingface/transformers-pytorch-amd-gpu${{ inputs.image_postfix }}
247
+ # Push CI images still need to be re-built daily
248
+ -
249
+ name: Build and push (for Push CI) in a daily basis
250
+ # This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
251
+ # The later case is useful for manual image building for debugging purpose. Use another tag in this case!
252
+ if: inputs.image_postfix != '-push-ci'
253
+ uses: docker/build-push-action@v5
254
+ with:
255
+ context: ./docker/transformers-pytorch-amd-gpu
256
+ build-args: |
257
+ REF=main
258
+ push: true
259
+ tags: huggingface/transformers-pytorch-amd-gpu-push-ci
260
+
261
+ - name: Post to Slack
262
+ if: always()
263
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
264
+ with:
265
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
266
+ title: 🤗 Results of the huggingface/transformers-pytorch-amd-gpu-push-ci build
267
+ status: ${{ job.status }}
268
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
269
+
270
+ latest-tensorflow:
271
+ name: "Latest TensorFlow [dev]"
272
+ # Push CI doesn't need this image
273
+ if: inputs.image_postfix != '-push-ci'
274
+ runs-on:
275
+ group: aws-general-8-plus
276
+ steps:
277
+ -
278
+ name: Set up Docker Buildx
279
+ uses: docker/setup-buildx-action@v3
280
+ -
281
+ name: Check out code
282
+ uses: actions/checkout@v4
283
+ -
284
+ name: Login to DockerHub
285
+ uses: docker/login-action@v3
286
+ with:
287
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
288
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
289
+ -
290
+ name: Build and push
291
+ uses: docker/build-push-action@v5
292
+ with:
293
+ context: ./docker/transformers-tensorflow-gpu
294
+ build-args: |
295
+ REF=main
296
+ push: true
297
+ tags: huggingface/transformers-tensorflow-gpu
298
+
299
+ - name: Post to Slack
300
+ if: always()
301
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
302
+ with:
303
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
304
+ title: 🤗 Results of the huggingface/transformers-tensorflow-gpu build
305
+ status: ${{ job.status }}
306
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
307
+
308
+ latest-pytorch-deepspeed-amd:
309
+ name: "PyTorch + DeepSpeed (AMD) [dev]"
310
+ runs-on:
311
+ group: aws-general-8-plus
312
+ steps:
313
+ -
314
+ name: Set up Docker Buildx
315
+ uses: docker/setup-buildx-action@v3
316
+ -
317
+ name: Check out code
318
+ uses: actions/checkout@v4
319
+ -
320
+ name: Login to DockerHub
321
+ uses: docker/login-action@v3
322
+ with:
323
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
324
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
325
+ -
326
+ name: Build and push
327
+ uses: docker/build-push-action@v5
328
+ with:
329
+ context: ./docker/transformers-pytorch-deepspeed-amd-gpu
330
+ build-args: |
331
+ REF=main
332
+ push: true
333
+ tags: huggingface/transformers-pytorch-deepspeed-amd-gpu${{ inputs.image_postfix }}
334
+ # Push CI images still need to be re-built daily
335
+ -
336
+ name: Build and push (for Push CI) in a daily basis
337
+ # This condition allows `schedule` events, or `push` events that trigger this workflow NOT via `workflow_call`.
338
+ # The later case is useful for manual image building for debugging purpose. Use another tag in this case!
339
+ if: inputs.image_postfix != '-push-ci'
340
+ uses: docker/build-push-action@v5
341
+ with:
342
+ context: ./docker/transformers-pytorch-deepspeed-amd-gpu
343
+ build-args: |
344
+ REF=main
345
+ push: true
346
+ tags: huggingface/transformers-pytorch-deepspeed-amd-gpu-push-ci
347
+
348
+ - name: Post to Slack
349
+ if: always()
350
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
351
+ with:
352
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
353
+ title: 🤗 Results of the transformers-pytorch-deepspeed-amd-gpu build
354
+ status: ${{ job.status }}
355
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
356
+
357
+ latest-quantization-torch-docker:
358
+ name: "Latest Pytorch + Quantization [dev]"
359
+ # Push CI doesn't need this image
360
+ if: inputs.image_postfix != '-push-ci'
361
+ runs-on:
362
+ group: aws-general-8-plus
363
+ steps:
364
+ -
365
+ name: Set up Docker Buildx
366
+ uses: docker/setup-buildx-action@v3
367
+ -
368
+ name: Check out code
369
+ uses: actions/checkout@v4
370
+ -
371
+ name: Login to DockerHub
372
+ uses: docker/login-action@v3
373
+ with:
374
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
375
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
376
+ -
377
+ name: Build and push
378
+ uses: docker/build-push-action@v5
379
+ with:
380
+ context: ./docker/transformers-quantization-latest-gpu
381
+ build-args: |
382
+ REF=main
383
+ push: true
384
+ tags: huggingface/transformers-quantization-latest-gpu${{ inputs.image_postfix }}
385
+
386
+ - name: Post to Slack
387
+ if: always()
388
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
389
+ with:
390
+ slack_channel: ${{ secrets.CI_SLACK_CHANNEL_DOCKER }}
391
+ title: 🤗 Results of the transformers-quantization-latest-gpu build
392
+ status: ${{ job.status }}
393
+ slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-nightly-ci-docker-images.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build docker images (Nightly CI)
2
+
3
+ on:
4
+ workflow_call:
5
+ push:
6
+ branches:
7
+ - build_nightly_ci_docker_image*
8
+
9
+ concurrency:
10
+ group: docker-images-builds
11
+ cancel-in-progress: false
12
+
13
+ jobs:
14
+ latest-with-torch-nightly-docker:
15
+ name: "Nightly PyTorch + Stable TensorFlow"
16
+ runs-on:
17
+ group: aws-general-8-plus
18
+ steps:
19
+ -
20
+ name: Set up Docker Buildx
21
+ uses: docker/setup-buildx-action@v2
22
+ -
23
+ name: Check out code
24
+ uses: actions/checkout@v4
25
+ -
26
+ name: Login to DockerHub
27
+ uses: docker/login-action@v2
28
+ with:
29
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
30
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
31
+ -
32
+ name: Build and push
33
+ uses: docker/build-push-action@v3
34
+ with:
35
+ context: ./docker/transformers-all-latest-gpu
36
+ build-args: |
37
+ REF=main
38
+ PYTORCH=pre
39
+ push: true
40
+ tags: huggingface/transformers-all-latest-torch-nightly-gpu
41
+
42
+ nightly-torch-deepspeed-docker:
43
+ name: "Nightly PyTorch + DeepSpeed"
44
+ runs-on:
45
+ group: aws-general-8-plus
46
+ steps:
47
+ -
48
+ name: Set up Docker Buildx
49
+ uses: docker/setup-buildx-action@v2
50
+ -
51
+ name: Check out code
52
+ uses: actions/checkout@v4
53
+ -
54
+ name: Login to DockerHub
55
+ uses: docker/login-action@v2
56
+ with:
57
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
58
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
59
+ -
60
+ name: Build and push
61
+ uses: docker/build-push-action@v3
62
+ with:
63
+ context: ./docker/transformers-pytorch-deepspeed-nightly-gpu
64
+ build-args: |
65
+ REF=main
66
+ push: true
67
+ tags: huggingface/transformers-pytorch-deepspeed-nightly-gpu
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build-past-ci-docker-images.yml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build docker images (Past CI)
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - build_past_ci_docker_image*
7
+
8
+ concurrency:
9
+ group: docker-images-builds
10
+ cancel-in-progress: false
11
+
12
+ jobs:
13
+ past-pytorch-docker:
14
+ name: "Past PyTorch Docker"
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ version: ["1.13", "1.12", "1.11"]
19
+ runs-on:
20
+ group: aws-general-8-plus
21
+ steps:
22
+ -
23
+ name: Set up Docker Buildx
24
+ uses: docker/setup-buildx-action@v2
25
+ -
26
+ name: Check out code
27
+ uses: actions/checkout@v4
28
+ -
29
+ id: get-base-image
30
+ name: Get Base Image
31
+ env:
32
+ framework_version: ${{ matrix.version }}
33
+ run: |
34
+ echo "base_image=$(python3 -c 'import os; from utils.past_ci_versions import past_versions_testing; base_image = past_versions_testing["pytorch"][os.environ["framework_version"]]["base_image"]; print(base_image)')" >> $GITHUB_OUTPUT
35
+ -
36
+ name: Print Base Image
37
+ run: |
38
+ echo ${{ steps.get-base-image.outputs.base_image }}
39
+ -
40
+ name: Login to DockerHub
41
+ uses: docker/login-action@v2
42
+ with:
43
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
44
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
45
+ -
46
+ name: Build and push
47
+ uses: docker/build-push-action@v3
48
+ with:
49
+ context: ./docker/transformers-past-gpu
50
+ build-args: |
51
+ REF=main
52
+ BASE_DOCKER_IMAGE=${{ steps.get-base-image.outputs.base_image }}
53
+ FRAMEWORK=pytorch
54
+ VERSION=${{ matrix.version }}
55
+ push: true
56
+ tags: huggingface/transformers-pytorch-past-${{ matrix.version }}-gpu
57
+
58
+ past-tensorflow-docker:
59
+ name: "Past TensorFlow Docker"
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ version: ["2.11", "2.10", "2.9", "2.8", "2.7", "2.6", "2.5"]
64
+ runs-on:
65
+ group: aws-general-8-plus
66
+ steps:
67
+ -
68
+ name: Set up Docker Buildx
69
+ uses: docker/setup-buildx-action@v2
70
+ -
71
+ name: Check out code
72
+ uses: actions/checkout@v4
73
+ -
74
+ id: get-base-image
75
+ name: Get Base Image
76
+ env:
77
+ framework_version: ${{ matrix.version }}
78
+ run: |
79
+ echo "base_image=$(python3 -c 'import os; from utils.past_ci_versions import past_versions_testing; base_image = past_versions_testing["tensorflow"][os.environ["framework_version"]]["base_image"]; print(base_image)')" >> $GITHUB_OUTPUT
80
+ -
81
+ name: Print Base Image
82
+ run: |
83
+ echo ${{ steps.get-base-image.outputs.base_image }}
84
+ -
85
+ name: Login to DockerHub
86
+ uses: docker/login-action@v2
87
+ with:
88
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
89
+ password: ${{ secrets.DOCKERHUB_PASSWORD }}
90
+ -
91
+ name: Build and push
92
+ uses: docker/build-push-action@v3
93
+ with:
94
+ context: ./docker/transformers-past-gpu
95
+ build-args: |
96
+ REF=main
97
+ BASE_DOCKER_IMAGE=${{ steps.get-base-image.outputs.base_image }}
98
+ FRAMEWORK=tensorflow
99
+ VERSION=${{ matrix.version }}
100
+ push: true
101
+ tags: huggingface/transformers-tensorflow-past-${{ matrix.version }}-gpu
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build_documentation.yml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build documentation
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - main
8
+ - doc-builder*
9
+ - v*-release
10
+ - use_templates
11
+
12
+ jobs:
13
+ build:
14
+ uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
15
+ with:
16
+ commit_sha: ${{ github.sha }}
17
+ package: transformers
18
+ notebook_folder: transformers_doc
19
+ languages: ar de en es fr hi it ko pt tr zh ja te
20
+ custom_container: huggingface/transformers-doc-builder
21
+ secrets:
22
+ token: ${{ secrets.HUGGINGFACE_PUSH }}
23
+ hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/build_pr_documentation.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
13
+ with:
14
+ commit_sha: ${{ github.event.pull_request.head.sha }}
15
+ pr_number: ${{ github.event.number }}
16
+ package: transformers
17
+ languages: ar de en es fr hi it ko pt tr zh ja te
18
+ custom_container: huggingface/transformers-doc-builder
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/check_failed_model_tests.yml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Process failed tests
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ docker:
7
+ required: true
8
+ type: string
9
+ start_sha:
10
+ required: true
11
+ type: string
12
+
13
+
14
+ env:
15
+ HF_HOME: /mnt/cache
16
+ TRANSFORMERS_IS_CI: yes
17
+ OMP_NUM_THREADS: 8
18
+ MKL_NUM_THREADS: 8
19
+ RUN_SLOW: yes
20
+ # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access.
21
+ # This token is created under the bot `hf-transformers-bot`.
22
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
23
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
24
+ TF_FORCE_GPU_ALLOW_GROWTH: true
25
+ RUN_PT_TF_CROSS_TESTS: 1
26
+ CUDA_VISIBLE_DEVICES: 0,1
27
+
28
+
29
+ jobs:
30
+ run_models_gpu:
31
+ name: " "
32
+ runs-on:
33
+ group: aws-g4dn-2xlarge-cache
34
+ container:
35
+ image: ${{ inputs.docker }}
36
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
37
+ steps:
38
+ - uses: actions/download-artifact@v4
39
+ with:
40
+ name: ci_results_run_models_gpu
41
+ path: /transformers/ci_results_run_models_gpu
42
+
43
+ - name: Update clone
44
+ working-directory: /transformers
45
+ run: git fetch && git checkout ${{ github.sha }}
46
+
47
+ - name: Get target commit
48
+ working-directory: /transformers/utils
49
+ run: |
50
+ echo "END_SHA=$(TOKEN=${{ secrets.ACCESS_REPO_INFO_TOKEN }} python3 -c 'import os; from get_previous_daily_ci import get_last_daily_ci_run_commit; commit=get_last_daily_ci_run_commit(token=os.environ["TOKEN"]); print(commit)')" >> $GITHUB_ENV
51
+
52
+ - name: Checkout to `start_sha`
53
+ working-directory: /transformers
54
+ run: git fetch && git checkout ${{ inputs.start_sha }}
55
+
56
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
57
+ working-directory: /transformers
58
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
59
+
60
+ - name: NVIDIA-SMI
61
+ run: |
62
+ nvidia-smi
63
+
64
+ - name: Environment
65
+ working-directory: /transformers
66
+ run: |
67
+ python3 utils/print_env.py
68
+
69
+ - name: Show installed libraries and their versions
70
+ working-directory: /transformers
71
+ run: pip freeze
72
+
73
+ - name: Check failed tests
74
+ working-directory: /transformers
75
+ run: python3 utils/check_bad_commit.py --start_commit ${{ inputs.start_sha }} --end_commit ${{ env.END_SHA }} --file ci_results_run_models_gpu/new_model_failures.json --output_file new_model_failures_with_bad_commit.json
76
+
77
+ - name: Show results
78
+ working-directory: /transformers
79
+ run: |
80
+ ls -l new_model_failures_with_bad_commit.json
81
+ cat new_model_failures_with_bad_commit.json
82
+
83
+ - name: Checkout back
84
+ working-directory: /transformers
85
+ run: |
86
+ git checkout ${{ inputs.start_sha }}
87
+
88
+ - name: Process report
89
+ shell: bash
90
+ working-directory: /transformers
91
+ env:
92
+ TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN: ${{ secrets.TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN }}
93
+ run: |
94
+ python3 utils/process_bad_commit_report.py
95
+
96
+ - name: Process report
97
+ shell: bash
98
+ working-directory: /transformers
99
+ env:
100
+ TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN: ${{ secrets.TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN }}
101
+ run: |
102
+ {
103
+ echo 'REPORT_TEXT<<EOF'
104
+ python3 utils/process_bad_commit_report.py
105
+ echo EOF
106
+ } >> "$GITHUB_ENV"
107
+
108
+ - name: Send processed report
109
+ if: ${{ !endsWith(env.REPORT_TEXT, '{}') }}
110
+ uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
111
+ with:
112
+ # Slack channel id, channel name, or user id to post message.
113
+ # See also: https://api.slack.com/methods/chat.postMessage#channels
114
+ channel-id: '#transformers-ci-feedback-tests'
115
+ # For posting a rich message using Block Kit
116
+ payload: |
117
+ {
118
+ "blocks": [
119
+ {
120
+ "type": "section",
121
+ "text": {
122
+ "type": "mrkdwn",
123
+ "text": "${{ env.REPORT_TEXT }}"
124
+ }
125
+ }
126
+ ]
127
+ }
128
+ env:
129
+ SLACK_BOT_TOKEN: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/check_tiny_models.yml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Check Tiny Models
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - check_tiny_models*
7
+ repository_dispatch:
8
+ schedule:
9
+ - cron: "0 2 * * *"
10
+
11
+ env:
12
+ TOKEN: ${{ secrets.TRANSFORMERS_HUB_BOT_HF_TOKEN }}
13
+
14
+ jobs:
15
+ check_tiny_models:
16
+ name: Check tiny models
17
+ runs-on: ubuntu-22.04
18
+ steps:
19
+ - name: Checkout transformers
20
+ uses: actions/checkout@v4
21
+ with:
22
+ fetch-depth: 2
23
+
24
+ - uses: actions/checkout@v4
25
+ - name: Set up Python 3.8
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ # Semantic version range syntax or exact version of a Python version
29
+ python-version: '3.8'
30
+ # Optional - x64 or x86 architecture, defaults to x64
31
+ architecture: 'x64'
32
+
33
+ - name: Install
34
+ run: |
35
+ sudo apt-get -y update && sudo apt-get install -y libsndfile1-dev espeak-ng cmake
36
+ pip install --upgrade pip
37
+ python -m pip install -U .[sklearn,torch,testing,sentencepiece,torch-speech,vision,timm,video,tf-cpu]
38
+ pip install tensorflow_probability
39
+ python -m pip install -U 'natten<0.15.0'
40
+
41
+ - name: Create all tiny models (locally)
42
+ run: |
43
+ python utils/create_dummy_models.py tiny_local_models --all --num_workers 2
44
+
45
+ - name: Local tiny model reports artifacts
46
+ if: ${{ always() }}
47
+ uses: actions/upload-artifact@v4
48
+ with:
49
+ name: tiny_local_model_creation_reports
50
+ path: tiny_local_models/reports
51
+
52
+ # GitHub-hosted runners have 2-core CPUs
53
+ - name: Run pipeline tests against all new (local) tiny models
54
+ run: |
55
+ OMP_NUM_THREADS=1 TRANSFORMERS_TINY_MODEL_PATH=tiny_local_models python -m pytest --max-worker-restart=0 -n 2 --dist=loadfile -s -rA --make-reports=tests_pipelines tests/models -m is_pipeline_test -k "test_pipeline_" | tee tests_output.txt
56
+
57
+ - name: Test suite reports artifacts
58
+ if: ${{ always() }}
59
+ uses: actions/upload-artifact@v4
60
+ with:
61
+ name: tiny_local_model_creation_reports
62
+ path: reports/tests_pipelines
63
+
64
+ - name: Create + Upload tiny models for new model architecture(s)
65
+ run: |
66
+ python utils/update_tiny_models.py --num_workers 2
67
+
68
+ - name: Full report
69
+ run: cat tiny_models/reports/tiny_model_creation_report.json
70
+
71
+ - name: Failure report
72
+ run: cat tiny_models/reports/simple_failed_report.txt
73
+
74
+ - name: Summary report
75
+ run: cat tiny_models/reports/tiny_model_summary.json
76
+
77
+ - name: New tiny model creation reports artifacts
78
+ if: ${{ always() }}
79
+ uses: actions/upload-artifact@v4
80
+ with:
81
+ name: tiny_model_creation_reports
82
+ path: tiny_models/reports
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/doctest_job.yml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Doctest job
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ job_splits:
7
+ required: true
8
+ type: string
9
+ split_keys:
10
+ required: true
11
+ type: string
12
+
13
+ env:
14
+ HF_HOME: /mnt/cache
15
+ TRANSFORMERS_IS_CI: yes
16
+ RUN_SLOW: yes
17
+ OMP_NUM_THREADS: 16
18
+ MKL_NUM_THREADS: 16
19
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
20
+ TF_FORCE_GPU_ALLOW_GROWTH: true
21
+
22
+ jobs:
23
+ run_doctests:
24
+ name: " "
25
+ strategy:
26
+ max-parallel: 8 # 8 jobs at a time
27
+ fail-fast: false
28
+ matrix:
29
+ split_keys: ${{ fromJson(inputs.split_keys) }}
30
+ runs-on:
31
+ group: aws-g4dn-2xlarge-cache
32
+ container:
33
+ image: huggingface/transformers-all-latest-gpu
34
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
35
+ steps:
36
+ - name: Update clone
37
+ working-directory: /transformers
38
+ run: git fetch && git checkout ${{ github.sha }}
39
+
40
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
41
+ working-directory: /transformers
42
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .[flax]
43
+
44
+ - name: GPU visibility
45
+ working-directory: /transformers
46
+ run: |
47
+ python3 utils/print_env.py
48
+
49
+ - name: Show installed libraries and their versions
50
+ run: pip freeze
51
+
52
+ - name: Get doctest files
53
+ working-directory: /transformers
54
+ run: |
55
+ echo "${{ toJson(fromJson(inputs.job_splits)[matrix.split_keys]) }}" > doc_tests.txt
56
+ cat doc_tests.txt
57
+
58
+ - name: Set `split_keys`
59
+ shell: bash
60
+ run: |
61
+ echo "${{ matrix.split_keys }}"
62
+ split_keys=${{ matrix.split_keys }}
63
+ split_keys=${split_keys//'/'/'_'}
64
+ echo "split_keys"
65
+ echo "split_keys=$split_keys" >> $GITHUB_ENV
66
+
67
+ - name: Run doctests
68
+ working-directory: /transformers
69
+ run: |
70
+ cat doc_tests.txt
71
+ 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"
72
+
73
+ - name: Failure short reports
74
+ if: ${{ failure() }}
75
+ continue-on-error: true
76
+ run: cat /transformers/reports/doc_tests_gpu_${{ env.split_keys }}/failures_short.txt
77
+
78
+ - name: "Test suite reports artifacts: doc_tests_gpu_test_reports_${{ env.split_keys }}"
79
+ if: ${{ always() }}
80
+ uses: actions/upload-artifact@v4
81
+ with:
82
+ name: doc_tests_gpu_test_reports_${{ env.split_keys }}
83
+ path: /transformers/reports/doc_tests_gpu_${{ env.split_keys }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/doctests.yml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Doctests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - run_doctest*
7
+ repository_dispatch:
8
+ schedule:
9
+ - cron: "17 2 * * *"
10
+
11
+ env:
12
+ NUM_SLICES: 3
13
+
14
+ jobs:
15
+ setup:
16
+ name: Setup
17
+ runs-on:
18
+ group: aws-g4dn-2xlarge-cache
19
+ container:
20
+ image: huggingface/transformers-all-latest-gpu
21
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
22
+ outputs:
23
+ job_splits: ${{ steps.set-matrix.outputs.job_splits }}
24
+ split_keys: ${{ steps.set-matrix.outputs.split_keys }}
25
+ steps:
26
+ - name: Update clone
27
+ working-directory: /transformers
28
+ run: |
29
+ git fetch && git checkout ${{ github.sha }}
30
+
31
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
32
+ working-directory: /transformers
33
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
34
+
35
+ - name: Show installed libraries and their versions
36
+ working-directory: /transformers
37
+ run: pip freeze
38
+
39
+ - name: Check values for matrix
40
+ working-directory: /transformers
41
+ run: |
42
+ python3 utils/split_doctest_jobs.py
43
+ python3 utils/split_doctest_jobs.py --only_return_keys --num_splits ${{ env.NUM_SLICES }}
44
+
45
+ - id: set-matrix
46
+ working-directory: /transformers
47
+ name: Set values for matrix
48
+ run: |
49
+ echo "job_splits=$(python3 utils/split_doctest_jobs.py)" >> $GITHUB_OUTPUT
50
+ echo "split_keys=$(python3 utils/split_doctest_jobs.py --only_return_keys --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT
51
+
52
+ call_doctest_job:
53
+ name: "Call doctest jobs"
54
+ needs: setup
55
+ strategy:
56
+ max-parallel: 1 # 1 split at a time (in `doctest_job.yml`, we set `8` to run 8 jobs at the same time)
57
+ fail-fast: false
58
+ matrix:
59
+ split_keys: ${{ fromJson(needs.setup.outputs.split_keys) }}
60
+ uses: ./.github/workflows/doctest_job.yml
61
+ with:
62
+ job_splits: ${{ needs.setup.outputs.job_splits }}
63
+ split_keys: ${{ toJson(matrix.split_keys) }}
64
+ secrets: inherit
65
+
66
+ send_results:
67
+ name: Send results to webhook
68
+ runs-on: ubuntu-22.04
69
+ if: always()
70
+ needs: [call_doctest_job]
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - uses: actions/download-artifact@v4
74
+ - name: Send message to Slack
75
+ env:
76
+ CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
77
+ ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
78
+ # Use `CI_SLACK_CHANNEL_DUMMY_TESTS` when doing experimentation
79
+ SLACK_REPORT_CHANNEL: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY_DOCS }}
80
+ run: |
81
+ pip install slack_sdk
82
+ python utils/notification_service_doc_tests.py
83
+
84
+ - name: "Upload results"
85
+ if: ${{ always() }}
86
+ uses: actions/upload-artifact@v4
87
+ with:
88
+ name: doc_test_results
89
+ path: doc_test_results
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/model_jobs.yml ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: model jobs
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ folder_slices:
7
+ required: true
8
+ type: string
9
+ machine_type:
10
+ required: true
11
+ type: string
12
+ slice_id:
13
+ required: true
14
+ type: number
15
+ runner:
16
+ required: true
17
+ type: string
18
+ docker:
19
+ required: true
20
+ type: string
21
+
22
+ env:
23
+ HF_HOME: /mnt/cache
24
+ TRANSFORMERS_IS_CI: yes
25
+ OMP_NUM_THREADS: 8
26
+ MKL_NUM_THREADS: 8
27
+ RUN_SLOW: yes
28
+ # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access.
29
+ # This token is created under the bot `hf-transformers-bot`.
30
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
31
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
32
+ TF_FORCE_GPU_ALLOW_GROWTH: true
33
+ RUN_PT_TF_CROSS_TESTS: 1
34
+ CUDA_VISIBLE_DEVICES: 0,1
35
+
36
+ jobs:
37
+ run_models_gpu:
38
+ name: " "
39
+ strategy:
40
+ max-parallel: 8
41
+ fail-fast: false
42
+ matrix:
43
+ folders: ${{ fromJson(inputs.folder_slices)[inputs.slice_id] }}
44
+ runs-on:
45
+ group: '${{ inputs.machine_type }}'
46
+ container:
47
+ image: ${{ inputs.docker }}
48
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
49
+ steps:
50
+ - name: Echo input and matrix info
51
+ shell: bash
52
+ run: |
53
+ echo "${{ inputs.folder_slices }}"
54
+ echo "${{ matrix.folders }}"
55
+ echo "${{ toJson(fromJson(inputs.folder_slices)[inputs.slice_id]) }}"
56
+
57
+ - name: Echo folder ${{ matrix.folders }}
58
+ shell: bash
59
+ # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
60
+ # set the artifact folder names (because the character `/` is not allowed).
61
+ run: |
62
+ echo "${{ matrix.folders }}"
63
+ matrix_folders=${{ matrix.folders }}
64
+ matrix_folders=${matrix_folders/'models/'/'models_'}
65
+ echo "$matrix_folders"
66
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
67
+
68
+ - name: Update clone
69
+ working-directory: /transformers
70
+ run: git fetch && git checkout ${{ github.sha }}
71
+
72
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
73
+ working-directory: /transformers
74
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
75
+
76
+ - name: Update / Install some packages (for Past CI)
77
+ if: ${{ contains(inputs.docker, '-past-') }}
78
+ working-directory: /transformers
79
+ run: |
80
+ python3 -m pip install -U datasets
81
+
82
+ - name: Update / Install some packages (for Past CI)
83
+ if: ${{ contains(inputs.docker, '-past-') && contains(inputs.docker, '-pytorch-') }}
84
+ working-directory: /transformers
85
+ run: |
86
+ python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
87
+
88
+ - name: NVIDIA-SMI
89
+ run: |
90
+ nvidia-smi
91
+
92
+ - name: Environment
93
+ working-directory: /transformers
94
+ run: |
95
+ python3 utils/print_env.py
96
+
97
+ - name: Show installed libraries and their versions
98
+ working-directory: /transformers
99
+ run: pip freeze
100
+
101
+ - name: Set `machine_type` for report and artifact names
102
+ working-directory: /transformers
103
+ shell: bash
104
+ run: |
105
+ echo "${{ inputs.machine_type }}"
106
+
107
+ if [ "${{ inputs.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
108
+ machine_type=single-gpu
109
+ elif [ "${{ inputs.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
110
+ machine_type=multi-gpu
111
+ else
112
+ machine_type=${{ inputs.machine_type }}
113
+ fi
114
+
115
+ echo "$machine_type"
116
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
117
+
118
+ - name: Run all tests on GPU
119
+ working-directory: /transformers
120
+ run: python3 -m pytest -rsfE -v --make-reports=${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }}
121
+
122
+ - name: Failure short reports
123
+ if: ${{ failure() }}
124
+ continue-on-error: true
125
+ run: cat /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt
126
+
127
+ - name: Run test
128
+ shell: bash
129
+ run: |
130
+ mkdir -p /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
131
+ echo "hello" > /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt
132
+ echo "${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports"
133
+
134
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports"
135
+ if: ${{ always() }}
136
+ uses: actions/upload-artifact@v4
137
+ with:
138
+ name: ${{ env.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports
139
+ path: /transformers/reports/${{ env.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/model_jobs_amd.yml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: model jobs
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ folder_slices:
7
+ required: true
8
+ type: string
9
+ machine_type:
10
+ required: true
11
+ type: string
12
+ slice_id:
13
+ required: true
14
+ type: number
15
+ runner:
16
+ required: true
17
+ type: string
18
+ docker:
19
+ required: true
20
+ type: string
21
+
22
+ env:
23
+ HF_HOME: /mnt/cache
24
+ TRANSFORMERS_IS_CI: yes
25
+ OMP_NUM_THREADS: 8
26
+ MKL_NUM_THREADS: 8
27
+ RUN_SLOW: yes
28
+ # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access.
29
+ # This token is created under the bot `hf-transformers-bot`.
30
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
31
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
32
+ TF_FORCE_GPU_ALLOW_GROWTH: true
33
+ RUN_PT_TF_CROSS_TESTS: 1
34
+ CUDA_VISIBLE_DEVICES: 0,1
35
+
36
+ jobs:
37
+ run_models_gpu:
38
+ name: " "
39
+ strategy:
40
+ max-parallel: 1 # For now, not to parallelize. Can change later if it works well.
41
+ fail-fast: false
42
+ matrix:
43
+ folders: ${{ fromJson(inputs.folder_slices)[inputs.slice_id] }}
44
+ runs-on: ['${{ inputs.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
45
+ container:
46
+ image: ${{ inputs.docker }}
47
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
48
+ steps:
49
+ - name: Echo input and matrix info
50
+ shell: bash
51
+ run: |
52
+ echo "${{ inputs.folder_slices }}"
53
+ echo "${{ matrix.folders }}"
54
+ echo "${{ toJson(fromJson(inputs.folder_slices)[inputs.slice_id]) }}"
55
+
56
+ - name: Echo folder ${{ matrix.folders }}
57
+ shell: bash
58
+ # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
59
+ # set the artifact folder names (because the character `/` is not allowed).
60
+ run: |
61
+ echo "${{ matrix.folders }}"
62
+ matrix_folders=${{ matrix.folders }}
63
+ matrix_folders=${matrix_folders/'models/'/'models_'}
64
+ echo "$matrix_folders"
65
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
66
+
67
+ - name: Update clone
68
+ working-directory: /transformers
69
+ run: git fetch && git checkout ${{ github.sha }}
70
+
71
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
72
+ working-directory: /transformers
73
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
74
+
75
+ - name: Update / Install some packages (for Past CI)
76
+ if: ${{ contains(inputs.docker, '-past-') }}
77
+ working-directory: /transformers
78
+ run: |
79
+ python3 -m pip install -U datasets
80
+
81
+ - name: Update / Install some packages (for Past CI)
82
+ if: ${{ contains(inputs.docker, '-past-') && contains(inputs.docker, '-pytorch-') }}
83
+ working-directory: /transformers
84
+ run: |
85
+ python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
86
+
87
+ - name: ROCM-SMI
88
+ run: |
89
+ rocm-smi
90
+
91
+ - name: ROCM-INFO
92
+ run: |
93
+ rocminfo | grep "Agent" -A 14
94
+
95
+ - name: Show ROCR environment
96
+ run: |
97
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
98
+
99
+ - name: Environment
100
+ working-directory: /transformers
101
+ run: |
102
+ python3 utils/print_env.py
103
+
104
+ - name: Show installed libraries and their versions
105
+ working-directory: /transformers
106
+ run: pip freeze
107
+
108
+ - name: Run all tests on GPU
109
+ working-directory: /transformers
110
+ run: python3 -m pytest -rsfE -v --make-reports=${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }} -m "not not_device_test"
111
+
112
+ - name: Failure short reports
113
+ if: ${{ failure() }}
114
+ continue-on-error: true
115
+ run: cat /transformers/reports/${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt
116
+
117
+ - name: Run test
118
+ shell: bash
119
+ run: |
120
+ mkdir -p /transformers/reports/${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
121
+ echo "hello" > /transformers/reports/${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/hello.txt
122
+ echo "${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports"
123
+
124
+ - name: "Test suite reports artifacts: ${{ inputs.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports"
125
+ if: ${{ always() }}
126
+ uses: actions/upload-artifact@v4
127
+ with:
128
+ name: ${{ inputs.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports
129
+ path: /transformers/reports/${{ inputs.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/push-important-models.yml ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Slow tests on important models (on Push - A10)
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+
7
+ env:
8
+ OUTPUT_SLACK_CHANNEL_ID: "C06L2SGMEEA"
9
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
10
+ HF_HOME: /mnt/cache
11
+ TRANSFORMERS_IS_CI: yes
12
+ OMP_NUM_THREADS: 8
13
+ MKL_NUM_THREADS: 8
14
+ RUN_SLOW: yes # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access. # This token is created under the bot `hf-transformers-bot`.
15
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
16
+ TF_FORCE_GPU_ALLOW_GROWTH: true
17
+ RUN_PT_TF_CROSS_TESTS: 1
18
+
19
+ jobs:
20
+ get_modified_models:
21
+ name: "Get all modified files"
22
+ runs-on: ubuntu-latest
23
+ outputs:
24
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
25
+ steps:
26
+ - name: Check out code
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Get changed files
30
+ id: changed-files
31
+ uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 #v42
32
+ with:
33
+ files: src/transformers/models/**
34
+
35
+ - name: Run step if only the files listed above change
36
+ if: steps.changed-files.outputs.any_changed == 'true'
37
+ id: set-matrix
38
+ env:
39
+ ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
40
+ run: |
41
+ model_arrays=()
42
+ for file in $ALL_CHANGED_FILES; do
43
+ model_path="${file#*models/}"
44
+ model_path="models/${model_path%%/*}"
45
+ if grep -qFx "$model_path" utils/important_models.txt; then
46
+ # Append the file to the matrix string
47
+ model_arrays+=("$model_path")
48
+ fi
49
+ done
50
+ matrix_string=$(printf '"%s", ' "${model_arrays[@]}" | sed 's/, $//')
51
+ echo "matrix=[$matrix_string]" >> $GITHUB_OUTPUT
52
+ test_modified_files:
53
+ needs: get_modified_models
54
+ name: Slow & FA2 tests
55
+ runs-on:
56
+ group: aws-g5-4xlarge-cache
57
+ container:
58
+ image: huggingface/transformers-all-latest-gpu
59
+ options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
60
+ if: ${{ needs.get_modified_models.outputs.matrix != '[]' && needs.get_modified_models.outputs.matrix != '' && fromJson(needs.get_modified_models.outputs.matrix)[0] != null }}
61
+ strategy:
62
+ fail-fast: false
63
+ matrix:
64
+ model-name: ${{ fromJson(needs.get_modified_models.outputs.matrix) }}
65
+
66
+ steps:
67
+ - name: Check out code
68
+ uses: actions/checkout@v4
69
+
70
+ - name: Install locally transformers & other libs
71
+ run: |
72
+ apt install sudo
73
+ sudo -H pip install --upgrade pip
74
+ sudo -H pip uninstall -y transformers
75
+ sudo -H pip install -U -e ".[testing]"
76
+ MAX_JOBS=4 pip install flash-attn --no-build-isolation
77
+ pip install bitsandbytes
78
+
79
+ - name: NVIDIA-SMI
80
+ run: |
81
+ nvidia-smi
82
+
83
+ - name: Show installed libraries and their versions
84
+ run: pip freeze
85
+
86
+ - name: Run FA2 tests
87
+ id: run_fa2_tests
88
+ run:
89
+ pytest -rsfE -m "flash_attn_test" --make-reports=${{ matrix.model-name }}_fa2_tests/ tests/${{ matrix.model-name }}/test_modeling_*
90
+
91
+ - name: "Test suite reports artifacts: ${{ matrix.model-name }}_fa2_tests"
92
+ if: ${{ always() }}
93
+ uses: actions/upload-artifact@v4
94
+ with:
95
+ name: ${{ matrix.model-name }}_fa2_tests
96
+ path: /transformers/reports/${{ matrix.model-name }}_fa2_tests
97
+
98
+ - name: Post to Slack
99
+ if: always()
100
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
101
+ with:
102
+ slack_channel: ${{ env.OUTPUT_SLACK_CHANNEL_ID }}
103
+ title: 🤗 Results of the FA2 tests - ${{ matrix.model-name }}
104
+ status: ${{ steps.run_fa2_tests.conclusion}}
105
+ slack_token: ${{ secrets.CI_SLACK_BOT_TOKEN }}
106
+
107
+ - name: Run integration tests
108
+ id: run_integration_tests
109
+ if: always()
110
+ run:
111
+ pytest -rsfE -k "IntegrationTest" --make-reports=tests_integration_${{ matrix.model-name }} tests/${{ matrix.model-name }}/test_modeling_*
112
+
113
+ - name: "Test suite reports artifacts: tests_integration_${{ matrix.model-name }}"
114
+ if: ${{ always() }}
115
+ uses: actions/upload-artifact@v4
116
+ with:
117
+ name: tests_integration_${{ matrix.model-name }}
118
+ path: /transformers/reports/tests_integration_${{ matrix.model-name }}
119
+
120
+ - name: Post to Slack
121
+ if: always()
122
+ uses: huggingface/hf-workflows/.github/actions/post-slack@main
123
+ with:
124
+ slack_channel: ${{ env.OUTPUT_SLACK_CHANNEL_ID }}
125
+ title: 🤗 Results of the Integration tests - ${{ matrix.model-name }}
126
+ status: ${{ steps.run_integration_tests.conclusion}}
127
+ slack_token: ${{ secrets.CI_SLACK_BOT_TOKEN }}
128
+
129
+ - name: Tailscale # In order to be able to SSH when a test fails
130
+ if: ${{ runner.debug == '1'}}
131
+ uses: huggingface/tailscale-action@v1
132
+ with:
133
+ authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
134
+ slackChannel: ${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}
135
+ slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
136
+ waitForSSH: true
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/release-conda.yml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Release - Conda
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+ branches:
8
+ - conda_*
9
+
10
+ env:
11
+ ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
12
+
13
+ jobs:
14
+ build_and_package:
15
+ runs-on: ubuntu-22.04
16
+ defaults:
17
+ run:
18
+ shell: bash -l {0}
19
+
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Install miniconda
25
+ uses: conda-incubator/setup-miniconda@v2
26
+ with:
27
+ auto-update-conda: true
28
+ auto-activate-base: false
29
+ python-version: 3.8
30
+ activate-environment: "build-transformers"
31
+ channels: huggingface
32
+
33
+ - name: Setup conda env
34
+ run: |
35
+ conda install -c defaults anaconda-client conda-build
36
+
37
+ - name: Extract version
38
+ run: echo "TRANSFORMERS_VERSION=`python setup.py --version`" >> $GITHUB_ENV
39
+
40
+ - name: Build conda packages
41
+ run: |
42
+ conda info
43
+ conda list
44
+ conda-build .github/conda
45
+
46
+ - name: Upload to Anaconda
47
+ run: anaconda upload `conda-build .github/conda --output` --force
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-nightly-caller.yml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (nightly-ci)
2
+
3
+
4
+ on:
5
+ repository_dispatch:
6
+ schedule:
7
+ - cron: "17 2 * * *"
8
+ push:
9
+ branches:
10
+ - run_nightly_ci*
11
+
12
+ jobs:
13
+ build_nightly_ci_images:
14
+ name: Build Nightly CI Docker Images
15
+ if: (github.event_name == 'schedule') || ((github.event_name == 'push') && startsWith(github.ref_name, 'run_nightly_ci'))
16
+ uses: ./.github/workflows/build-nightly-ci-docker-images.yml
17
+ secrets: inherit
18
+
19
+ model-ci:
20
+ name: Model CI
21
+ needs: [build_nightly_ci_images]
22
+ uses: ./.github/workflows/self-scheduled.yml
23
+ with:
24
+ job: run_models_gpu
25
+ slack_report_channel: "#transformers-ci-past-future"
26
+ runner: ci
27
+ docker: huggingface/transformers-all-latest-torch-nightly-gpu
28
+ ci_event: Nightly CI
29
+ secrets: inherit
30
+
31
+ deepspeed-ci:
32
+ name: DeepSpeed CI
33
+ needs: [build_nightly_ci_images]
34
+ uses: ./.github/workflows/self-scheduled.yml
35
+ with:
36
+ job: run_torch_cuda_extensions_gpu
37
+ slack_report_channel: "#transformers-ci-past-future"
38
+ runner: ci
39
+ # test deepspeed nightly build with the latest release torch
40
+ docker: huggingface/transformers-pytorch-deepspeed-latest-gpu
41
+ ci_event: Nightly CI
42
+ working-directory-prefix: /workspace
43
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-nightly-past-ci-caller.yml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (nightly-past-ci-caller)
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "17 2,14 * * *"
6
+ push:
7
+ branches:
8
+ - run_past_ci*
9
+
10
+ jobs:
11
+ get_number:
12
+ name: Get number
13
+ runs-on: ubuntu-22.04
14
+ outputs:
15
+ run_number: ${{ steps.get_number.outputs.run_number }}
16
+ steps:
17
+ - name: Get number
18
+ id: get_number
19
+ run: |
20
+ echo "${{ github.run_number }}"
21
+ echo "$(python3 -c 'print(int(${{ github.run_number }}) % 10)')"
22
+ echo "run_number=$(python3 -c 'print(int(${{ github.run_number }}) % 10)')" >> $GITHUB_OUTPUT
23
+
24
+ run_past_ci_tensorflow_2-11:
25
+ name: TensorFlow 2.11
26
+ needs: get_number
27
+ if: needs.get_number.outputs.run_number == 3 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
28
+ uses: ./.github/workflows/self-past-caller.yml
29
+ with:
30
+ framework: tensorflow
31
+ version: "2.11"
32
+ sha: ${{ github.sha }}
33
+ secrets: inherit
34
+
35
+ run_past_ci_tensorflow_2-10:
36
+ name: TensorFlow 2.10
37
+ needs: get_number
38
+ if: needs.get_number.outputs.run_number == 4 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
39
+ uses: ./.github/workflows/self-past-caller.yml
40
+ with:
41
+ framework: tensorflow
42
+ version: "2.10"
43
+ sha: ${{ github.sha }}
44
+ secrets: inherit
45
+
46
+ run_past_ci_tensorflow_2-9:
47
+ name: TensorFlow 2.9
48
+ needs: get_number
49
+ if: needs.get_number.outputs.run_number == 5 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
50
+ uses: ./.github/workflows/self-past-caller.yml
51
+ with:
52
+ framework: tensorflow
53
+ version: "2.9"
54
+ sha: ${{ github.sha }}
55
+ secrets: inherit
56
+
57
+ run_past_ci_tensorflow_2-8:
58
+ name: TensorFlow 2.8
59
+ needs: get_number
60
+ if: needs.get_number.outputs.run_number == 6 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
61
+ uses: ./.github/workflows/self-past-caller.yml
62
+ with:
63
+ framework: tensorflow
64
+ version: "2.8"
65
+ sha: ${{ github.sha }}
66
+ secrets: inherit
67
+
68
+ run_past_ci_tensorflow_2-7:
69
+ name: TensorFlow 2.7
70
+ needs: get_number
71
+ if: needs.get_number.outputs.run_number == 7 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
72
+ uses: ./.github/workflows/self-past-caller.yml
73
+ with:
74
+ framework: tensorflow
75
+ version: "2.7"
76
+ sha: ${{ github.sha }}
77
+ secrets: inherit
78
+
79
+ run_past_ci_tensorflow_2-6:
80
+ name: TensorFlow 2.6
81
+ needs: get_number
82
+ if: needs.get_number.outputs.run_number == 8 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
83
+ uses: ./.github/workflows/self-past-caller.yml
84
+ with:
85
+ framework: tensorflow
86
+ version: "2.6"
87
+ sha: ${{ github.sha }}
88
+ secrets: inherit
89
+
90
+ run_past_ci_tensorflow_2-5:
91
+ name: TensorFlow 2.5
92
+ needs: get_number
93
+ if: needs.get_number.outputs.run_number == 9 && (cancelled() != true) && ((github.event_name == 'push') && startsWith(github.ref_name, 'run_past_ci'))
94
+ uses: ./.github/workflows/self-past-caller.yml
95
+ with:
96
+ framework: tensorflow
97
+ version: "2.5"
98
+ sha: ${{ github.sha }}
99
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-past-caller.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (past-ci)
2
+
3
+
4
+ on:
5
+ workflow_call:
6
+ inputs:
7
+ framework:
8
+ required: true
9
+ type: string
10
+ version:
11
+ required: true
12
+ type: string
13
+ # Use this to control the commit to test against
14
+ sha:
15
+ default: 'main'
16
+ required: false
17
+ type: string
18
+
19
+ jobs:
20
+ model-ci:
21
+ name: Model CI
22
+ uses: ./.github/workflows/self-scheduled.yml
23
+ with:
24
+ job: run_models_gpu
25
+ slack_report_channel: "#transformers-ci-past-future"
26
+ runner: past-ci
27
+ docker: huggingface/transformers-${{ inputs.framework }}-past-${{ inputs.version }}-gpu
28
+ ci_event: Past CI - ${{ inputs.framework }}-${{ inputs.version }}
29
+ secrets: inherit
30
+
31
+ deepspeed-ci:
32
+ name: DeepSpeed CI
33
+ uses: ./.github/workflows/self-scheduled.yml
34
+ with:
35
+ job: run_torch_cuda_extensions_gpu
36
+ slack_report_channel: "#transformers-ci-past-future"
37
+ runner: past-ci
38
+ docker: huggingface/transformers-${{ inputs.framework }}-past-${{ inputs.version }}-gpu
39
+ ci_event: Past CI - ${{ inputs.framework }}-${{ inputs.version }}
40
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi210-caller.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD mi210 CI caller)
2
+
3
+ on:
4
+ #workflow_run:
5
+ # workflows: ["Self-hosted runner (push-caller)"]
6
+ # branches: ["main"]
7
+ # types: [completed]
8
+ push:
9
+ branches:
10
+ - run_amd_push_ci_caller*
11
+ paths:
12
+ - "src/**"
13
+ - "tests/**"
14
+ - ".github/**"
15
+ - "templates/**"
16
+ - "utils/**"
17
+
18
+ jobs:
19
+ run_amd_ci:
20
+ name: AMD mi210
21
+ if: (cancelled() != true) && ((github.event_name == 'workflow_run') || ((github.event_name == 'push') && startsWith(github.ref_name, 'run_amd_push_ci_caller')))
22
+ uses: ./.github/workflows/self-push-amd.yml
23
+ with:
24
+ gpu_flavor: mi210
25
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi250-caller.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD mi250 CI caller)
2
+
3
+ on:
4
+ #workflow_run:
5
+ # workflows: ["Self-hosted runner (push-caller)"]
6
+ # branches: ["main"]
7
+ # types: [completed]
8
+ push:
9
+ branches:
10
+ - run_amd_push_ci_caller*
11
+ paths:
12
+ - "src/**"
13
+ - "tests/**"
14
+ - ".github/**"
15
+ - "templates/**"
16
+ - "utils/**"
17
+
18
+ jobs:
19
+ run_amd_ci:
20
+ name: AMD mi250
21
+ if: (cancelled() != true) && ((github.event_name == 'workflow_run') || ((github.event_name == 'push') && startsWith(github.ref_name, 'run_amd_push_ci_caller')))
22
+ uses: ./.github/workflows/self-push-amd.yml
23
+ with:
24
+ gpu_flavor: mi250
25
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd-mi300-caller.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD mi300 CI caller)
2
+
3
+ on:
4
+ #workflow_run:
5
+ # workflows: ["Self-hosted runner (push-caller)"]
6
+ # branches: ["main"]
7
+ # types: [completed]
8
+ push:
9
+ branches:
10
+ - run_amd_push_ci_caller*
11
+ paths:
12
+ - "src/**"
13
+ - "tests/**"
14
+ - ".github/**"
15
+ - "templates/**"
16
+ - "utils/**"
17
+
18
+ jobs:
19
+ run_amd_ci:
20
+ name: AMD mi300
21
+ if: (cancelled() != true) && ((github.event_name == 'workflow_run') || ((github.event_name == 'push') && (startsWith(github.ref_name, 'run_amd_push_ci_caller') || startsWith(github.ref_name, 'mi300-ci'))))
22
+ uses: ./.github/workflows/self-push-amd.yml
23
+ with:
24
+ gpu_flavor: mi300
25
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-amd.yml ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner AMD GPU (push)
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ gpu_flavor:
7
+ required: true
8
+ type: string
9
+
10
+ env:
11
+ HF_HOME: /mnt/cache
12
+ TRANSFORMERS_IS_CI: yes
13
+ OMP_NUM_THREADS: 8
14
+ MKL_NUM_THREADS: 8
15
+ PYTEST_TIMEOUT: 60
16
+ TF_FORCE_GPU_ALLOW_GROWTH: true
17
+ RUN_PT_TF_CROSS_TESTS: 1
18
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
19
+
20
+ jobs:
21
+ check_runner_status:
22
+ name: Check Runner Status
23
+ runs-on: ubuntu-22.04
24
+ steps:
25
+ - name: Checkout transformers
26
+ uses: actions/checkout@v4
27
+ with:
28
+ fetch-depth: 2
29
+
30
+ - name: Check Runner Status
31
+ run: python utils/check_self_hosted_runner.py --target_runners amd-mi210-single-gpu-ci-runner-docker --token ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
32
+
33
+ check_runners:
34
+ name: Check Runners
35
+ needs: check_runner_status
36
+ strategy:
37
+ matrix:
38
+ machine_type: [single-gpu, multi-gpu]
39
+ runs-on: [self-hosted, amd-gpu, '${{ matrix.machine_type }}', '${{ inputs.gpu_flavor }}']
40
+ container:
41
+ image: huggingface/transformers-pytorch-amd-gpu-push-ci # <--- We test only for PyTorch for now
42
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
43
+ steps:
44
+ - name: ROCM-SMI
45
+ run: |
46
+ rocm-smi
47
+ - name: ROCM-INFO
48
+ run: |
49
+ rocminfo | grep "Agent" -A 14
50
+ - name: Show ROCR environment
51
+ run: |
52
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
53
+
54
+ setup_gpu:
55
+ name: Setup
56
+ needs: check_runners
57
+ strategy:
58
+ matrix:
59
+ machine_type: [single-gpu, multi-gpu]
60
+ runs-on: [self-hosted, amd-gpu, '${{ matrix.machine_type }}', '${{ inputs.gpu_flavor }}']
61
+ container:
62
+ image: huggingface/transformers-pytorch-amd-gpu-push-ci # <--- We test only for PyTorch for now
63
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
64
+ outputs:
65
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
66
+ test_map: ${{ steps.set-matrix.outputs.test_map }}
67
+ env:
68
+ # `CI_BRANCH_PUSH`: The branch name from the push event
69
+ # `CI_BRANCH_WORKFLOW_RUN`: The name of the branch on which this workflow is triggered by `workflow_run` event
70
+ # `CI_SHA_PUSH`: The commit SHA from the push event
71
+ # `CI_SHA_WORKFLOW_RUN`: The commit SHA that triggers this workflow by `workflow_run` event
72
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
73
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
74
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
75
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
76
+ steps:
77
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
78
+ # We also take into account the `push` event (we might want to test some changes in a branch)
79
+ - name: Prepare custom environment variables
80
+ shell: bash
81
+ # `CI_BRANCH`: The non-empty branch name from the above two (one and only one of them is empty)
82
+ # `CI_SHA`: The non-empty commit SHA from the above two (one and only one of them is empty)
83
+ run: |
84
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
85
+ echo $CI_BRANCH_PUSH
86
+ echo $CI_BRANCH_WORKFLOW_RUN
87
+ echo $CI_SHA_PUSH
88
+ echo $CI_SHA_WORKFLOW_RUN
89
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
90
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
91
+
92
+ - name: print environment variables
93
+ run: |
94
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
95
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
96
+
97
+ - name: Update clone using environment variables
98
+ working-directory: /transformers
99
+ run: |
100
+ echo "original branch = $(git branch --show-current)"
101
+ git fetch && git checkout ${{ env.CI_BRANCH }}
102
+ echo "updated branch = $(git branch --show-current)"
103
+ git checkout ${{ env.CI_SHA }}
104
+ echo "log = $(git log -n 1)"
105
+
106
+ - name: Cleanup
107
+ working-directory: /transformers
108
+ run: |
109
+ rm -rf tests/__pycache__
110
+ rm -rf tests/models/__pycache__
111
+ rm -rf reports
112
+
113
+ - name: Show installed libraries and their versions
114
+ working-directory: /transformers
115
+ run: pip freeze
116
+
117
+ - name: Fetch the tests to run
118
+ working-directory: /transformers
119
+ # TODO: add `git-python` in the docker images
120
+ run: |
121
+ pip install --upgrade git-python
122
+ python3 utils/tests_fetcher.py --diff_with_last_commit | tee test_preparation.txt
123
+
124
+ - name: Report fetched tests
125
+ uses: actions/upload-artifact@v4
126
+ with:
127
+ name: test_fetched
128
+ path: /transformers/test_preparation.txt
129
+
130
+ - id: set-matrix
131
+ name: Organize tests into models
132
+ working-directory: /transformers
133
+ # The `keys` is used as GitHub actions matrix for jobs, i.e. `models/bert`, `tokenization`, `pipeline`, etc.
134
+ # The `test_map` is used to get the actual identified test files under each key.
135
+ # If no test to run (so no `test_map.json` file), create a dummy map (empty matrix will fail)
136
+ run: |
137
+ if [ -f test_map.json ]; then
138
+ keys=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); d = list(test_map.keys()); print(d)')
139
+ test_map=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); print(test_map)')
140
+ else
141
+ keys=$(python3 -c 'keys = ["dummy"]; print(keys)')
142
+ test_map=$(python3 -c 'test_map = {"dummy": []}; print(test_map)')
143
+ fi
144
+ echo $keys
145
+ echo $test_map
146
+ echo "matrix=$keys" >> $GITHUB_OUTPUT
147
+ echo "test_map=$test_map" >> $GITHUB_OUTPUT
148
+
149
+ run_models_gpu:
150
+ name: Model tests
151
+ needs: setup_gpu
152
+ # `dummy` means there is no test to run
153
+ if: contains(fromJson(needs.setup_gpu.outputs.matrix), 'dummy') != true
154
+ strategy:
155
+ fail-fast: false
156
+ matrix:
157
+ folders: ${{ fromJson(needs.setup_gpu.outputs.matrix) }}
158
+ machine_type: [single-gpu, multi-gpu]
159
+ runs-on: [self-hosted, amd-gpu, '${{ matrix.machine_type }}', '${{ inputs.gpu_flavor }}']
160
+ container:
161
+ image: huggingface/transformers-pytorch-amd-gpu-push-ci # <--- We test only for PyTorch for now
162
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
163
+ env:
164
+ # For the meaning of these environment variables, see the job `Setup`
165
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
166
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
167
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
168
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
169
+ steps:
170
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
171
+ # We also take into account the `push` event (we might want to test some changes in a branch)
172
+ - name: Prepare custom environment variables
173
+ shell: bash
174
+ # For the meaning of these environment variables, see the job `Setup`
175
+ run: |
176
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
177
+ echo $CI_BRANCH_PUSH
178
+ echo $CI_BRANCH_WORKFLOW_RUN
179
+ echo $CI_SHA_PUSH
180
+ echo $CI_SHA_WORKFLOW_RUN
181
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
182
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
183
+
184
+ - name: print environment variables
185
+ run: |
186
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
187
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
188
+
189
+ - name: Update clone using environment variables
190
+ working-directory: /transformers
191
+ run: |
192
+ echo "original branch = $(git branch --show-current)"
193
+ git fetch && git checkout ${{ env.CI_BRANCH }}
194
+ echo "updated branch = $(git branch --show-current)"
195
+ git checkout ${{ env.CI_SHA }}
196
+ echo "log = $(git log -n 1)"
197
+
198
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
199
+ working-directory: /transformers
200
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
201
+
202
+ - name: Echo folder ${{ matrix.folders }}
203
+ shell: bash
204
+ # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
205
+ # set the artifact folder names (because the character `/` is not allowed).
206
+ run: |
207
+ echo "${{ matrix.folders }}"
208
+ echo "${{ fromJson(needs.setup_gpu.outputs.test_map)[matrix.folders] }}"
209
+ matrix_folders=${{ matrix.folders }}
210
+ matrix_folders=${matrix_folders/'models/'/'models_'}
211
+ echo "$matrix_folders"
212
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
213
+
214
+ - name: ROCM-SMI
215
+ run: |
216
+ rocm-smi
217
+ - name: ROCM-INFO
218
+ run: |
219
+ rocminfo | grep "Agent" -A 14
220
+ - name: Show ROCR environment
221
+ run: |
222
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
223
+
224
+ - name: Environment
225
+ working-directory: /transformers
226
+ run: |
227
+ python3 utils/print_env.py
228
+
229
+ - name: Show installed libraries and their versions
230
+ working-directory: /transformers
231
+ run: pip freeze
232
+
233
+ - name: Run all non-slow selected tests on GPU
234
+ working-directory: /transformers
235
+ run: |
236
+ python3 -m pytest -n 2 --dist=loadfile -v --make-reports=${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports ${{ fromJson(needs.setup_gpu.outputs.test_map)[matrix.folders] }} -m "not not_device_test"
237
+
238
+ - name: Failure short reports
239
+ if: ${{ failure() }}
240
+ continue-on-error: true
241
+ run: cat /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports/failures_short.txt
242
+
243
+ - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports"
244
+ if: ${{ always() }}
245
+ uses: actions/upload-artifact@v4
246
+ with:
247
+ name: ${{ matrix.machine_type }}_run_models_gpu_${{ env.matrix_folders }}_test_reports
248
+ path: /transformers/reports/${{ matrix.machine_type }}_run_models_gpu_${{ matrix.folders }}_test_reports
249
+
250
+ send_results:
251
+ name: Send results to webhook
252
+ runs-on: ubuntu-22.04
253
+ if: always()
254
+ needs: [
255
+ check_runner_status,
256
+ check_runners,
257
+ setup_gpu,
258
+ run_models_gpu,
259
+ # run_tests_torch_cuda_extensions_single_gpu,
260
+ # run_tests_torch_cuda_extensions_multi_gpu
261
+ ]
262
+ env:
263
+ # For the meaning of these environment variables, see the job `Setup`
264
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
265
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
266
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
267
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
268
+ steps:
269
+ - name: Preliminary job status
270
+ shell: bash
271
+ # For the meaning of these environment variables, see the job `Setup`
272
+ run: |
273
+ echo "Runner availability: ${{ needs.check_runner_status.result }}"
274
+ echo "Setup status: ${{ needs.setup_gpu.result }}"
275
+ echo "Runner status: ${{ needs.check_runners.result }}"
276
+
277
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
278
+ # We also take into account the `push` event (we might want to test some changes in a branch)
279
+ - name: Prepare custom environment variables
280
+ shell: bash
281
+ # For the meaning of these environment variables, see the job `Setup`
282
+ run: |
283
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
284
+ echo $CI_BRANCH_PUSH
285
+ echo $CI_BRANCH_WORKFLOW_RUN
286
+ echo $CI_SHA_PUSH
287
+ echo $CI_SHA_WORKFLOW_RUN
288
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
289
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
290
+
291
+ - name: print environment variables
292
+ run: |
293
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
294
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
295
+
296
+ - uses: actions/checkout@v4
297
+ # To avoid failure when multiple commits are merged into `main` in a short period of time.
298
+ # Checking out to an old commit beyond the fetch depth will get an error `fatal: reference is not a tree: ...
299
+ # (Only required for `workflow_run` event, where we get the latest HEAD on `main` instead of the event commit)
300
+ with:
301
+ fetch-depth: 20
302
+
303
+ - name: Update clone using environment variables
304
+ run: |
305
+ echo "original branch = $(git branch --show-current)"
306
+ git fetch && git checkout ${{ env.CI_BRANCH }}
307
+ echo "updated branch = $(git branch --show-current)"
308
+ git checkout ${{ env.CI_SHA }}
309
+ echo "log = $(git log -n 1)"
310
+
311
+ - uses: actions/download-artifact@v4
312
+ - name: Send message to Slack
313
+ env:
314
+ CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
315
+ CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }}
316
+ CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }}
317
+ CI_SLACK_CHANNEL_ID_AMD: ${{ secrets.CI_SLACK_CHANNEL_ID_AMD }}
318
+ CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }}
319
+ CI_SLACK_REPORT_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID_AMD }}
320
+ ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
321
+ CI_EVENT: Push CI (AMD) - ${{ inputs.gpu_flavor }}
322
+ CI_TITLE_PUSH: ${{ github.event.head_commit.message }}
323
+ CI_TITLE_WORKFLOW_RUN: ${{ github.event.workflow_run.head_commit.message }}
324
+ CI_SHA: ${{ env.CI_SHA }}
325
+ RUNNER_STATUS: ${{ needs.check_runner_status.result }}
326
+ RUNNER_ENV_STATUS: ${{ needs.check_runners.result }}
327
+ SETUP_STATUS: ${{ needs.setup_gpu.result }}
328
+
329
+ # We pass `needs.setup_gpu.outputs.matrix` as the argument. A processing in `notification_service.py` to change
330
+ # `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`.
331
+ run: |
332
+ pip install huggingface_hub
333
+ pip install slack_sdk
334
+ pip show slack_sdk
335
+ python utils/notification_service.py "${{ needs.setup_gpu.outputs.matrix }}"
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push-caller.yml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Used to trigger self-push CI
2
+ name: Self-hosted runner (push-caller)
3
+
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ paths:
9
+ - "src/**"
10
+ - "tests/**"
11
+ - ".github/**"
12
+ - "templates/**"
13
+ - "utils/**"
14
+
15
+ jobs:
16
+ check-for-setup:
17
+ runs-on: ubuntu-22.04
18
+ name: Check if setup was changed
19
+ outputs:
20
+ changed: ${{ steps.was_changed.outputs.changed }}
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: "2"
25
+
26
+ - name: Get changed files
27
+ id: changed-files
28
+ uses: tj-actions/changed-files@v41
29
+
30
+ - name: Was setup changed
31
+ id: was_changed
32
+ run: |
33
+ for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
34
+ if [ `basename "${file}"` = "setup.py" ]; then
35
+ echo "changed=1" >> $GITHUB_OUTPUT
36
+ fi
37
+ done
38
+
39
+ build-docker-containers:
40
+ needs: check-for-setup
41
+ if: (github.event_name == 'push') && (needs.check-for-setup.outputs.changed == '1')
42
+ uses: ./.github/workflows/build-docker-images.yml
43
+ with:
44
+ image_postfix: "-push-ci"
45
+ secrets: inherit
46
+
47
+ run_push_ci:
48
+ name: Trigger Push CI
49
+ runs-on: ubuntu-22.04
50
+ if: ${{ always() }}
51
+ needs: build-docker-containers
52
+ steps:
53
+ - name: Trigger push CI via workflow_run
54
+ run: echo "Trigger push CI via workflow_run"
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-push.yml ADDED
@@ -0,0 +1,653 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (push)
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["Self-hosted runner (push-caller)"]
6
+ branches: ["main"]
7
+ types: [completed]
8
+ push:
9
+ branches:
10
+ - ci_*
11
+ - ci-*
12
+ paths:
13
+ - "src/**"
14
+ - "tests/**"
15
+ - ".github/**"
16
+ - "templates/**"
17
+ - "utils/**"
18
+ repository_dispatch:
19
+
20
+ env:
21
+ HF_HOME: /mnt/cache
22
+ TRANSFORMERS_IS_CI: yes
23
+ OMP_NUM_THREADS: 8
24
+ MKL_NUM_THREADS: 8
25
+ PYTEST_TIMEOUT: 60
26
+ TF_FORCE_GPU_ALLOW_GROWTH: true
27
+ RUN_PT_TF_CROSS_TESTS: 1
28
+ CUDA_VISIBLE_DEVICES: 0,1
29
+
30
+ jobs:
31
+ setup:
32
+ name: Setup
33
+ strategy:
34
+ matrix:
35
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
36
+ runs-on:
37
+ group: '${{ matrix.machine_type }}'
38
+ container:
39
+ image: huggingface/transformers-all-latest-gpu-push-ci
40
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
41
+ outputs:
42
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
43
+ test_map: ${{ steps.set-matrix.outputs.test_map }}
44
+ env:
45
+ # `CI_BRANCH_PUSH`: The branch name from the push event
46
+ # `CI_BRANCH_WORKFLOW_RUN`: The name of the branch on which this workflow is triggered by `workflow_run` event
47
+ # `CI_SHA_PUSH`: The commit SHA from the push event
48
+ # `CI_SHA_WORKFLOW_RUN`: The commit SHA that triggers this workflow by `workflow_run` event
49
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
50
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
51
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
52
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
53
+ steps:
54
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
55
+ # We also take into account the `push` event (we might want to test some changes in a branch)
56
+ - name: Prepare custom environment variables
57
+ shell: bash
58
+ # `CI_BRANCH`: The non-empty branch name from the above two (one and only one of them is empty)
59
+ # `CI_SHA`: The non-empty commit SHA from the above two (one and only one of them is empty)
60
+ run: |
61
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
62
+ echo $CI_BRANCH_PUSH
63
+ echo $CI_BRANCH_WORKFLOW_RUN
64
+ echo $CI_SHA_PUSH
65
+ echo $CI_SHA_WORKFLOW_RUN
66
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
67
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
68
+
69
+ - name: print environment variables
70
+ run: |
71
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
72
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
73
+
74
+ - name: Update clone using environment variables
75
+ working-directory: /transformers
76
+ run: |
77
+ echo "original branch = $(git branch --show-current)"
78
+ git fetch && git checkout ${{ env.CI_BRANCH }}
79
+ echo "updated branch = $(git branch --show-current)"
80
+ git checkout ${{ env.CI_SHA }}
81
+ echo "log = $(git log -n 1)"
82
+
83
+ - name: Cleanup
84
+ working-directory: /transformers
85
+ run: |
86
+ rm -rf tests/__pycache__
87
+ rm -rf tests/models/__pycache__
88
+ rm -rf reports
89
+
90
+ - name: Show installed libraries and their versions
91
+ working-directory: /transformers
92
+ run: pip freeze
93
+
94
+ - name: Fetch the tests to run
95
+ working-directory: /transformers
96
+ # TODO: add `git-python` in the docker images
97
+ run: |
98
+ pip install --upgrade git-python
99
+ python3 utils/tests_fetcher.py --diff_with_last_commit | tee test_preparation.txt
100
+
101
+ - name: Report fetched tests
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: test_fetched
105
+ path: /transformers/test_preparation.txt
106
+
107
+ - id: set-matrix
108
+ name: Organize tests into models
109
+ working-directory: /transformers
110
+ # The `keys` is used as GitHub actions matrix for jobs, i.e. `models/bert`, `tokenization`, `pipeline`, etc.
111
+ # The `test_map` is used to get the actual identified test files under each key.
112
+ # If no test to run (so no `test_map.json` file), create a dummy map (empty matrix will fail)
113
+ run: |
114
+ if [ -f test_map.json ]; then
115
+ keys=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); d = list(test_map.keys()); print(d)')
116
+ test_map=$(python3 -c 'import json; fp = open("test_map.json"); test_map = json.load(fp); fp.close(); print(test_map)')
117
+ else
118
+ keys=$(python3 -c 'keys = ["dummy"]; print(keys)')
119
+ test_map=$(python3 -c 'test_map = {"dummy": []}; print(test_map)')
120
+ fi
121
+ echo $keys
122
+ echo $test_map
123
+ echo "matrix=$keys" >> $GITHUB_OUTPUT
124
+ echo "test_map=$test_map" >> $GITHUB_OUTPUT
125
+
126
+ run_tests_single_gpu:
127
+ name: Model tests
128
+ needs: setup
129
+ # `dummy` means there is no test to run
130
+ if: contains(fromJson(needs.setup.outputs.matrix), 'dummy') != true
131
+ strategy:
132
+ fail-fast: false
133
+ matrix:
134
+ folders: ${{ fromJson(needs.setup.outputs.matrix) }}
135
+ machine_type: [aws-g4dn-2xlarge-cache]
136
+ runs-on:
137
+ group: '${{ matrix.machine_type }}'
138
+ container:
139
+ image: huggingface/transformers-all-latest-gpu-push-ci
140
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
141
+ env:
142
+ # For the meaning of these environment variables, see the job `Setup`
143
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
144
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
145
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
146
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
147
+ steps:
148
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
149
+ # We also take into account the `push` event (we might want to test some changes in a branch)
150
+ - name: Prepare custom environment variables
151
+ shell: bash
152
+ # For the meaning of these environment variables, see the job `Setup`
153
+ run: |
154
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
155
+ echo $CI_BRANCH_PUSH
156
+ echo $CI_BRANCH_WORKFLOW_RUN
157
+ echo $CI_SHA_PUSH
158
+ echo $CI_SHA_WORKFLOW_RUN
159
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
160
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
161
+
162
+ - name: print environment variables
163
+ run: |
164
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
165
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
166
+
167
+ - name: Set `machine_type` for report and artifact names
168
+ working-directory: /transformers
169
+ shell: bash
170
+ run: |
171
+ echo "${{ matrix.machine_type }}"
172
+
173
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
174
+ machine_type=single-gpu
175
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
176
+ machine_type=multi-gpu
177
+ else
178
+ machine_type=${{ matrix.machine_type }}
179
+ fi
180
+
181
+ echo "$machine_type"
182
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
183
+
184
+ - name: Update clone using environment variables
185
+ working-directory: /transformers
186
+ run: |
187
+ echo "original branch = $(git branch --show-current)"
188
+ git fetch && git checkout ${{ env.CI_BRANCH }}
189
+ echo "updated branch = $(git branch --show-current)"
190
+ git checkout ${{ env.CI_SHA }}
191
+ echo "log = $(git log -n 1)"
192
+
193
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
194
+ working-directory: /transformers
195
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
196
+
197
+ - name: Echo folder ${{ matrix.folders }}
198
+ shell: bash
199
+ # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
200
+ # set the artifact folder names (because the character `/` is not allowed).
201
+ run: |
202
+ echo "${{ matrix.folders }}"
203
+ echo "${{ fromJson(needs.setup.outputs.test_map)[matrix.folders] }}"
204
+ matrix_folders=${{ matrix.folders }}
205
+ matrix_folders=${matrix_folders/'models/'/'models_'}
206
+ echo "$matrix_folders"
207
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
208
+
209
+ - name: NVIDIA-SMI
210
+ run: |
211
+ nvidia-smi
212
+
213
+ - name: Environment
214
+ working-directory: /transformers
215
+ run: |
216
+ python3 utils/print_env.py
217
+
218
+ - name: Show installed libraries and their versions
219
+ working-directory: /transformers
220
+ run: pip freeze
221
+
222
+ - name: Run all non-slow selected tests on GPU
223
+ working-directory: /transformers
224
+ run: |
225
+ python3 -m pytest -n 2 --dist=loadfile -v --make-reports=${{ env.machine_type }}_tests_gpu_${{ matrix.folders }} ${{ fromJson(needs.setup.outputs.test_map)[matrix.folders] }}
226
+
227
+ - name: Failure short reports
228
+ if: ${{ failure() }}
229
+ continue-on-error: true
230
+ run: cat /transformers/reports/${{ env.machine_type }}_tests_gpu_${{ matrix.folders }}/failures_short.txt
231
+
232
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_all_tests_gpu_${{ env.matrix_folders }}_test_reports"
233
+ if: ${{ always() }}
234
+ uses: actions/upload-artifact@v4
235
+ with:
236
+ name: ${{ env.machine_type }}_run_all_tests_gpu_${{ env.matrix_folders }}_test_reports
237
+ path: /transformers/reports/${{ env.machine_type }}_tests_gpu_${{ matrix.folders }}
238
+
239
+ run_tests_multi_gpu:
240
+ name: Model tests
241
+ needs: setup
242
+ # `dummy` means there is no test to run
243
+ if: contains(fromJson(needs.setup.outputs.matrix), 'dummy') != true
244
+ strategy:
245
+ fail-fast: false
246
+ matrix:
247
+ folders: ${{ fromJson(needs.setup.outputs.matrix) }}
248
+ machine_type: [aws-g4dn-12xlarge-cache]
249
+ runs-on:
250
+ group: '${{ matrix.machine_type }}'
251
+ container:
252
+ image: huggingface/transformers-all-latest-gpu-push-ci
253
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
254
+ env:
255
+ # For the meaning of these environment variables, see the job `Setup`
256
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
257
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
258
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
259
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
260
+ steps:
261
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
262
+ # We also take into account the `push` event (we might want to test some changes in a branch)
263
+ - name: Prepare custom environment variables
264
+ shell: bash
265
+ # For the meaning of these environment variables, see the job `Setup`
266
+ run: |
267
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
268
+ echo $CI_BRANCH_PUSH
269
+ echo $CI_BRANCH_WORKFLOW_RUN
270
+ echo $CI_SHA_PUSH
271
+ echo $CI_SHA_WORKFLOW_RUN
272
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
273
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
274
+
275
+ - name: print environment variables
276
+ run: |
277
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
278
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
279
+
280
+ - name: Set `machine_type` for report and artifact names
281
+ working-directory: /transformers
282
+ shell: bash
283
+ run: |
284
+ echo "${{ matrix.machine_type }}"
285
+
286
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
287
+ machine_type=single-gpu
288
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
289
+ machine_type=multi-gpu
290
+ else
291
+ machine_type=${{ matrix.machine_type }}
292
+ fi
293
+
294
+ echo "$machine_type"
295
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
296
+
297
+ - name: Update clone using environment variables
298
+ working-directory: /transformers
299
+ run: |
300
+ echo "original branch = $(git branch --show-current)"
301
+ git fetch && git checkout ${{ env.CI_BRANCH }}
302
+ echo "updated branch = $(git branch --show-current)"
303
+ git checkout ${{ env.CI_SHA }}
304
+ echo "log = $(git log -n 1)"
305
+
306
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
307
+ working-directory: /transformers
308
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
309
+
310
+ - name: Echo folder ${{ matrix.folders }}
311
+ shell: bash
312
+ # For folders like `models/bert`, set an env. var. (`matrix_folders`) to `models_bert`, which will be used to
313
+ # set the artifact folder names (because the character `/` is not allowed).
314
+ run: |
315
+ echo "${{ matrix.folders }}"
316
+ echo "${{ fromJson(needs.setup.outputs.test_map)[matrix.folders] }}"
317
+ matrix_folders=${{ matrix.folders }}
318
+ matrix_folders=${matrix_folders/'models/'/'models_'}
319
+ echo "$matrix_folders"
320
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
321
+
322
+ - name: NVIDIA-SMI
323
+ run: |
324
+ nvidia-smi
325
+
326
+ - name: Environment
327
+ working-directory: /transformers
328
+ run: |
329
+ python3 utils/print_env.py
330
+
331
+ - name: Show installed libraries and their versions
332
+ working-directory: /transformers
333
+ run: pip freeze
334
+
335
+ - name: Run all non-slow selected tests on GPU
336
+ env:
337
+ MKL_SERVICE_FORCE_INTEL: 1
338
+ working-directory: /transformers
339
+ run: |
340
+ python3 -m pytest -n 2 --dist=loadfile -v --make-reports=${{ env.machine_type }}_tests_gpu_${{ matrix.folders }} ${{ fromJson(needs.setup.outputs.test_map)[matrix.folders] }}
341
+
342
+ - name: Failure short reports
343
+ if: ${{ failure() }}
344
+ continue-on-error: true
345
+ run: cat /transformers/reports/${{ env.machine_type }}_tests_gpu_${{ matrix.folders }}/failures_short.txt
346
+
347
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_all_tests_gpu_${{ env.matrix_folders }}_test_reports"
348
+ if: ${{ always() }}
349
+ uses: actions/upload-artifact@v4
350
+ with:
351
+ name: ${{ env.machine_type }}_run_all_tests_gpu_${{ env.matrix_folders }}_test_reports
352
+ path: /transformers/reports/${{ env.machine_type }}_tests_gpu_${{ matrix.folders }}
353
+
354
+ run_tests_torch_cuda_extensions_single_gpu:
355
+ name: Torch CUDA extension tests
356
+ needs: setup
357
+ if: contains(fromJson(needs.setup.outputs.matrix), 'deepspeed') || contains(fromJson(needs.setup.outputs.matrix), 'extended')
358
+ strategy:
359
+ fail-fast: false
360
+ matrix:
361
+ machine_type: [aws-g4dn-2xlarge-cache]
362
+ runs-on:
363
+ group: '${{ matrix.machine_type }}'
364
+ container:
365
+ image: huggingface/transformers-pytorch-deepspeed-latest-gpu-push-ci
366
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
367
+ env:
368
+ # For the meaning of these environment variables, see the job `Setup`
369
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
370
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
371
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
372
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
373
+ steps:
374
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
375
+ # We also take into account the `push` event (we might want to test some changes in a branch)
376
+ - name: Prepare custom environment variables
377
+ shell: bash
378
+ # For the meaning of these environment variables, see the job `Setup`
379
+ run: |
380
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
381
+ echo $CI_BRANCH_PUSH
382
+ echo $CI_BRANCH_WORKFLOW_RUN
383
+ echo $CI_SHA_PUSH
384
+ echo $CI_SHA_WORKFLOW_RUN
385
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
386
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
387
+
388
+ - name: print environment variables
389
+ run: |
390
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
391
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
392
+
393
+ - name: Set `machine_type` for report and artifact names
394
+ working-directory: /workspace/transformers
395
+ shell: bash
396
+ run: |
397
+ echo "${{ matrix.machine_type }}"
398
+
399
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
400
+ machine_type=single-gpu
401
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
402
+ machine_type=multi-gpu
403
+ else
404
+ machine_type=${{ matrix.machine_type }}
405
+ fi
406
+
407
+ echo "$machine_type"
408
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
409
+
410
+ - name: Update clone using environment variables
411
+ working-directory: /workspace/transformers
412
+ run: |
413
+ echo "original branch = $(git branch --show-current)"
414
+ git fetch && git checkout ${{ env.CI_BRANCH }}
415
+ echo "updated branch = $(git branch --show-current)"
416
+ git checkout ${{ env.CI_SHA }}
417
+ echo "log = $(git log -n 1)"
418
+
419
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
420
+ working-directory: /workspace/transformers
421
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
422
+
423
+ - name: Remove cached torch extensions
424
+ run: rm -rf /github/home/.cache/torch_extensions/
425
+
426
+ # To avoid unknown test failures
427
+ - name: Pre build DeepSpeed *again*
428
+ working-directory: /workspace
429
+ run: |
430
+ python3 -m pip uninstall -y deepspeed
431
+ DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 python3 -m pip install deepspeed --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check
432
+
433
+ - name: NVIDIA-SMI
434
+ run: |
435
+ nvidia-smi
436
+
437
+ - name: Environment
438
+ working-directory: /workspace/transformers
439
+ run: |
440
+ python utils/print_env.py
441
+
442
+ - name: Show installed libraries and their versions
443
+ working-directory: /workspace/transformers
444
+ run: pip freeze
445
+
446
+ - name: Run all non-slow selected tests on GPU
447
+ working-directory: /workspace/transformers
448
+ # TODO: Here we pass all tests in the 2 folders for simplicity. It's better to pass only the identified tests.
449
+ run: |
450
+ python -m pytest -n 1 --dist=loadfile -v --make-reports=${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports tests/deepspeed tests/extended
451
+
452
+ - name: Failure short reports
453
+ if: ${{ failure() }}
454
+ continue-on-error: true
455
+ run: cat /workspace/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports/failures_short.txt
456
+
457
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports"
458
+ if: ${{ always() }}
459
+ uses: actions/upload-artifact@v4
460
+ with:
461
+ name: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
462
+ path: /workspace/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
463
+
464
+ run_tests_torch_cuda_extensions_multi_gpu:
465
+ name: Torch CUDA extension tests
466
+ needs: setup
467
+ if: contains(fromJson(needs.setup.outputs.matrix), 'deepspeed') || contains(fromJson(needs.setup.outputs.matrix), 'extended')
468
+ strategy:
469
+ fail-fast: false
470
+ matrix:
471
+ machine_type: [aws-g4dn-12xlarge-cache]
472
+ runs-on:
473
+ group: '${{ matrix.machine_type }}'
474
+ container:
475
+ image: huggingface/transformers-pytorch-deepspeed-latest-gpu-push-ci
476
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
477
+ env:
478
+ # For the meaning of these environment variables, see the job `Setup`
479
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
480
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
481
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
482
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
483
+ steps:
484
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
485
+ # We also take into account the `push` event (we might want to test some changes in a branch)
486
+ - name: Prepare custom environment variables
487
+ shell: bash
488
+ # For the meaning of these environment variables, see the job `Setup`
489
+ run: |
490
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
491
+ echo $CI_BRANCH_PUSH
492
+ echo $CI_BRANCH_WORKFLOW_RUN
493
+ echo $CI_SHA_PUSH
494
+ echo $CI_SHA_WORKFLOW_RUN
495
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
496
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
497
+
498
+ - name: print environment variables
499
+ run: |
500
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
501
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
502
+
503
+ - name: Set `machine_type` for report and artifact names
504
+ working-directory: /workspace/transformers
505
+ shell: bash
506
+ run: |
507
+ echo "${{ matrix.machine_type }}"
508
+
509
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
510
+ machine_type=single-gpu
511
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
512
+ machine_type=multi-gpu
513
+ else
514
+ machine_type=${{ matrix.machine_type }}
515
+ fi
516
+
517
+ echo "$machine_type"
518
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
519
+
520
+ - name: Update clone using environment variables
521
+ working-directory: /workspace/transformers
522
+ run: |
523
+ echo "original branch = $(git branch --show-current)"
524
+ git fetch && git checkout ${{ env.CI_BRANCH }}
525
+ echo "updated branch = $(git branch --show-current)"
526
+ git checkout ${{ env.CI_SHA }}
527
+ echo "log = $(git log -n 1)"
528
+
529
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
530
+ working-directory: /workspace/transformers
531
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
532
+
533
+ - name: Remove cached torch extensions
534
+ run: rm -rf /github/home/.cache/torch_extensions/
535
+
536
+ # To avoid unknown test failures
537
+ - name: Pre build DeepSpeed *again*
538
+ working-directory: /workspace
539
+ run: |
540
+ python3 -m pip uninstall -y deepspeed
541
+ DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 python3 -m pip install deepspeed --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check
542
+
543
+ - name: NVIDIA-SMI
544
+ run: |
545
+ nvidia-smi
546
+
547
+ - name: Environment
548
+ working-directory: /workspace/transformers
549
+ run: |
550
+ python utils/print_env.py
551
+
552
+ - name: Show installed libraries and their versions
553
+ working-directory: /workspace/transformers
554
+ run: pip freeze
555
+
556
+ - name: Run all non-slow selected tests on GPU
557
+ working-directory: /workspace/transformers
558
+ # TODO: Here we pass all tests in the 2 folders for simplicity. It's better to pass only the identified tests.
559
+ run: |
560
+ python -m pytest -n 1 --dist=loadfile -v --make-reports=${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports tests/deepspeed tests/extended
561
+
562
+ - name: Failure short reports
563
+ if: ${{ failure() }}
564
+ continue-on-error: true
565
+ run: cat /workspace/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports/failures_short.txt
566
+
567
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports"
568
+ if: ${{ always() }}
569
+ uses: actions/upload-artifact@v4
570
+ with:
571
+ name: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
572
+ path: /workspace/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
573
+
574
+ send_results:
575
+ name: Send results to webhook
576
+ runs-on: ubuntu-22.04
577
+ if: always()
578
+ needs: [
579
+ setup,
580
+ run_tests_single_gpu,
581
+ run_tests_multi_gpu,
582
+ run_tests_torch_cuda_extensions_single_gpu,
583
+ run_tests_torch_cuda_extensions_multi_gpu
584
+ ]
585
+ env:
586
+ # For the meaning of these environment variables, see the job `Setup`
587
+ CI_BRANCH_PUSH: ${{ github.event.ref }}
588
+ CI_BRANCH_WORKFLOW_RUN: ${{ github.event.workflow_run.head_branch }}
589
+ CI_SHA_PUSH: ${{ github.event.head_commit.id }}
590
+ CI_SHA_WORKFLOW_RUN: ${{ github.event.workflow_run.head_sha }}
591
+ steps:
592
+ - name: Preliminary job status
593
+ shell: bash
594
+ # For the meaning of these environment variables, see the job `Setup`
595
+ run: |
596
+ echo "Setup status: ${{ needs.setup.result }}"
597
+
598
+ # Necessary to get the correct branch name and commit SHA for `workflow_run` event
599
+ # We also take into account the `push` event (we might want to test some changes in a branch)
600
+ - name: Prepare custom environment variables
601
+ shell: bash
602
+ # For the meaning of these environment variables, see the job `Setup`
603
+ run: |
604
+ CI_BRANCH_PUSH=${CI_BRANCH_PUSH/'refs/heads/'/''}
605
+ echo $CI_BRANCH_PUSH
606
+ echo $CI_BRANCH_WORKFLOW_RUN
607
+ echo $CI_SHA_PUSH
608
+ echo $CI_SHA_WORKFLOW_RUN
609
+ [[ ! -z "$CI_BRANCH_PUSH" ]] && echo "CI_BRANCH=$CI_BRANCH_PUSH" >> $GITHUB_ENV || echo "CI_BRANCH=$CI_BRANCH_WORKFLOW_RUN" >> $GITHUB_ENV
610
+ [[ ! -z "$CI_SHA_PUSH" ]] && echo "CI_SHA=$CI_SHA_PUSH" >> $GITHUB_ENV || echo "CI_SHA=$CI_SHA_WORKFLOW_RUN" >> $GITHUB_ENV
611
+
612
+ - name: print environment variables
613
+ run: |
614
+ echo "env.CI_BRANCH = ${{ env.CI_BRANCH }}"
615
+ echo "env.CI_SHA = ${{ env.CI_SHA }}"
616
+
617
+ - uses: actions/checkout@v4
618
+ # To avoid failure when multiple commits are merged into `main` in a short period of time.
619
+ # Checking out to an old commit beyond the fetch depth will get an error `fatal: reference is not a tree: ...
620
+ # (Only required for `workflow_run` event, where we get the latest HEAD on `main` instead of the event commit)
621
+ with:
622
+ fetch-depth: 20
623
+
624
+ - name: Update clone using environment variables
625
+ run: |
626
+ echo "original branch = $(git branch --show-current)"
627
+ git fetch && git checkout ${{ env.CI_BRANCH }}
628
+ echo "updated branch = $(git branch --show-current)"
629
+ git checkout ${{ env.CI_SHA }}
630
+ echo "log = $(git log -n 1)"
631
+
632
+ - uses: actions/download-artifact@v4
633
+ - name: Send message to Slack
634
+ env:
635
+ CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
636
+ CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }}
637
+ CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }}
638
+ CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }}
639
+ CI_SLACK_REPORT_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }}
640
+ ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
641
+ CI_EVENT: push
642
+ CI_TITLE_PUSH: ${{ github.event.head_commit.message }}
643
+ CI_TITLE_WORKFLOW_RUN: ${{ github.event.workflow_run.head_commit.message }}
644
+ CI_SHA: ${{ env.CI_SHA }}
645
+ SETUP_STATUS: ${{ needs.setup.result }}
646
+
647
+ # We pass `needs.setup.outputs.matrix` as the argument. A processing in `notification_service.py` to change
648
+ # `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`.
649
+ run: |
650
+ pip install huggingface_hub
651
+ pip install slack_sdk
652
+ pip show slack_sdk
653
+ python utils/notification_service.py "${{ needs.setup.outputs.matrix }}"
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-caller.yml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD scheduled CI caller)
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "17 2 * * *"
6
+
7
+ jobs:
8
+ run_scheduled_amd_ci:
9
+ name: Trigger Scheduled AMD CI
10
+ runs-on: ubuntu-22.04
11
+ if: ${{ always() }}
12
+ steps:
13
+ - name: Trigger scheduled AMD CI via workflow_run
14
+ run: echo "Trigger scheduled AMD CI via workflow_run"
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-mi210-caller.yml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD mi210 scheduled CI caller)
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["Self-hosted runner (AMD scheduled CI caller)"]
6
+ branches: ["main"]
7
+ types: [completed]
8
+ push:
9
+ branches:
10
+ - run_amd_scheduled_ci_caller*
11
+
12
+ jobs:
13
+ model-ci:
14
+ name: Model CI
15
+ uses: ./.github/workflows/self-scheduled-amd.yml
16
+ with:
17
+ job: run_models_gpu
18
+ slack_report_channel: "#transformers-ci-daily-amd"
19
+ runner: mi210
20
+ docker: huggingface/transformers-pytorch-amd-gpu
21
+ ci_event: Scheduled CI (AMD) - mi210
22
+ secrets: inherit
23
+
24
+ torch-pipeline:
25
+ name: Torch pipeline CI
26
+ uses: ./.github/workflows/self-scheduled-amd.yml
27
+ with:
28
+ job: run_pipelines_torch_gpu
29
+ slack_report_channel: "#transformers-ci-daily-amd"
30
+ runner: mi210
31
+ docker: huggingface/transformers-pytorch-amd-gpu
32
+ ci_event: Scheduled CI (AMD) - mi210
33
+ secrets: inherit
34
+
35
+ example-ci:
36
+ name: Example CI
37
+ uses: ./.github/workflows/self-scheduled-amd.yml
38
+ with:
39
+ job: run_examples_gpu
40
+ slack_report_channel: "#transformers-ci-daily-amd"
41
+ runner: mi210
42
+ docker: huggingface/transformers-pytorch-amd-gpu
43
+ ci_event: Scheduled CI (AMD) - mi210
44
+ secrets: inherit
45
+
46
+ deepspeed-ci:
47
+ name: DeepSpeed CI
48
+ uses: ./.github/workflows/self-scheduled-amd.yml
49
+ with:
50
+ job: run_torch_cuda_extensions_gpu
51
+ slack_report_channel: "#transformers-ci-daily-amd"
52
+ runner: mi210
53
+ docker: huggingface/transformers-pytorch-deepspeed-amd-gpu
54
+ ci_event: Scheduled CI (AMD) - mi210
55
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd-mi250-caller.yml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (AMD mi250 scheduled CI caller)
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: ["Self-hosted runner (AMD scheduled CI caller)"]
6
+ branches: ["main"]
7
+ types: [completed]
8
+ push:
9
+ branches:
10
+ - run_amd_scheduled_ci_caller*
11
+
12
+ jobs:
13
+ model-ci:
14
+ name: Model CI
15
+ uses: ./.github/workflows/self-scheduled-amd.yml
16
+ with:
17
+ job: run_models_gpu
18
+ slack_report_channel: "#transformers-ci-daily-amd"
19
+ runner: mi250
20
+ docker: huggingface/transformers-pytorch-amd-gpu
21
+ ci_event: Scheduled CI (AMD) - mi250
22
+ secrets: inherit
23
+
24
+ torch-pipeline:
25
+ name: Torch pipeline CI
26
+ uses: ./.github/workflows/self-scheduled-amd.yml
27
+ with:
28
+ job: run_pipelines_torch_gpu
29
+ slack_report_channel: "#transformers-ci-daily-amd"
30
+ runner: mi250
31
+ docker: huggingface/transformers-pytorch-amd-gpu
32
+ ci_event: Scheduled CI (AMD) - mi250
33
+ secrets: inherit
34
+
35
+ example-ci:
36
+ name: Example CI
37
+ uses: ./.github/workflows/self-scheduled-amd.yml
38
+ with:
39
+ job: run_examples_gpu
40
+ slack_report_channel: "#transformers-ci-daily-amd"
41
+ runner: mi250
42
+ docker: huggingface/transformers-pytorch-amd-gpu
43
+ ci_event: Scheduled CI (AMD) - mi250
44
+ secrets: inherit
45
+
46
+ deepspeed-ci:
47
+ name: DeepSpeed CI
48
+ uses: ./.github/workflows/self-scheduled-amd.yml
49
+ with:
50
+ job: run_torch_cuda_extensions_gpu
51
+ slack_report_channel: "#transformers-ci-daily-amd"
52
+ runner: mi250
53
+ docker: huggingface/transformers-pytorch-deepspeed-amd-gpu
54
+ ci_event: Scheduled CI (AMD) - mi250
55
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-amd.yml ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (scheduled-amd)
2
+
3
+ # Note: For the AMD CI, we rely on a caller workflow and on the workflow_call event to trigger the
4
+ # CI in order to run it on both MI210 and MI250, without having to use matrix here which pushes
5
+ # us towards the limit of allowed jobs on GitHub Actions.
6
+
7
+ on:
8
+ workflow_call:
9
+ inputs:
10
+ job:
11
+ required: true
12
+ type: string
13
+ slack_report_channel:
14
+ required: true
15
+ type: string
16
+ runner:
17
+ required: true
18
+ type: string
19
+ docker:
20
+ required: true
21
+ type: string
22
+ ci_event:
23
+ required: true
24
+ type: string
25
+
26
+ env:
27
+ HF_HOME: /mnt/cache
28
+ TRANSFORMERS_IS_CI: yes
29
+ OMP_NUM_THREADS: 8
30
+ MKL_NUM_THREADS: 8
31
+ RUN_SLOW: yes
32
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
33
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
34
+ NUM_SLICES: 2
35
+
36
+ # Important note: each job (run_tests_single_gpu, run_tests_multi_gpu, run_examples_gpu, run_pipelines_torch_gpu) requires all the previous jobs before running.
37
+ # This is done so that we avoid parallelizing the scheduled tests, to leave available
38
+ # runners for the push CI that is running on the same machine.
39
+ jobs:
40
+ check_runner_status:
41
+ name: Check Runner Status
42
+ runs-on: ubuntu-22.04
43
+ steps:
44
+ - name: Checkout transformers
45
+ uses: actions/checkout@v4
46
+ with:
47
+ fetch-depth: 2
48
+
49
+ - name: Check Runner Status
50
+ run: python utils/check_self_hosted_runner.py --target_runners hf-amd-mi210-ci-1gpu-1,hf-amd-mi250-ci-1gpu-1,hf-amd-mi300-ci-1gpu-1 --token ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
51
+
52
+ check_runners:
53
+ name: Check Runners
54
+ needs: check_runner_status
55
+ strategy:
56
+ matrix:
57
+ machine_type: [single-gpu, multi-gpu]
58
+ runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
59
+ container:
60
+ image: huggingface/transformers-pytorch-amd-gpu
61
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
62
+ steps:
63
+ - name: ROCM-SMI
64
+ run: |
65
+ rocm-smi
66
+
67
+ - name: ROCM-INFO
68
+ run: |
69
+ rocminfo | grep "Agent" -A 14
70
+
71
+ - name: Show ROCR environment
72
+ run: |
73
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
74
+
75
+ setup:
76
+ if: contains(fromJSON('["run_models_gpu"]'), inputs.job)
77
+ name: Setup
78
+ needs: check_runners
79
+ strategy:
80
+ matrix:
81
+ machine_type: [single-gpu, multi-gpu]
82
+ runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
83
+ container:
84
+ image: huggingface/transformers-pytorch-amd-gpu
85
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
86
+ outputs:
87
+ folder_slices: ${{ steps.set-matrix.outputs.folder_slices }}
88
+ slice_ids: ${{ steps.set-matrix.outputs.slice_ids }}
89
+ steps:
90
+ - name: Update clone
91
+ working-directory: /transformers
92
+ run: |
93
+ git fetch && git checkout ${{ github.sha }}
94
+
95
+ - name: Cleanup
96
+ working-directory: /transformers
97
+ run: |
98
+ rm -rf tests/__pycache__
99
+ rm -rf tests/models/__pycache__
100
+ rm -rf reports
101
+
102
+ - name: Show installed libraries and their versions
103
+ working-directory: /transformers
104
+ run: pip freeze
105
+
106
+ - id: set-matrix
107
+ name: Identify models to test
108
+ working-directory: /transformers/tests
109
+ run: |
110
+ echo "folder_slices=$(python3 ../utils/split_model_tests.py --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT
111
+ echo "slice_ids=$(python3 -c 'd = list(range(${{ env.NUM_SLICES }})); print(d)')" >> $GITHUB_OUTPUT
112
+
113
+ - name: ROCM-SMI
114
+ run: |
115
+ rocm-smi
116
+
117
+ - name: ROCM-INFO
118
+ run: |
119
+ rocminfo | grep "Agent" -A 14
120
+
121
+ - name: Show ROCR environment
122
+ run: |
123
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
124
+
125
+ - name: Environment
126
+ working-directory: /transformers
127
+ run: |
128
+ python3 utils/print_env.py
129
+
130
+ run_models_gpu:
131
+ if: ${{ inputs.job == 'run_models_gpu' }}
132
+ name: Single GPU tests
133
+ needs: setup
134
+ strategy:
135
+ max-parallel: 1 # For now, not to parallelize. Can change later if it works well.
136
+ fail-fast: false
137
+ matrix:
138
+ machine_type: [single-gpu, multi-gpu]
139
+ slice_id: ${{ fromJSON(needs.setup.outputs.slice_ids) }}
140
+ uses: ./.github/workflows/model_jobs_amd.yml
141
+ with:
142
+ folder_slices: ${{ needs.setup.outputs.folder_slices }}
143
+ machine_type: ${{ matrix.machine_type }}
144
+ slice_id: ${{ matrix.slice_id }}
145
+ runner: ${{ inputs.runner }}
146
+ docker: ${{ inputs.docker }}
147
+ secrets: inherit
148
+
149
+ run_pipelines_torch_gpu:
150
+ if: ${{ inputs.job == 'run_pipelines_torch_gpu' }}
151
+ name: PyTorch pipelines
152
+ needs: check_runners
153
+ strategy:
154
+ fail-fast: false
155
+ matrix:
156
+ machine_type: [single-gpu, multi-gpu]
157
+ runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
158
+ container:
159
+ image: ${{ inputs.docker }}
160
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
161
+ steps:
162
+ - name: Update clone
163
+ working-directory: /transformers
164
+ run: git fetch && git checkout ${{ github.sha }}
165
+
166
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
167
+ working-directory: /transformers
168
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
169
+
170
+ - name: ROCM-SMI
171
+ run: |
172
+ rocm-smi
173
+
174
+ - name: ROCM-INFO
175
+ run: |
176
+ rocminfo | grep "Agent" -A 14
177
+
178
+ - name: Show ROCR environment
179
+ run: |
180
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
181
+
182
+ - name: Environment
183
+ working-directory: /transformers
184
+ run: |
185
+ python3 utils/print_env.py
186
+
187
+ - name: Show installed libraries and their versions
188
+ working-directory: /transformers
189
+ run: pip freeze
190
+
191
+ - name: Run all pipeline tests on GPU
192
+ working-directory: /transformers
193
+ run: |
194
+ python3 -m pytest -n 1 -v --dist=loadfile --make-reports=${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports tests/pipelines -m "not not_device_test"
195
+
196
+ - name: Failure short reports
197
+ if: ${{ failure() }}
198
+ continue-on-error: true
199
+ run: cat /transformers/reports/${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports/failures_short.txt
200
+
201
+ - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports"
202
+ if: ${{ always() }}
203
+ uses: actions/upload-artifact@v4
204
+ with:
205
+ name: ${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports
206
+ path: /transformers/reports/${{ matrix.machine_type }}_run_pipelines_torch_gpu_test_reports
207
+
208
+ run_examples_gpu:
209
+ if: ${{ inputs.job == 'run_examples_gpu' }}
210
+ name: Examples directory
211
+ needs: check_runners
212
+ strategy:
213
+ fail-fast: false
214
+ matrix:
215
+ machine_type: [single-gpu]
216
+ runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
217
+ container:
218
+ image: ${{ inputs.docker }}
219
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
220
+ steps:
221
+ - name: Update clone
222
+ working-directory: /transformers
223
+ run: git fetch && git checkout ${{ github.sha }}
224
+
225
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
226
+ working-directory: /transformers
227
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
228
+
229
+ - name: ROCM-SMI
230
+ run: |
231
+ rocm-smi
232
+
233
+ - name: ROCM-INFO
234
+ run: |
235
+ rocminfo | grep "Agent" -A 14
236
+
237
+ - name: Show ROCR environment
238
+ run: |
239
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
240
+
241
+ - name: Environment
242
+ working-directory: /transformers
243
+ run: |
244
+ python3 utils/print_env.py
245
+
246
+ - name: Show installed libraries and their versions
247
+ working-directory: /transformers
248
+ run: pip freeze
249
+
250
+ - name: Run examples tests on GPU
251
+ working-directory: /transformers
252
+ run: |
253
+ pip install -r examples/pytorch/_tests_requirements.txt
254
+ python3 -m pytest -v --make-reports=${{ matrix.machine_type }}_run_examples_gpu_test_reports examples/pytorch -m "not not_device_test"
255
+
256
+ - name: Failure short reports
257
+ if: ${{ failure() }}
258
+ continue-on-error: true
259
+ run: cat /transformers/reports/${{ matrix.machine_type }}_run_examples_gpu_test_reports/failures_short.txt
260
+
261
+ - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_examples_gpu_test_reports"
262
+ if: ${{ always() }}
263
+ uses: actions/upload-artifact@v4
264
+ with:
265
+ name: ${{ matrix.machine_type }}_run_examples_gpu_test_reports
266
+ path: /transformers/reports/${{ matrix.machine_type }}_run_examples_gpu_test_reports
267
+
268
+ run_torch_cuda_extensions_gpu:
269
+ if: ${{ inputs.job == 'run_torch_cuda_extensions_gpu' }}
270
+ name: Torch ROCm deepspeed tests
271
+ needs: check_runners
272
+ strategy:
273
+ fail-fast: false
274
+ matrix:
275
+ machine_type: [single-gpu, multi-gpu]
276
+ runs-on: ['${{ matrix.machine_type }}', self-hosted, amd-gpu, '${{ inputs.runner }}']
277
+ container:
278
+ image: ${{ inputs.docker }}
279
+ options: --device /dev/kfd --device /dev/dri --env ROCR_VISIBLE_DEVICES --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
280
+ steps:
281
+ - name: Update clone
282
+ working-directory: /transformers
283
+ run: git fetch && git checkout ${{ github.sha }}
284
+
285
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
286
+ working-directory: /transformers
287
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
288
+
289
+ - name: ROCM-SMI
290
+ run: |
291
+ rocm-smi
292
+
293
+ - name: ROCM-INFO
294
+ run: |
295
+ rocminfo | grep "Agent" -A 14
296
+
297
+ - name: Show ROCR environment
298
+ run: |
299
+ echo "ROCR: $ROCR_VISIBLE_DEVICES"
300
+
301
+ - name: Environment
302
+ working-directory: /transformers
303
+ run: |
304
+ python3 utils/print_env.py
305
+
306
+ - name: Show installed libraries and their versions
307
+ working-directory: /transformers
308
+ run: pip freeze
309
+
310
+ - name: Run all tests on GPU
311
+ working-directory: /transformers
312
+ run: python3 -m pytest -v --make-reports=${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports tests/deepspeed tests/extended -m "not not_device_test"
313
+
314
+ - name: Failure short reports
315
+ if: ${{ failure() }}
316
+ continue-on-error: true
317
+ run: cat /transformers/reports/${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports/failures_short.txt
318
+
319
+ - name: "Test suite reports artifacts: ${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports"
320
+ if: ${{ always() }}
321
+ uses: actions/upload-artifact@v4
322
+ with:
323
+ name: ${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
324
+ path: /transformers/reports/${{ matrix.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
325
+
326
+ send_results:
327
+ name: Slack Report
328
+ needs: [
329
+ check_runner_status,
330
+ check_runners,
331
+ setup,
332
+ run_models_gpu,
333
+ run_pipelines_torch_gpu,
334
+ run_examples_gpu,
335
+ run_torch_cuda_extensions_gpu
336
+ ]
337
+ if: ${{ always() }}
338
+ uses: ./.github/workflows/slack-report.yml
339
+ with:
340
+ job: ${{ inputs.job }}
341
+ # This would be `skipped` if `setup` is skipped.
342
+ setup_status: ${{ needs.setup.result }}
343
+ slack_report_channel: ${{ inputs.slack_report_channel }}
344
+ # This would be an empty string if `setup` is skipped.
345
+ folder_slices: ${{ needs.setup.outputs.folder_slices }}
346
+ quantization_matrix: ${{ needs.setup.outputs.quantization_matrix }}
347
+ ci_event: ${{ inputs.ci_event }}
348
+
349
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled-caller.yml ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (scheduled)
2
+
3
+
4
+ on:
5
+ repository_dispatch:
6
+ schedule:
7
+ - cron: "17 2 * * *"
8
+ push:
9
+ branches:
10
+ - run_scheduled_ci*
11
+
12
+ jobs:
13
+ model-ci:
14
+ name: Model CI
15
+ uses: ./.github/workflows/self-scheduled.yml
16
+ with:
17
+ job: run_models_gpu
18
+ slack_report_channel: "#transformers-ci-daily-models"
19
+ runner: daily-ci
20
+ docker: huggingface/transformers-all-latest-gpu
21
+ ci_event: Daily CI
22
+ secrets: inherit
23
+
24
+ torch-pipeline:
25
+ name: Torch pipeline CI
26
+ uses: ./.github/workflows/self-scheduled.yml
27
+ with:
28
+ job: run_pipelines_torch_gpu
29
+ slack_report_channel: "#transformers-ci-daily-pipeline-torch"
30
+ runner: daily-ci
31
+ docker: huggingface/transformers-pytorch-gpu
32
+ ci_event: Daily CI
33
+ secrets: inherit
34
+
35
+ tf-pipeline:
36
+ name: TF pipeline CI
37
+ uses: ./.github/workflows/self-scheduled.yml
38
+ with:
39
+ job: run_pipelines_tf_gpu
40
+ slack_report_channel: "#transformers-ci-daily-pipeline-tf"
41
+ runner: daily-ci
42
+ docker: huggingface/transformers-tensorflow-gpu
43
+ ci_event: Daily CI
44
+ secrets: inherit
45
+
46
+ example-ci:
47
+ name: Example CI
48
+ uses: ./.github/workflows/self-scheduled.yml
49
+ with:
50
+ job: run_examples_gpu
51
+ slack_report_channel: "#transformers-ci-daily-examples"
52
+ runner: daily-ci
53
+ docker: huggingface/transformers-all-latest-gpu
54
+ ci_event: Daily CI
55
+ secrets: inherit
56
+
57
+ deepspeed-ci:
58
+ name: DeepSpeed CI
59
+ uses: ./.github/workflows/self-scheduled.yml
60
+ with:
61
+ job: run_torch_cuda_extensions_gpu
62
+ slack_report_channel: "#transformers-ci-daily-deepspeed"
63
+ runner: daily-ci
64
+ docker: huggingface/transformers-pytorch-deepspeed-latest-gpu
65
+ ci_event: Daily CI
66
+ working-directory-prefix: /workspace
67
+ secrets: inherit
68
+
69
+ quantization-ci:
70
+ name: Quantization CI
71
+ uses: ./.github/workflows/self-scheduled.yml
72
+ with:
73
+ job: run_quantization_torch_gpu
74
+ slack_report_channel: "#transformers-ci-daily-quantization"
75
+ runner: daily-ci
76
+ docker: huggingface/transformers-quantization-latest-gpu
77
+ ci_event: Daily CI
78
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/self-scheduled.yml ADDED
@@ -0,0 +1,574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Self-hosted runner (scheduled)
2
+
3
+ # Note that each job's dependencies go into a corresponding docker file.
4
+ #
5
+ # For example for `run_torch_cuda_extensions_gpu` the docker image is
6
+ # `huggingface/transformers-pytorch-deepspeed-latest-gpu`, which can be found at
7
+ # `docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile`
8
+
9
+ on:
10
+ workflow_call:
11
+ inputs:
12
+ job:
13
+ required: true
14
+ type: string
15
+ slack_report_channel:
16
+ required: true
17
+ type: string
18
+ runner:
19
+ required: true
20
+ type: string
21
+ docker:
22
+ required: true
23
+ type: string
24
+ ci_event:
25
+ required: true
26
+ type: string
27
+ working-directory-prefix:
28
+ default: ''
29
+ required: false
30
+ type: string
31
+
32
+ env:
33
+ HF_HOME: /mnt/cache
34
+ TRANSFORMERS_IS_CI: yes
35
+ OMP_NUM_THREADS: 8
36
+ MKL_NUM_THREADS: 8
37
+ RUN_SLOW: yes
38
+ # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access.
39
+ # This token is created under the bot `hf-transformers-bot`.
40
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
41
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
42
+ TF_FORCE_GPU_ALLOW_GROWTH: true
43
+ RUN_PT_TF_CROSS_TESTS: 1
44
+ CUDA_VISIBLE_DEVICES: 0,1
45
+ NUM_SLICES: 2
46
+
47
+ jobs:
48
+ setup:
49
+ if: contains(fromJSON('["run_models_gpu", "run_quantization_torch_gpu"]'), inputs.job)
50
+ name: Setup
51
+ strategy:
52
+ matrix:
53
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
54
+ runs-on:
55
+ group: '${{ matrix.machine_type }}'
56
+ container:
57
+ image: huggingface/transformers-all-latest-gpu
58
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
59
+ outputs:
60
+ folder_slices: ${{ steps.set-matrix.outputs.folder_slices }}
61
+ slice_ids: ${{ steps.set-matrix.outputs.slice_ids }}
62
+ quantization_matrix: ${{ steps.set-matrix-quantization.outputs.quantization_matrix }}
63
+ steps:
64
+ - name: Update clone
65
+ working-directory: /transformers
66
+ run: |
67
+ git fetch && git checkout ${{ github.sha }}
68
+
69
+ - name: Cleanup
70
+ working-directory: /transformers
71
+ run: |
72
+ rm -rf tests/__pycache__
73
+ rm -rf tests/models/__pycache__
74
+ rm -rf reports
75
+
76
+ - name: Show installed libraries and their versions
77
+ working-directory: /transformers
78
+ run: pip freeze
79
+
80
+ - id: set-matrix
81
+ if: ${{ inputs.job == 'run_models_gpu' }}
82
+ name: Identify models to test
83
+ working-directory: /transformers/tests
84
+ run: |
85
+ echo "folder_slices=$(python3 ../utils/split_model_tests.py --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT
86
+ echo "slice_ids=$(python3 -c 'd = list(range(${{ env.NUM_SLICES }})); print(d)')" >> $GITHUB_OUTPUT
87
+
88
+ - id: set-matrix-quantization
89
+ if: ${{ inputs.job == 'run_quantization_torch_gpu' }}
90
+ name: Identify quantization method to test
91
+ working-directory: /transformers/tests
92
+ run: |
93
+ echo "quantization_matrix=$(python3 -c 'import os; tests = os.getcwd(); quantization_tests = os.listdir(os.path.join(tests, "quantization")); d = sorted(list(filter(os.path.isdir, [f"quantization/{x}" for x in quantization_tests]))) ; print(d)')" >> $GITHUB_OUTPUT
94
+
95
+ - name: NVIDIA-SMI
96
+ run: |
97
+ nvidia-smi
98
+
99
+ run_models_gpu:
100
+ if: ${{ inputs.job == 'run_models_gpu' }}
101
+ name: " "
102
+ needs: setup
103
+ strategy:
104
+ fail-fast: false
105
+ matrix:
106
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
107
+ slice_id: ${{ fromJSON(needs.setup.outputs.slice_ids) }}
108
+ uses: ./.github/workflows/model_jobs.yml
109
+ with:
110
+ folder_slices: ${{ needs.setup.outputs.folder_slices }}
111
+ machine_type: ${{ matrix.machine_type }}
112
+ slice_id: ${{ matrix.slice_id }}
113
+ runner: ${{ inputs.runner }}
114
+ docker: ${{ inputs.docker }}
115
+ secrets: inherit
116
+
117
+ run_pipelines_torch_gpu:
118
+ if: ${{ inputs.job == 'run_pipelines_torch_gpu' }}
119
+ name: PyTorch pipelines
120
+ strategy:
121
+ fail-fast: false
122
+ matrix:
123
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
124
+ runs-on:
125
+ group: '${{ matrix.machine_type }}'
126
+ container:
127
+ image: huggingface/transformers-pytorch-gpu
128
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
129
+ steps:
130
+ - name: Update clone
131
+ working-directory: /transformers
132
+ run: git fetch && git checkout ${{ github.sha }}
133
+
134
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
135
+ working-directory: /transformers
136
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
137
+
138
+ - name: NVIDIA-SMI
139
+ run: |
140
+ nvidia-smi
141
+
142
+ - name: Environment
143
+ working-directory: /transformers
144
+ run: |
145
+ python3 utils/print_env.py
146
+
147
+ - name: Show installed libraries and their versions
148
+ working-directory: /transformers
149
+ run: pip freeze
150
+
151
+ - name: Set `machine_type` for report and artifact names
152
+ working-directory: /transformers
153
+ shell: bash
154
+ run: |
155
+ echo "${{ matrix.machine_type }}"
156
+
157
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
158
+ machine_type=single-gpu
159
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
160
+ machine_type=multi-gpu
161
+ else
162
+ machine_type=${{ matrix.machine_type }}
163
+ fi
164
+
165
+ echo "$machine_type"
166
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
167
+
168
+ - name: Run all pipeline tests on GPU
169
+ working-directory: /transformers
170
+ run: |
171
+ python3 -m pytest -n 1 -v --dist=loadfile --make-reports=${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports tests/pipelines
172
+
173
+ - name: Failure short reports
174
+ if: ${{ failure() }}
175
+ continue-on-error: true
176
+ run: cat /transformers/reports/${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports/failures_short.txt
177
+
178
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports"
179
+ if: ${{ always() }}
180
+ uses: actions/upload-artifact@v4
181
+ with:
182
+ name: ${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports
183
+ path: /transformers/reports/${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports
184
+
185
+ run_pipelines_tf_gpu:
186
+ if: ${{ inputs.job == 'run_pipelines_tf_gpu' }}
187
+ name: TensorFlow pipelines
188
+ strategy:
189
+ fail-fast: false
190
+ matrix:
191
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
192
+ runs-on:
193
+ group: '${{ matrix.machine_type }}'
194
+ container:
195
+ image: huggingface/transformers-tensorflow-gpu
196
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
197
+ steps:
198
+ - name: Update clone
199
+ working-directory: /transformers
200
+ run: |
201
+ git fetch && git checkout ${{ github.sha }}
202
+
203
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
204
+ working-directory: /transformers
205
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
206
+
207
+ - name: NVIDIA-SMI
208
+ run: |
209
+ nvidia-smi
210
+
211
+ - name: Environment
212
+ working-directory: /transformers
213
+ run: |
214
+ python3 utils/print_env.py
215
+
216
+ - name: Show installed libraries and their versions
217
+ working-directory: /transformers
218
+ run: pip freeze
219
+
220
+ - name: Set `machine_type` for report and artifact names
221
+ working-directory: /transformers
222
+ shell: bash
223
+ run: |
224
+ echo "${{ matrix.machine_type }}"
225
+
226
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
227
+ machine_type=single-gpu
228
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
229
+ machine_type=multi-gpu
230
+ else
231
+ machine_type=${{ matrix.machine_type }}
232
+ fi
233
+
234
+ echo "$machine_type"
235
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
236
+
237
+ - name: Run all pipeline tests on GPU
238
+ working-directory: /transformers
239
+ run: |
240
+ python3 -m pytest -n 1 -v --dist=loadfile --make-reports=${{ env.machine_type }}_run_pipelines_tf_gpu_test_reports tests/pipelines
241
+
242
+ - name: Failure short reports
243
+ if: ${{ always() }}
244
+ run: |
245
+ cat /transformers/reports/${{ env.machine_type }}_run_pipelines_tf_gpu_test_reports/failures_short.txt
246
+
247
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_pipelines_tf_gpu_test_reports"
248
+ if: ${{ always() }}
249
+ uses: actions/upload-artifact@v4
250
+ with:
251
+ name: ${{ env.machine_type }}_run_pipelines_tf_gpu_test_reports
252
+ path: /transformers/reports/${{ env.machine_type }}_run_pipelines_tf_gpu_test_reports
253
+
254
+ run_examples_gpu:
255
+ if: ${{ inputs.job == 'run_examples_gpu' }}
256
+ name: Examples directory
257
+ strategy:
258
+ fail-fast: false
259
+ matrix:
260
+ machine_type: [aws-g4dn-2xlarge-cache]
261
+ runs-on:
262
+ group: '${{ matrix.machine_type }}'
263
+ container:
264
+ image: huggingface/transformers-all-latest-gpu
265
+ options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
266
+ steps:
267
+ - name: Update clone
268
+ working-directory: /transformers
269
+ run: git fetch && git checkout ${{ github.sha }}
270
+
271
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
272
+ working-directory: /transformers
273
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
274
+
275
+ - name: NVIDIA-SMI
276
+ run: |
277
+ nvidia-smi
278
+
279
+ - name: Environment
280
+ working-directory: /transformers
281
+ run: |
282
+ python3 utils/print_env.py
283
+
284
+ - name: Show installed libraries and their versions
285
+ working-directory: /transformers
286
+ run: pip freeze
287
+
288
+ - name: Set `machine_type` for report and artifact names
289
+ working-directory: /transformers
290
+ shell: bash
291
+ run: |
292
+ echo "${{ matrix.machine_type }}"
293
+
294
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
295
+ machine_type=single-gpu
296
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
297
+ machine_type=multi-gpu
298
+ else
299
+ machine_type=${{ matrix.machine_type }}
300
+ fi
301
+
302
+ echo "$machine_type"
303
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
304
+
305
+ - name: Run examples tests on GPU
306
+ working-directory: /transformers
307
+ run: |
308
+ pip install -r examples/pytorch/_tests_requirements.txt
309
+ python3 -m pytest -v --make-reports=${{ env.machine_type }}_run_examples_gpu_test_reports examples/pytorch
310
+
311
+ - name: Failure short reports
312
+ if: ${{ failure() }}
313
+ continue-on-error: true
314
+ run: cat /transformers/reports/${{ env.machine_type }}_run_examples_gpu_test_reports/failures_short.txt
315
+
316
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_examples_gpu_test_reports"
317
+ if: ${{ always() }}
318
+ uses: actions/upload-artifact@v4
319
+ with:
320
+ name: ${{ env.machine_type }}_run_examples_gpu_test_reports
321
+ path: /transformers/reports/${{ env.machine_type }}_run_examples_gpu_test_reports
322
+
323
+ run_torch_cuda_extensions_gpu:
324
+ if: ${{ inputs.job == 'run_torch_cuda_extensions_gpu' }}
325
+ name: Torch CUDA extension tests
326
+ strategy:
327
+ fail-fast: false
328
+ matrix:
329
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
330
+ runs-on:
331
+ group: '${{ matrix.machine_type }}'
332
+ container:
333
+ image: ${{ inputs.docker }}
334
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
335
+ steps:
336
+ - name: Update clone
337
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
338
+ run: git fetch && git checkout ${{ github.sha }}
339
+
340
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
341
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
342
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
343
+
344
+ - name: Update / Install some packages (for Past CI)
345
+ if: ${{ contains(inputs.docker, '-past-') && contains(inputs.docker, '-pytorch-') }}
346
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
347
+ run: |
348
+ python3 -m pip install -U datasets
349
+ python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
350
+
351
+ - name: Remove cached torch extensions
352
+ run: rm -rf /github/home/.cache/torch_extensions/
353
+
354
+ # To avoid unknown test failures
355
+ - name: Pre build DeepSpeed *again* (for daily CI)
356
+ if: ${{ contains(inputs.ci_event, 'Daily CI') }}
357
+ working-directory: ${{ inputs.working-directory-prefix }}/
358
+ run: |
359
+ python3 -m pip uninstall -y deepspeed
360
+ DS_DISABLE_NINJA=1 DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 python3 -m pip install deepspeed --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check
361
+
362
+ # To avoid unknown test failures
363
+ - name: Pre build DeepSpeed *again* (for nightly & Past CI)
364
+ if: ${{ contains(inputs.ci_event, 'Nightly CI') || contains(inputs.ci_event, 'Past CI') }}
365
+ working-directory: ${{ inputs.working-directory-prefix }}/
366
+ run: |
367
+ python3 -m pip uninstall -y deepspeed
368
+ rm -rf DeepSpeed
369
+ git clone https://github.com/microsoft/DeepSpeed && cd DeepSpeed && rm -rf build
370
+ DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 python3 -m pip install . --global-option="build_ext" --global-option="-j8" --no-cache -v --disable-pip-version-check
371
+
372
+ - name: NVIDIA-SMI
373
+ run: |
374
+ nvidia-smi
375
+
376
+ - name: Environment
377
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
378
+ run: |
379
+ python3 utils/print_env.py
380
+
381
+ - name: Show installed libraries and their versions
382
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
383
+ run: pip freeze
384
+
385
+ - name: Set `machine_type` for report and artifact names
386
+ working-directory: /transformers
387
+ shell: bash
388
+ run: |
389
+ echo "${{ matrix.machine_type }}"
390
+
391
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
392
+ machine_type=single-gpu
393
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
394
+ machine_type=multi-gpu
395
+ else
396
+ machine_type=${{ matrix.machine_type }}
397
+ fi
398
+
399
+ echo "$machine_type"
400
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
401
+
402
+ - name: Run all tests on GPU
403
+ working-directory: ${{ inputs.working-directory-prefix }}/transformers
404
+ run: |
405
+ python3 -m pytest -v --make-reports=${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports tests/deepspeed tests/extended
406
+
407
+ - name: Failure short reports
408
+ if: ${{ failure() }}
409
+ continue-on-error: true
410
+ run: cat ${{ inputs.working-directory-prefix }}/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports/failures_short.txt
411
+
412
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports"
413
+ if: ${{ always() }}
414
+ uses: actions/upload-artifact@v4
415
+ with:
416
+ name: ${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
417
+ path: ${{ inputs.working-directory-prefix }}/transformers/reports/${{ env.machine_type }}_run_torch_cuda_extensions_gpu_test_reports
418
+
419
+ run_quantization_torch_gpu:
420
+ if: ${{ inputs.job == 'run_quantization_torch_gpu' }}
421
+ name: " "
422
+ needs: setup
423
+ strategy:
424
+ max-parallel: 4
425
+ fail-fast: false
426
+ matrix:
427
+ folders: ${{ fromJson(needs.setup.outputs.quantization_matrix) }}
428
+ machine_type: [aws-g4dn-2xlarge-cache, aws-g4dn-12xlarge-cache]
429
+ runs-on:
430
+ group: '${{ matrix.machine_type }}'
431
+ container:
432
+ image: huggingface/transformers-quantization-latest-gpu
433
+ options: --gpus all --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
434
+ steps:
435
+ - name: Echo folder ${{ matrix.folders }}
436
+ shell: bash
437
+ run: |
438
+ echo "${{ matrix.folders }}"
439
+ matrix_folders=${{ matrix.folders }}
440
+ matrix_folders=${matrix_folders/'quantization/'/'quantization_'}
441
+ echo "$matrix_folders"
442
+ echo "matrix_folders=$matrix_folders" >> $GITHUB_ENV
443
+
444
+ - name: Update clone
445
+ working-directory: /transformers
446
+ run: git fetch && git checkout ${{ github.sha }}
447
+
448
+ - name: Reinstall transformers in edit mode (remove the one installed during docker image build)
449
+ working-directory: /transformers
450
+ run: python3 -m pip uninstall -y transformers && python3 -m pip install -e .
451
+
452
+ - name: NVIDIA-SMI
453
+ run: |
454
+ nvidia-smi
455
+
456
+ - name: Environment
457
+ working-directory: /transformers
458
+ run: |
459
+ python3 utils/print_env.py
460
+
461
+ - name: Show installed libraries and their versions
462
+ working-directory: /transformers
463
+ run: pip freeze
464
+
465
+ - name: Set `machine_type` for report and artifact names
466
+ working-directory: /transformers
467
+ shell: bash
468
+ run: |
469
+ echo "${{ matrix.machine_type }}"
470
+
471
+ if [ "${{ matrix.machine_type }}" = "aws-g4dn-2xlarge-cache" ]; then
472
+ machine_type=single-gpu
473
+ elif [ "${{ matrix.machine_type }}" = "aws-g4dn-12xlarge-cache" ]; then
474
+ machine_type=multi-gpu
475
+ else
476
+ machine_type=${{ matrix.machine_type }}
477
+ fi
478
+
479
+ echo "$machine_type"
480
+ echo "machine_type=$machine_type" >> $GITHUB_ENV
481
+
482
+ - name: Run quantization tests on GPU
483
+ working-directory: /transformers
484
+ run: |
485
+ python3 -m pytest -v --make-reports=${{ env.machine_type }}_run_quantization_torch_gpu_${{ matrix.folders }}_test_reports tests/${{ matrix.folders }}
486
+
487
+ - name: Failure short reports
488
+ if: ${{ failure() }}
489
+ continue-on-error: true
490
+ run: cat /transformers/reports/${{ env.machine_type }}_run_quantization_torch_gpu_${{ matrix.folders }}_test_reports/failures_short.txt
491
+
492
+ - name: "Test suite reports artifacts: ${{ env.machine_type }}_run_quantization_torch_gpu_${{ env.matrix_folders }}_test_reports"
493
+ if: ${{ always() }}
494
+ uses: actions/upload-artifact@v4
495
+ with:
496
+ name: ${{ env.machine_type }}_run_quantization_torch_gpu_${{ env.matrix_folders }}_test_reports
497
+ path: /transformers/reports/${{ env.machine_type }}_run_quantization_torch_gpu_${{ matrix.folders }}_test_reports
498
+
499
+ run_extract_warnings:
500
+ # Let's only do this for the job `run_models_gpu` to simplify the (already complex) logic.
501
+ if: ${{ always() && inputs.job == 'run_models_gpu' }}
502
+ name: Extract warnings in CI artifacts
503
+ runs-on: ubuntu-22.04
504
+ needs: [setup, run_models_gpu]
505
+ steps:
506
+ - name: Checkout transformers
507
+ uses: actions/checkout@v4
508
+ with:
509
+ fetch-depth: 2
510
+
511
+ - name: Install transformers
512
+ run: pip install transformers
513
+
514
+ - name: Show installed libraries and their versions
515
+ run: pip freeze
516
+
517
+ - name: Create output directory
518
+ run: mkdir warnings_in_ci
519
+
520
+ - uses: actions/download-artifact@v4
521
+ with:
522
+ path: warnings_in_ci
523
+
524
+ - name: Show artifacts
525
+ run: echo "$(python3 -c 'import os; d = os.listdir(); print(d)')"
526
+ working-directory: warnings_in_ci
527
+
528
+ - name: Extract warnings in CI artifacts
529
+ run: |
530
+ python3 utils/extract_warnings.py --workflow_run_id ${{ github.run_id }} --output_dir warnings_in_ci --token ${{ secrets.ACCESS_REPO_INFO_TOKEN }} --from_gh
531
+ echo "$(python3 -c 'import os; import json; fp = open("warnings_in_ci/selected_warnings.json"); d = json.load(fp); d = "\n".join(d) ;print(d)')"
532
+
533
+ - name: Upload artifact
534
+ if: ${{ always() }}
535
+ uses: actions/upload-artifact@v4
536
+ with:
537
+ name: warnings_in_ci
538
+ path: warnings_in_ci/selected_warnings.json
539
+
540
+ send_results:
541
+ name: Slack Report
542
+ needs: [
543
+ setup,
544
+ run_models_gpu,
545
+ run_pipelines_torch_gpu,
546
+ run_pipelines_tf_gpu,
547
+ run_examples_gpu,
548
+ run_torch_cuda_extensions_gpu,
549
+ run_quantization_torch_gpu,
550
+ run_extract_warnings
551
+ ]
552
+ if: ${{ always() }}
553
+ uses: ./.github/workflows/slack-report.yml
554
+ with:
555
+ job: ${{ inputs.job }}
556
+ # This would be `skipped` if `setup` is skipped.
557
+ setup_status: ${{ needs.setup.result }}
558
+ slack_report_channel: ${{ inputs.slack_report_channel }}
559
+ # This would be an empty string if `setup` is skipped.
560
+ folder_slices: ${{ needs.setup.outputs.folder_slices }}
561
+ quantization_matrix: ${{ needs.setup.outputs.quantization_matrix }}
562
+ ci_event: ${{ inputs.ci_event }}
563
+
564
+ secrets: inherit
565
+
566
+ check_new_model_failures:
567
+ if: ${{ always() && inputs.ci_event == 'Daily CI' && inputs.job == 'run_models_gpu' && needs.send_results.result == 'success' }}
568
+ name: Check new model failures
569
+ needs: send_results
570
+ uses: ./.github/workflows/check_failed_model_tests.yml
571
+ with:
572
+ docker: ${{ inputs.docker }}
573
+ start_sha: ${{ github.sha }}
574
+ secrets: inherit
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/slack-report.yml ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI slack report
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ job:
7
+ required: true
8
+ type: string
9
+ slack_report_channel:
10
+ required: true
11
+ type: string
12
+ setup_status:
13
+ required: true
14
+ type: string
15
+ folder_slices:
16
+ required: true
17
+ type: string
18
+ quantization_matrix:
19
+ required: true
20
+ type: string
21
+ ci_event:
22
+ required: true
23
+ type: string
24
+
25
+ env:
26
+ TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN: ${{ secrets.TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN }}
27
+
28
+ jobs:
29
+ send_results:
30
+ name: Send results to webhook
31
+ runs-on: ubuntu-22.04
32
+ if: always()
33
+ steps:
34
+ - name: Preliminary job status
35
+ shell: bash
36
+ # For the meaning of these environment variables, see the job `Setup`
37
+ run: |
38
+ echo "Setup status: ${{ inputs.setup_status }}"
39
+
40
+ - uses: actions/checkout@v4
41
+ - uses: actions/download-artifact@v4
42
+ - name: Send message to Slack
43
+ if: ${{ inputs.job != 'run_quantization_torch_gpu' }}
44
+ env:
45
+ CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
46
+ CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }}
47
+ CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }}
48
+ CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }}
49
+ SLACK_REPORT_CHANNEL: ${{ inputs.slack_report_channel }}
50
+ ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
51
+ CI_EVENT: ${{ inputs.ci_event }}
52
+ CI_SHA: ${{ github.sha }}
53
+ CI_WORKFLOW_REF: ${{ github.workflow_ref }}
54
+ CI_TEST_JOB: ${{ inputs.job }}
55
+ SETUP_STATUS: ${{ inputs.setup_status }}
56
+ # We pass `needs.setup.outputs.matrix` as the argument. A processing in `notification_service.py` to change
57
+ # `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`.
58
+ # For a job that doesn't depend on (i.e. `needs`) `setup`, the value for `inputs.folder_slices` would be an
59
+ # empty string, and the called script still get one argument (which is the emtpy string).
60
+ run: |
61
+ sudo apt-get install -y curl
62
+ pip install huggingface_hub
63
+ pip install slack_sdk
64
+ pip show slack_sdk
65
+ python utils/notification_service.py "${{ inputs.folder_slices }}"
66
+
67
+ # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack.
68
+ - name: Failure table artifacts
69
+ uses: actions/upload-artifact@v4
70
+ with:
71
+ name: ci_results_${{ inputs.job }}
72
+ path: ci_results_${{ inputs.job }}
73
+
74
+ - uses: actions/checkout@v4
75
+ - uses: actions/download-artifact@v4
76
+ - name: Send message to Slack for quantization workflow
77
+ if: ${{ inputs.job == 'run_quantization_torch_gpu' }}
78
+ env:
79
+ CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }}
80
+ ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }}
81
+ SLACK_REPORT_CHANNEL: ${{ inputs.slack_report_channel }}
82
+ CI_EVENT: ${{ inputs.ci_event }}
83
+ CI_SHA: ${{ github.sha }}
84
+ CI_TEST_JOB: ${{ inputs.job }}
85
+ SETUP_STATUS: ${{ inputs.setup_status }}
86
+ # We pass `needs.setup.outputs.quantization_matrix` as the argument. A processing in `notification_service_quantization.py` to change
87
+ # `quantization/bnb` to `quantization_bnb` is required, as the artifact names use `_` instead of `/`.
88
+ run: |
89
+ sudo apt-get install -y curl
90
+ pip install huggingface_hub
91
+ pip install slack_sdk
92
+ pip show slack_sdk
93
+ python utils/notification_service_quantization.py "${{ inputs.quantization_matrix }}"
94
+
95
+ # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack.
96
+ - name: Failure table artifacts
97
+ if: ${{ inputs.job == 'run_quantization_torch_gpu' }}
98
+ uses: actions/upload-artifact@v4
99
+ with:
100
+ name: ci_results_${{ inputs.job }}
101
+ path: ci_results_${{ inputs.job }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/ssh-runner.yml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: SSH into our runners
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ runner_type:
7
+ description: 'Type of runner to test (a10 or t4)'
8
+ required: true
9
+ docker_image:
10
+ description: 'Name of the Docker image'
11
+ required: true
12
+ num_gpus:
13
+ description: 'Type of the number of gpus to use (`single` or `multi`)'
14
+ required: true
15
+
16
+ env:
17
+ HF_HUB_READ_TOKEN: ${{ secrets.HF_HUB_READ_TOKEN }}
18
+ HF_HOME: /mnt/cache
19
+ TRANSFORMERS_IS_CI: yes
20
+ OMP_NUM_THREADS: 8
21
+ MKL_NUM_THREADS: 8
22
+ RUN_SLOW: yes # For gated repositories, we still need to agree to share information on the Hub repo. page in order to get access. # This token is created under the bot `hf-transformers-bot`.
23
+ SIGOPT_API_TOKEN: ${{ secrets.SIGOPT_API_TOKEN }}
24
+ TF_FORCE_GPU_ALLOW_GROWTH: true
25
+ CUDA_VISIBLE_DEVICES: 0,1
26
+ RUN_PT_TF_CROSS_TESTS: 1
27
+
28
+ jobs:
29
+ get_runner:
30
+ name: "Get runner to use"
31
+ runs-on: ubuntu-22.04
32
+ outputs:
33
+ RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
34
+ steps:
35
+ - name: Get runner to use
36
+ shell: bash
37
+ run: |
38
+ if [[ "${{ github.event.inputs.num_gpus }}" == "single" && "${{ github.event.inputs.runner_type }}" == "t4" ]]; then
39
+ echo "RUNNER=aws-g4dn-2xlarge-cache" >> $GITHUB_ENV
40
+ elif [[ "${{ github.event.inputs.num_gpus }}" == "multi" && "${{ github.event.inputs.runner_type }}" == "t4" ]]; then
41
+ echo "RUNNER=aws-g4dn-12xlarge-cache" >> $GITHUB_ENV
42
+ elif [[ "${{ github.event.inputs.num_gpus }}" == "single" && "${{ github.event.inputs.runner_type }}" == "a10" ]]; then
43
+ echo "RUNNER=aws-g5-4xlarge-cache" >> $GITHUB_ENV
44
+ elif [[ "${{ github.event.inputs.num_gpus }}" == "multi" && "${{ github.event.inputs.runner_type }}" == "a10" ]]; then
45
+ echo "RUNNER=aws-g5-12xlarge-cache" >> $GITHUB_ENV
46
+ else
47
+ echo "RUNNER=" >> $GITHUB_ENV
48
+ fi
49
+
50
+ - name: Set runner to use
51
+ id: set_runner
52
+ run: |
53
+ echo ${{ env.RUNNER }}
54
+ echo "RUNNER=${{ env.RUNNER }}" >> $GITHUB_OUTPUT
55
+
56
+ ssh_runner:
57
+ name: "SSH"
58
+ needs: get_runner
59
+ runs-on:
60
+ group: ${{ needs.get_runner.outputs.RUNNER }}
61
+ container:
62
+ image: ${{ github.event.inputs.docker_image }}
63
+ options: --gpus all --privileged --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/
64
+
65
+ steps:
66
+ - name: Update clone
67
+ working-directory: /transformers
68
+ run: |
69
+ git fetch && git checkout ${{ github.sha }}
70
+
71
+ - name: Cleanup
72
+ working-directory: /transformers
73
+ run: |
74
+ rm -rf tests/__pycache__
75
+ rm -rf tests/models/__pycache__
76
+ rm -rf reports
77
+
78
+ - name: Show installed libraries and their versions
79
+ working-directory: /transformers
80
+ run: pip freeze
81
+
82
+ - name: NVIDIA-SMI
83
+ run: |
84
+ nvidia-smi
85
+
86
+ - name: Store Slack infos
87
+ #because the SSH can be enabled dynamically if the workflow failed, so we need to store slack infos to be able to retrieve them during the waitforssh step
88
+ shell: bash
89
+ run: |
90
+ echo "${{ github.actor }}"
91
+ github_actor=${{ github.actor }}
92
+ github_actor=${github_actor/'-'/'_'}
93
+ echo "$github_actor"
94
+ echo "github_actor=$github_actor" >> $GITHUB_ENV
95
+
96
+ - name: Store Slack infos
97
+ #because the SSH can be enabled dynamically if the workflow failed, so we need to store slack infos to be able to retrieve them during the waitforssh step
98
+ shell: bash
99
+ run: |
100
+ echo "${{ env.github_actor }}"
101
+ if [ "${{ secrets[format('{0}_{1}', env.github_actor, 'SLACK_ID')] }}" != "" ]; then
102
+ echo "SLACKCHANNEL=${{ secrets[format('{0}_{1}', env.github_actor, 'SLACK_ID')] }}" >> $GITHUB_ENV
103
+ else
104
+ echo "SLACKCHANNEL=${{ secrets.SLACK_CIFEEDBACK_CHANNEL }}" >> $GITHUB_ENV
105
+ fi
106
+
107
+ - name: Tailscale # In order to be able to SSH when a test fails
108
+ uses: huggingface/tailscale-action@main
109
+ with:
110
+ authkey: ${{ secrets.TAILSCALE_SSH_AUTHKEY }}
111
+ slackChannel: ${{ env.SLACKCHANNEL }}
112
+ slackToken: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }}
113
+ waitForSSH: true
114
+ sshTimeout: 15m
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/stale.yml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Stale Bot
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 8 * * *"
6
+
7
+ jobs:
8
+ close_stale_issues:
9
+ name: Close Stale Issues
10
+ if: github.repository == 'huggingface/transformers'
11
+ runs-on: ubuntu-22.04
12
+ permissions:
13
+ issues: write
14
+ env:
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Setup Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: 3.8
23
+
24
+ - name: Install requirements
25
+ run: |
26
+ pip install PyGithub
27
+ - name: Close stale issues
28
+ run: |
29
+ python scripts/stale.py
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/trufflehog.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ on:
2
+ push:
3
+
4
+ name: Secret Leaks
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ trufflehog:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+ - name: Secret Scanning
18
+ uses: trufflesecurity/trufflehog@main
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/update_metdata.yml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Update Transformers metadata
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - update_transformers_metadata*
8
+
9
+ jobs:
10
+ build_and_package:
11
+ runs-on: ubuntu-22.04
12
+ defaults:
13
+ run:
14
+ shell: bash -l {0}
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Setup environment
20
+ run: |
21
+ pip install --upgrade pip
22
+ pip install datasets pandas==2.0.3
23
+ pip install .[torch,tf,flax]
24
+
25
+ - name: Update metadata
26
+ run: |
27
+ python utils/update_metadata.py --token ${{ secrets.LYSANDRE_HF_TOKEN }} --commit_sha ${{ github.sha }}
tasks/tasksmith-333d8be2d5aa/tests/source/.github/workflows/upload_pr_documentation.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: transformers
14
+ secrets:
15
+ hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
16
+ comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
tasks/tasksmith-333d8be2d5aa/tests/source/.gitignore ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Initially taken from Github's Python gitignore file
2
+
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # tests and logs
12
+ tests/fixtures/cached_*_text.txt
13
+ logs/
14
+ lightning_logs/
15
+ lang_code_data/
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+ MANIFEST
35
+
36
+ # PyInstaller
37
+ # Usually these files are written by a python script from a template
38
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
39
+ *.manifest
40
+ *.spec
41
+
42
+ # Installer logs
43
+ pip-log.txt
44
+ pip-delete-this-directory.txt
45
+
46
+ # Unit test / coverage reports
47
+ htmlcov/
48
+ .tox/
49
+ .nox/
50
+ .coverage
51
+ .coverage.*
52
+ .cache
53
+ nosetests.xml
54
+ coverage.xml
55
+ *.cover
56
+ .hypothesis/
57
+ .pytest_cache/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ .python-version
90
+
91
+ # celery beat schedule file
92
+ celerybeat-schedule
93
+
94
+ # SageMath parsed files
95
+ *.sage.py
96
+
97
+ # Environments
98
+ .env
99
+ .venv
100
+ env/
101
+ venv/
102
+ ENV/
103
+ env.bak/
104
+ venv.bak/
105
+
106
+ # Spyder project settings
107
+ .spyderproject
108
+ .spyproject
109
+
110
+ # Rope project settings
111
+ .ropeproject
112
+
113
+ # mkdocs documentation
114
+ /site
115
+
116
+ # mypy
117
+ .mypy_cache/
118
+ .dmypy.json
119
+ dmypy.json
120
+
121
+ # Pyre type checker
122
+ .pyre/
123
+
124
+ # vscode
125
+ .vs
126
+ .vscode
127
+
128
+ # Pycharm
129
+ .idea
130
+
131
+ # TF code
132
+ tensorflow_code
133
+
134
+ # Models
135
+ proc_data
136
+
137
+ # examples
138
+ runs
139
+ /runs_old
140
+ /wandb
141
+ /examples/runs
142
+ /examples/**/*.args
143
+ /examples/rag/sweep
144
+
145
+ # data
146
+ /data
147
+ serialization_dir
148
+
149
+ # emacs
150
+ *.*~
151
+ debug.env
152
+
153
+ # vim
154
+ .*.swp
155
+
156
+ #ctags
157
+ tags
158
+
159
+ # pre-commit
160
+ .pre-commit*
161
+
162
+ # .lock
163
+ *.lock
164
+
165
+ # DS_Store (MacOS)
166
+ .DS_Store
167
+
168
+ # ruff
169
+ .ruff_cache