Skip to content

test: enable trace_autograd_ops for torch 2.11 compile/export#283

Merged
jomitchellnv merged 1 commit into
NVIDIA:mainfrom
jomitchellnv:fix-ci
May 30, 2026
Merged

test: enable trace_autograd_ops for torch 2.11 compile/export#283
jomitchellnv merged 1 commit into
NVIDIA:mainfrom
jomitchellnv:fix-ci

Conversation

@jomitchellnv
Copy link
Copy Markdown
Collaborator

torch 2.11 no longer honors torch._dynamo.allow_in_graph for torch.autograd.grad; tracing it under torch.compile/export now requires torch._dynamo.config.trace_autograd_ops=True, otherwise Dynamo raises torch._dynamo.exc.Unsupported. The segmented_polynomial tests call torch.autograd.grad inside compiled/exported modules and fail on 2.11.

Set the flag session-wide in the torch tests' conftest (guarded with hasattr so older torch is unaffected).

Description

Closes #

Checklist

Please confirm the following before requesting review. PRs that do not meet these requirements cannot be merged. See CONTRIBUTING.md for the full contribution rules.

Contribution rules

  • I have read and am adhering to the Contribution Rules.
  • An issue was filed and approved by the NVIDIA team before this PR.
  • I have installed and run pre-commit locally (pip install pre-commit && pre-commit install).
  • This PR addresses a single concern and avoids unnecessary complexity or commented-out code.
  • If this PR is a work in progress, the title is prefixed with [WIP].

Sign-off (DCO)

Per Signing Your Work, every commit in this PR must be signed off with git commit -s (appending Signed-off-by: Your Name <your@email.com>). PRs containing unsigned commits will not be accepted.

  • All commits in this PR are signed off (git commit -s).
  • By signing off, I certify that I have the right to submit this contribution under the project's open source license, in accordance with the Developer Certificate of Origin v1.1.

torch 2.11 no longer honors torch._dynamo.allow_in_graph for
torch.autograd.grad; tracing it under torch.compile/export now requires
torch._dynamo.config.trace_autograd_ops=True, otherwise Dynamo raises
torch._dynamo.exc.Unsupported. The segmented_polynomial tests call
torch.autograd.grad inside compiled/exported modules and fail on 2.11.

Set the flag session-wide in the torch tests' conftest (guarded with
hasattr so older torch is unaffected).

Signed-off-by: Jonathan Mitchell <jomitchell@nvidia.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 30, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@jomitchellnv jomitchellnv merged commit f797caa into NVIDIA:main May 30, 2026
9 checks passed
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.

2 participants