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

[WIP][dynamo] simplify module_key creation logic #94945

Closed
wants to merge 1 commit into from

Conversation

ydwu4
Copy link
Contributor

@ydwu4 ydwu4 commented Feb 15, 2023

After some thoughts, I find it difficult to come up with a robust naming convention that satisfies the following constraints at the same time: 1. the new name should be a valid nn.Moule attribute (as required by minifier and it's a good thing to have in general) 2. it can cover various cases such as GetItemSource, GetAttrSource 3. it's easy to recover the original path 4. robust to users' naming scheme.

Thanks to @yanboliang for pointing out the original access path is preserved in Source, now we just need to add an additonal value source.name() to node.meta["nn_module_stack"] to get the access path in original module.

We also address some TODO in quantization, which relies on the original naming convention in nn_module_stack.

cc @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 15, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 004a27a:
💚 Looks good so far! There are no failures yet. 💚

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

@ydwu4 ydwu4 changed the title [dynamo] simplify module_key creation logic [WIP][dynamo] simplify module_key creation logic Feb 15, 2023
@github-actions github-actions bot added the release notes: quantization release notes category label Feb 16, 2023
@ydwu4 ydwu4 requested a review from jansel February 16, 2023 20:59
torch/_dynamo/output_graph.py Outdated Show resolved Hide resolved
torch/_dynamo/variables/nn_module.py Outdated Show resolved Hide resolved
@ydwu4 ydwu4 force-pushed the rename branch 3 times, most recently from 5ffc0ef to 4608186 Compare February 17, 2023 22:55
@ydwu4
Copy link
Contributor Author

ydwu4 commented Feb 20, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 20, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

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

pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
jhavukainen pushed a commit to kulinseth/pytorch that referenced this pull request Mar 15, 2024
After some thoughts, I find it difficult to come up with a robust naming convention that satisfies the following constraints at the same time: 1. the new name should be a valid nn.Moule attribute (as required by minifier and it's a good thing to have in general) 2. it can cover various cases such as GetItemSource, GetAttrSource 3. it's easy to recover the original path 4. robust to users' naming scheme.

Thanks to @yanboliang for pointing out the original access path is preserved in Source, now we just need to add an additonal value source.name() to node.meta["nn_module_stack"]  to get the access path in original module.

We also address some TODO in quantization, which relies on the original naming convention in nn_module_stack.

Pull Request resolved: pytorch#94945
Approved by: https://github.com/jansel, https://github.com/yanboliang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants