Skip to content

Torch compile backend defaults to "neuron" - #47035

Merged
michaelbenayoun merged 4 commits into
huggingface:mainfrom
michaelbenayoun:neuron_backend_default_training_args
Jul 10, 2026
Merged

michaelbenayoun merged 4 commits into
huggingface:mainfrom
michaelbenayoun:neuron_backend_default_training_args

Conversation

@michaelbenayoun

@michaelbenayoun michaelbenayoun commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

CI

What does this PR do?

When --torch-compile is set and no backend is specified, defaults to "neuron" when a torch neuron is available.
Follows the same spirit as what's done for HPUs.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@stevhliu stevhliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, it would be good to add a sentence or two in https://huggingface.co/docs/transformers/main/en/torch_compile#backend about this! something like:

When no backend is specified, [TrainingArguments] selects one based on your hardware. On most CPUs and GPUs, the default is inductor, which compiles to Triton kernels with AOTAutograd and suits most training workloads. On Intel Gaudi (HPU), the default is hpu_backend. On AWS Trainium and Inferentia (Neuron), the default is neuron.

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM !

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 29118487859:1
Result: success | Jobs: 15 | Tests: 170,762 | Failures: 0 | Duration: 15h 45m

@michaelbenayoun
michaelbenayoun added this pull request to the merge queue Jul 10, 2026
Merged via the queue into huggingface:main with commit d47a534 Jul 10, 2026
103 checks passed
@michaelbenayoun
michaelbenayoun deleted the neuron_backend_default_training_args branch July 10, 2026 20:14
stevhliu pushed a commit to stevhliu/transformers that referenced this pull request Jul 30, 2026
* feat: torch compile backend defaults to "neuron"

* fix: restore doc back to normal

* doc: add information about backend in docs
Sainava pushed a commit to Sainava/Sai-transformers that referenced this pull request Aug 3, 2026
* feat: torch compile backend defaults to "neuron"

* fix: restore doc back to normal

* doc: add information about backend in docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants