Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 3 additions & 29 deletions .circleci/create_circleci_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ def to_dict(self):
f"--{key}={value}" if (value is not None or key in ["doctest-modules"]) else f"-{key}"
for key, value in all_options.items()
]
pytest_flags.append(
f"--make-reports={self.name}" if "examples" in self.name else f"--make-reports=tests_{self.name}"
)
# Examples special case: we need to download NLTK files in advance to avoid cuncurrency issues
pytest_flags.append(f"--make-reports=tests_{self.name}")
timeout_cmd = f"timeout {self.command_timeout} " if self.command_timeout else ""
marker_cmd = f"-m '{self.marker}'" if self.marker is not None else ""
junit_flags = " -p no:warning -o junit_family=xunit1 --junitxml=test-results/junit.xml"
Expand All @@ -189,14 +186,6 @@ def to_dict(self):
{"attach_workspace": {"at": "test_preparation"}},
{"run": "apt-get update && apt-get install -y curl"},
{"run": " && ".join(self.install_steps)},
{
"run": {
"name": "Download NLTK files",
"command": """python -c "import nltk; nltk.download('punkt', quiet=True)" """,
}
if "example" in self.name
else "echo Skipping"
},
{
"run": {
"name": "Show installed libraries and their size",
Expand Down Expand Up @@ -310,11 +299,7 @@ def to_dict(self):

@property
def job_name(self):
return (
self.name
if ("examples" in self.name or "pipeline" in self.name or "pr_documentation" in self.name)
else f"tests_{self.name}"
)
return self.name if ("pipeline" in self.name or "pr_documentation" in self.name) else f"tests_{self.name}"


# JOBS
Expand Down Expand Up @@ -361,16 +346,6 @@ def job_name(self):
docker_image=[{"image": "huggingface/transformers-custom-tokenizers"}],
)

examples_torch_job = CircleCIJob(
"examples_torch",
disabled=True, # examples-torch docker image is too large for the large runner
additional_env={"OMP_NUM_THREADS": 8},
docker_image=[{"image": "huggingface/transformers-examples-torch"}],
# TODO @ArthurZucker remove this once docker is easier to build
install_steps=["uv pip install . && uv pip install -r examples/pytorch/_tests_requirements.txt"],
pytest_num_workers=4,
)

exotic_models_job = CircleCIJob(
"exotic_models",
docker_image=[{"image": "huggingface/transformers-exotic-models"}],
Expand Down Expand Up @@ -454,15 +429,14 @@ def job_name(self):
)

REGULAR_TESTS = [torch_job, tokenization_job, processor_job, generate_job, non_model_job] # fmt: skip
EXAMPLES_TESTS = [examples_torch_job]
PIPELINE_TESTS = [pipelines_torch_job]
REPO_UTIL_TESTS = [repo_utils_job]
DOC_TESTS = [doc_test_job]
TRAINING_CI_TESTS = [training_ci_job]
TENSOR_PARALLEL_CI_TESTS = [tensor_parallel_ci_job]
FSDP_CI_TESTS = [fsdp_ci_job]
PEFT_INTEGRATION_TESTS = [peft_integration_job]
ALL_TESTS = REGULAR_TESTS + EXAMPLES_TESTS + PIPELINE_TESTS + REPO_UTIL_TESTS + DOC_TESTS + [custom_tokenizers_job] + [exotic_models_job] + TRAINING_CI_TESTS + TENSOR_PARALLEL_CI_TESTS + FSDP_CI_TESTS + PEFT_INTEGRATION_TESTS # fmt: skip
ALL_TESTS = REGULAR_TESTS + PIPELINE_TESTS + REPO_UTIL_TESTS + DOC_TESTS + [custom_tokenizers_job] + [exotic_models_job] + TRAINING_CI_TESTS + TENSOR_PARALLEL_CI_TESTS + FSDP_CI_TESTS + PEFT_INTEGRATION_TESTS # fmt: skip


def create_circleci_config(folder=None):
Expand Down
18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,6 @@ body:

placeholder: "@Username ..."

- type: checkboxes
id: information-scripts-examples
attributes:
label: Information
description: 'The problem arises when using:'
options:
- label: "The official example scripts"
- label: "My own modified scripts"

- type: checkboxes
id: information-tasks
attributes:
label: Tasks
description: "The tasks I am working on are:"
options:
- label: "An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)"
- label: "My own task or dataset (give details below)"

- type: textarea
id: reproduction
validations:
Expand Down
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@ body:
validations:
required: true

- type: checkboxes
id: information-scripts-examples
attributes:
label: Information
description: 'The problem arises when using:'
options:
- label: "The official example scripts"
- label: "My own modified scripts"

- type: checkboxes
id: information-tasks
attributes:
label: Tasks
description: "The tasks I am working on are:"
options:
- label: "An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)"
- label: "My own task or dataset (give details below)"

- type: textarea
id: reproduction
validations:
Expand Down Expand Up @@ -68,5 +50,3 @@ body:
([pytorch-transformers](https://github.com/huggingface/transformers#migrating-from-pytorch-transformers-to-transformers);
[pytorch-pretrained-bert](https://github.com/huggingface/transformers#migrating-from-pytorch-pretrained-bert-to-transformers))"
required: true
- label: "I checked if a related official extension example runs on my machine."
required: true
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

strategy:
matrix:
file: ["quality", "consistency", "custom-tokenizers", "torch-light", "exotic-models", "examples-torch"]
file: ["quality", "consistency", "custom-tokenizers", "torch-light", "exotic-models"]
continue-on-error: true

steps:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/self-scheduled-amd-mi250-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ jobs:
report_repo_id: optimum-amd/transformers_daily_ci
secrets: inherit

example-ci:
name: Example CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@63657f571a92cc9759159442936061c51d6d9ae4 # main
with:
job: run_examples_gpu
slack_report_channel: "#transformers-ci-daily-amd"
runner: mi250
docker: huggingface/transformers-pytorch-amd-gpu
ci_event: Scheduled CI (AMD) - mi250
report_repo_id: optimum-amd/transformers_daily_ci
secrets: inherit

deepspeed-ci:
name: DeepSpeed CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled.yaml@63657f571a92cc9759159442936061c51d6d9ae4 # main
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/self-scheduled-amd-mi300-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,6 @@ jobs:
commit_sha: ${{ github.event.workflow_run.head_sha || github.sha }}
secrets: inherit

example-ci:
name: Example CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled_arc_scale_set.yaml@main
with:
job: run_examples_gpu
slack_report_channel: "#amd-hf-ci"
runner_group: amd-mi300
docker: huggingface/transformers-pytorch-amd-gpu
ci_event: Scheduled CI (AMD) - mi300
report_repo_id: optimum-amd/transformers_daily_ci
env_file: /etc/podinfo/gha-gpu-isolation-settings
commit_sha: ${{ github.event.workflow_run.head_sha || github.sha }}
secrets: inherit

deepspeed-ci:
name: DeepSpeed CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled_arc_scale_set.yaml@main
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/self-scheduled-amd-mi355-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ jobs:
report_repo_id: hf-transformers-bot/transformers-ci-dummy
secrets: inherit

example-ci:
name: Example CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled_arc_scale_set.yaml@50acccfe9afb8927b9b74ed7e750f2b0d3991b62 # main
with:
job: run_examples_gpu
slack_report_channel: "#amd-hf-ci"
runner_group: hfc-amd-mi355
docker: huggingface/transformers-pytorch-amd-gpu
ci_event: Scheduled CI (AMD) - mi355
report_repo_id: hf-transformers-bot/transformers-ci-dummy
secrets: inherit

deepspeed-ci:
name: DeepSpeed CI
uses: huggingface/hf-workflows/.github/workflows/transformers_amd_ci_scheduled_arc_scale_set.yaml@50acccfe9afb8927b9b74ed7e750f2b0d3991b62 # main
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/self-scheduled-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ jobs:
commit_sha: ${{ github.sha }}
secrets: inherit

example-ci:
name: Example CI
uses: huggingface/transformers-ci/.github/workflows/daily-ci_reusable.yml@main
with:
job: run_examples_gpu
slack_report_channel: "#transformers-ci-daily-examples"
docker: huggingface/transformers-all-latest-gpu
ci_event: Daily CI
report_repo_id: hf-internal-testing/transformers_daily_ci
commit_sha: ${{ github.sha }}
secrets: inherit

trainer-fsdp-ci:
name: Trainer/FSDP CI
uses: huggingface/transformers-ci/.github/workflows/daily-ci_reusable.yml@main
Expand Down
78 changes: 1 addition & 77 deletions .github/workflows/self-scheduled-intel-gaudi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,81 +183,6 @@ jobs:
name: ${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports
path: reports/${{ env.machine_type }}_run_pipelines_torch_gpu_test_reports

run_examples_gpu:
permissions:
contents: read
if: ${{ inputs.job == 'run_examples_gpu' }}
name: Examples directory
strategy:
fail-fast: false
matrix:
machine_type: [1gaudi]
runs-on:
group: ${{ inputs.runner_scale_set }}-${{ matrix.machine_type }}
container:
image: vault.habana.ai/gaudi-docker/1.21.1/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest
options: --runtime=habana
-v /mnt/cache/.cache/huggingface:/mnt/cache/.cache/huggingface
--env OMPI_MCA_btl_vader_single_copy_mechanism=none
--env HABANA_VISIBLE_DEVICES
--env HABANA_VISIBLE_MODULES
--cap-add=sys_nice
--shm-size=64G
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Install dependencies
run: |
pip install -e .[testing,torch] "numpy<2.0.0" scipy scikit-learn librosa soundfile

- name: HL-SMI
run: |
hl-smi
echo "HABANA_VISIBLE_DEVICES=${HABANA_VISIBLE_DEVICES}"
echo "HABANA_VISIBLE_MODULES=${HABANA_VISIBLE_MODULES}"

- name: Environment
run: |
python3 utils/print_env.py

- name: Show installed libraries and their versions
run: |
pip freeze

- name: Set `machine_type` for report and artifact names
shell: bash
run: |
if [ "${{ matrix.machine_type }}" = "1gaudi" ]; then
machine_type=single-gpu
elif [ "${{ matrix.machine_type }}" = "2gaudi" ]; then
machine_type=multi-gpu
else
machine_type=${{ matrix.machine_type }}
fi
echo "machine_type=$machine_type" >> $GITHUB_ENV

- name: Run examples tests on Intel Gaudi
run: |
pip install -r examples/pytorch/_tests_requirements.txt
python3 -m pytest -v --make-reports="${machine_type}_run_examples_gpu_test_reports" examples/pytorch -m "not not_device_test"

- name: Failure short reports
if: ${{ failure() }}
continue-on-error: true
run: |
cat "reports/${machine_type}_run_examples_gpu_test_reports/failures_short.txt"

- name: "Test suite reports artifacts: ${{ env.machine_type }}_run_examples_gpu_test_reports"
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.machine_type }}_run_examples_gpu_test_reports
path: reports/${{ env.machine_type }}_run_examples_gpu_test_reports

run_torch_cuda_extensions_gpu:
permissions:
contents: read
Expand Down Expand Up @@ -318,7 +243,7 @@ jobs:

- name: Run all deepspeed tests on intel Gaudi
run: |
python3 -m pytest -v --make-reports="${machine_type}_run_torch_cuda_extensions_gpu_test_reports" tests/deepspeed -m "not not_device_test"
python3 -m pytest -v --make-reports="${machine_type}_run_torch_cuda_extensions_gpu_test_reports" tests/trainer/distributed/test_trainer_distributed_deepspeed.py -m "not not_device_test"

- name: Failure short reports
if: ${{ failure() }}
Expand Down Expand Up @@ -427,7 +352,6 @@ jobs:
[
setup,
run_models_gpu,
run_examples_gpu,
run_torch_cuda_extensions_gpu,
run_pipelines_torch_gpu,
run_trainer_and_fsdp_gpu,
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/self-scheduled-intel-gaudi3-caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ jobs:

secrets: inherit

example-ci:
name: Example CI
uses: ./.github/workflows/self-scheduled-intel-gaudi.yml
with:
job: run_examples_gpu
ci_event: Scheduled CI (Intel) - Gaudi3
runner_scale_set: itac-bm-emr-gaudi3-dell
slack_report_channel: "#transformers-ci-daily-intel-gaudi3"
report_repo_id: optimum-intel/transformers_daily_ci_intel_gaudi3

secrets: inherit

deepspeed-ci:
name: DeepSpeed CI
uses: ./.github/workflows/self-scheduled-intel-gaudi.yml
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# make sure to test the local checkout in scripts and not the pre-installed one (don't use quotes!)
export PYTHONPATH = src

.PHONY: style typing check-code-quality check-repository-consistency check-repo fix-repo test test-examples benchmark codex claude clean-ai
.PHONY: style typing check-code-quality check-repository-consistency check-repo fix-repo test benchmark codex claude clean-ai


# Checker lists. The two CI jobs (CircleCI runs `make check-code-quality` and
Expand Down Expand Up @@ -66,10 +66,6 @@ fix-repo:
test:
python -m pytest -p random_order -n auto --dist=loadfile -s -v --random-order-bucket=module ./tests/

# Run tests for examples, requires pytest-random-order
test-examples:
python -m pytest -p random_order -n auto --dist=loadfile -s -v --random-order-bucket=module ./examples/pytorch/

# Run benchmark
benchmark:
python3 benchmark/benchmark.py --config-dir benchmark/config --config-name generation --commit=diff backend.model=google/gemma-2b backend.cache_implementation=null,static backend.torch_compile=false,true --multirun
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ pipeline(

- This library is not a modular toolbox of building blocks for neural nets. The code in the model files is not refactored with additional abstractions on purpose, so that researchers can quickly iterate on each of the models without diving into additional abstractions/files.
- The training API is optimized to work with PyTorch models provided by Transformers. For generic machine learning loops, you should use another library like [Accelerate](https://huggingface.co/docs/accelerate).
- The [example scripts](https://github.com/huggingface/transformers/tree/main/examples) are only *examples*. They may not necessarily work out-of-the-box on your specific use case and you'll need to adapt the code for it to work.

## 100 projects using Transformers

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ target "ci-base" {
target "ci-image" {
name = image
matrix = {
image = ["quality", "consistency", "custom-tokenizers", "torch-light", "exotic-models", "examples-torch", "pipeline-torch"]
image = ["quality", "consistency", "custom-tokenizers", "torch-light", "exotic-models", "pipeline-torch"]
}
context = "docker"
dockerfile = "${image}.dockerfile"
Expand Down
20 changes: 0 additions & 20 deletions docker/examples-torch.dockerfile

This file was deleted.

Loading
Loading