Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve circular dependence between torch.autograd and torch.nn.parameter #128633

Open
wants to merge 32 commits into
base: gh/XuehaiPan/55/base
Choose a base branch
from

Conversation

XuehaiPan
Copy link
Collaborator

@XuehaiPan XuehaiPan commented Jun 13, 2024

Stack from ghstack (oldest at bottom):

This PR changes the reference to torch.nn.parameter.Parameter in C++ code to torch._parameter.Parameter (they are the same object) after #130327.

auto parameter_module =
THPObjectPtr(PyImport_ImportModule("torch.nn.parameter"));
if (!parameter_module)
return nullptr;
// NOTE: "leaks" ParameterClass
ParameterClass = PyObject_GetAttrString(parameter_module, "Parameter");
if (!ParameterClass)
return nullptr;

Closes #128609

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @fegin @XilunWu @wanchaol @fduwjj @wz337 @wconstab @chauhang @d4l3k @ezyang @albanD @pearu @nikitaved @soulitzer @Varal7 @mruberry @jbschlosser @walterddr @mikaylagawarecki @penguinwu @tianyu-l @yf225 @lezcano

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jun 13, 2024

🔗 Helpful Links

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

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

❌ 104 New Failures, 3 Unrelated Failures

As of commit 7f7fd30 with merge base 500aea8 (image):

NEW FAILURES - The following jobs have failed:

UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:

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

@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels Jun 13, 2024
@XuehaiPan XuehaiPan marked this pull request as draft June 13, 2024 18:27
@XuehaiPan XuehaiPan added the module: autograd Related to torch.autograd, and the autograd engine in general label Jun 13, 2024
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jun 13, 2024
…rameter`

ghstack-source-id: 8da14380554e114dada41e19658aae1cf0dcc1b2
Pull Request resolved: #128633
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jun 14, 2024
…rameter`

ghstack-source-id: 5816f1cb0f8bcca3b4639d7002394e8ad65b2fe1
Pull Request resolved: #128633
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jun 16, 2024
…rameter`

ghstack-source-id: 9ec03f6ecf8468f0f2b692e4797ca5bc219e9223
Pull Request resolved: #128633
XuehaiPan added a commit that referenced this pull request Jul 10, 2024
…rameter`

ghstack-source-id: adc22398c2d5d5f9fbd98d19ace7721313bc1c1a
Pull Request resolved: #128633
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 11, 2024
…rameter`

ghstack-source-id: e8977d062f9af4dd38f5c8ae5da6e00454cb52ed
Pull Request resolved: #128633
@XuehaiPan XuehaiPan marked this pull request as ready for review July 11, 2024 11:47
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 12, 2024
…rameter`

ghstack-source-id: 2cc2999a6eaf6b3e95396af8a2c08ad200ca15d8
Pull Request resolved: #128633
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 13, 2024
…rameter`

ghstack-source-id: 8c1cd943a21d2acbc72b249b1feac4091871ff86
Pull Request resolved: #128633
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 19, 2024
…rameter`

ghstack-source-id: c50623300c2d1b24116c61bf8a4b7350b3d5d00b
Pull Request resolved: #128633
[ghstack-poisoned]
XuehaiPan added a commit that referenced this pull request Jul 29, 2024
…rameter`

ghstack-source-id: 957d639897b6ae381076395a17ab7773a693dcc2
Pull Request resolved: #128633
pytorchmergebot pushed a commit that referenced this pull request Jul 31, 2024
Split from #128633.

- #128633

Move commonly used functions (e.g. `is_scripting`) to the top of the module to avoid circular dependency.
Pull Request resolved: #130531
Approved by: https://github.com/EikanWang, https://github.com/ezyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request module: autograd Related to torch.autograd, and the autograd engine in general module: nn Related to torch.nn oncall: distributed Add this issue/PR to distributed oncall triage queue open source release notes: distributed (c10d) release notes category
Projects
None yet
2 participants