Open
Conversation
_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>
Contributor
There was a problem hiding this comment.
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 thevalid_hardwaredevice type check in_valid_auto_compile_criteria(), alongside"cuda"and"xpu".
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_valid_auto_compile_criteria()gates auto-compilation ondevice.type in ["cuda", "xpu"], excluding Neuron devices. This meanstorch.compilenever triggers automatically on Neuron even whenStaticCacheis used (which setsis_compileable = True)."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