Skip to content

[dynamo] Fix is_from_source to match at intermediate chain levels#176452

Closed
anijain2305 wants to merge 5 commits intogh/anijain2305/1052/basefrom
gh/anijain2305/1052/head
Closed

[dynamo] Fix is_from_source to match at intermediate chain levels#176452
anijain2305 wants to merge 5 commits intogh/anijain2305/1052/basefrom
gh/anijain2305/1052/head

Conversation

@anijain2305
Copy link
Contributor

@anijain2305 anijain2305 commented Mar 4, 2026

Stack from ghstack (oldest at bottom):

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

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

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 4, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176452

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unrelated Failure

As of commit 64d7e2f with merge base bdbf4a1 (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 4, 2026

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

… levels"

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

[ghstack-poisoned]
@anijain2305 anijain2305 added ciflow/trunk Trigger trunk jobs on your pull request topic: not user facing topic category labels Mar 4, 2026
… levels"

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

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

[ghstack-poisoned]
… levels"

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

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

[ghstack-poisoned]
… levels"

is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

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

[ghstack-poisoned]
@anijain2305
Copy link
Contributor Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 2 checks: trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable), inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@anijain2305
Copy link
Contributor Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 3 checks: trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable), inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable), inductor / unit-test / inductor-test / test (inductor_cpp_wrapper, 1, 2, linux.g5.4xlarge.nvidia.gpu)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

ghstack-source-id: fc1b178
Pull Request resolved: pytorch/pytorch#176452
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

ghstack-source-id: d89323e
Pull Request resolved: pytorch/pytorch#176452
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 13, 2026
is_from_source(source, target) previously only compared at the root of
the ChainedSource hierarchy. This meant that
is_from_source(AttrSource(X, 'c'), X) returned False when X was itself
a ChainedSource (e.g. UnspecializedNNModuleSource(GlobalSource(...))),
because the function walked past X all the way to the root before
comparing.

Check source == target at each level before recursing so that
intermediate sources are correctly recognized as ancestors.

Authored with Claude.

ghstack-source-id: d8c0b4b
Pull Request resolved: pytorch/pytorch#176452
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants