Skip to content

Add Neuron to auto-compile hardware list#44757

Open
dacorvo wants to merge 1 commit intomainfrom
neuron_auto_compile
Open

Add Neuron to auto-compile hardware list#44757
dacorvo wants to merge 1 commit intomainfrom
neuron_auto_compile

Conversation

@dacorvo
Copy link
Contributor

@dacorvo dacorvo commented Mar 16, 2026

Summary

  • _valid_auto_compile_criteria() gates auto-compilation on device.type in ["cuda", "xpu"], excluding Neuron devices. This means torch.compile never triggers automatically on Neuron even when StaticCache is used (which sets is_compileable = True).
  • Adds "neuron" to the valid hardware list so that Neuron devices benefit from auto-compilation like CUDA and XPU.

Addresses the "Auto-compilation gate missing Neuron" item in #44742.

🤖 Generated with Claude Code

Co-authored-by: Claude Opus 4.6 noreply@anthropic.com

_valid_auto_compile_criteria() gates auto-compilation on device type
but excluded Neuron, so torch.compile never triggers automatically
even when StaticCache is used. Add "neuron" to the valid hardware
list alongside "cuda" and "xpu".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds "neuron" to the list of valid hardware device types in _valid_auto_compile_criteria(), enabling auto-compilation (torch.compile) on AWS Neuron (Trainium/Inferentia) devices when a compilable cache (e.g., StaticCache) is used. This is one item from the broader issue #44742 tracking static-shape generation support for Neuron.

Changes:

  • Added "neuron" to the valid_hardware device type check in _valid_auto_compile_criteria(), alongside "cuda" and "xpu".

@HuggingFaceDocBuilderDev

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.

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.

3 participants