pytorch - ✅(Solved) Fix UNSTABLE pull / dynamo-cpython-test / test-osdc (dynamo_cpython) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#182144Fetched 2026-05-02 05:26:59
View on GitHub
Comments
1
Participants
2
Timeline
35
Reactions
0
Author
Timeline (top)
subscribed ×26mentioned ×4labeled ×3added_to_project_v2 ×1

PR fix notes

PR #182135: [dynamo] Handle typing._GenericAlias in SourcelessBuilder

Description (problem / solution / changelog)

Stack from ghstack (oldest at bottom):

  • -> #182135
  • #182134

After the pytest 7 -> 9 bump, dynamo_cpython tests started failing on ComplexTest.test_pow with Unsupported: SourcelessBuilder.create does not know how to wrap <class 'typing._GenericAlias'>. pytest 9 added an addSubTest hook to _pytest/unittest.py (pytest 7 had no subTest support at all) whose body is call_info = CallInfo[None](...). CallInfo is a Generic[T] dataclass, and on subscripting it produces a typing._GenericAlias rather than a types.GenericAlias (the PEP 585 runtime form) — only the latter was handled by SourcelessBuilder.create.

CPythonTestCase enables enable_trace_unittest=True and runs with dynamo_strict_nopython=True, so dynamo traces all the way into pytest's addSubTest and the unhandled type is fatal.

Add typing._GenericAlias to the same isinstance branch that already handles types.GenericAlias and types.UnionType. They are conceptually the same surface (a subscripted/parameterised type) and TypingVariable already knows how to handle the value.

Authored with Claude.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo @azahed98

Changed files

  • torch/_dynamo/variables/builder.py (modified, +11/-1)
RAW_BUFFERClick to expand / collapse

This is still failing after pytest 9.0.3 update, so I temporarily mark this as unstable while figure out a fix in https://github.com/pytorch/pytorch/pull/182135

cc @seemethere @malfet @pytorch/pytorch-dev-infra

extent analysis

TL;DR

The issue is likely related to an incompatibility with pytest 9.0.3, and a temporary workaround may be needed until a fix is found.

Guidance

  • Investigate the changes in pytest 9.0.3 to identify potential causes of the incompatibility.
  • Review the pull request https://github.com/pytorch/pytorch/pull/182135 for potential fixes or workarounds.
  • Consider temporarily downgrading pytest to a previous version to verify if the issue is indeed caused by the update.
  • Collaborate with the mentioned developers (@seemethere, @malfet, and @pytorch/pytorch-dev-infra) to find a solution.

Notes

The issue lacks specific technical details, making it difficult to provide a more precise fix or workaround.

Recommendation

Apply workaround: Temporarily mark the test as unstable until a fix is found, as mentioned in the issue, to prevent test failures while a solution is being developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - ✅(Solved) Fix UNSTABLE pull / dynamo-cpython-test / test-osdc (dynamo_cpython) [1 pull requests, 1 comments, 2 participants]