-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix type-safety of torch.nn.Module
instances
#129
Open
ezyang
wants to merge
1
commit into
facebookresearch:main
Choose a base branch
from
ezyang:export-D52890934
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary: X-link: pytorch/FBGEMM#3387 X-link: facebookresearch/FBGEMM#476 X-link: pytorch/torchrec#2562 As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of `torch.nn.Module` instances. As far as I can see, the underlying issue of pytorch/pytorch#81462 in `torch.nn.parallel.DistributedDataParallel` has been fixed in the meantime by actually typing `register_comm_hook` correctly. The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling `__getattr__`". (I'll probably be offline for a while, not able to react here...) cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc X-link: pytorch/pytorch#115074 Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820 Differential Revision: D52890934 Pulled By: ezyang
facebook-github-bot
added
the
CLA Signed
This label is managed by the Meta Open Source bot.
label
Nov 18, 2024
This pull request was exported from Phabricator. Differential Revision: D52890934 |
jiaqizhai
approved these changes
Nov 20, 2024
ezyang
pushed a commit
to ezyang/tnt
that referenced
this pull request
Nov 21, 2024
Summary: X-link: facebookresearch/generative-recommenders#129 X-link: pytorch/FBGEMM#3387 X-link: facebookresearch/FBGEMM#476 X-link: pytorch/torchrec#2562 As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of `torch.nn.Module` instances. As far as I can see, the underlying issue of pytorch/pytorch#81462 in `torch.nn.parallel.DistributedDataParallel` has been fixed in the meantime by actually typing `register_comm_hook` correctly. The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling `__getattr__`". (I'll probably be offline for a while, not able to react here...) cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc X-link: pytorch/pytorch#115074 Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820 Differential Revision: D52890934 Pulled By: ezyang
ezyang
pushed a commit
to ezyang/tnt
that referenced
this pull request
Nov 21, 2024
Summary: X-link: facebookresearch/generative-recommenders#129 X-link: pytorch/FBGEMM#3387 X-link: facebookresearch/FBGEMM#476 X-link: pytorch/torchrec#2562 As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of `torch.nn.Module` instances. As far as I can see, the underlying issue of pytorch/pytorch#81462 in `torch.nn.parallel.DistributedDataParallel` has been fixed in the meantime by actually typing `register_comm_hook` correctly. The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling `__getattr__`". (I'll probably be offline for a while, not able to react here...) cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc X-link: pytorch/pytorch#115074 Test Plan: Imported from GitHub, without a `Test Plan:` line. Sandcastle, with "buildall" pragma. Also, I took all projects that wobbled from D65753120 and proactively ran pyre on those targets too. Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820 Differential Revision: D52890934 Pulled By: ezyang
facebook-github-bot
pushed a commit
to pytorch/tnt
that referenced
this pull request
Nov 21, 2024
Summary: X-link: facebookresearch/generative-recommenders#129 X-link: pytorch/FBGEMM#3387 X-link: facebookresearch/FBGEMM#476 X-link: pytorch/torchrec#2562 As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of `torch.nn.Module` instances. As far as I can see, the underlying issue of pytorch/pytorch#81462 in `torch.nn.parallel.DistributedDataParallel` has been fixed in the meantime by actually typing `register_comm_hook` correctly. The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling `__getattr__`". (I'll probably be offline for a while, not able to react here...) cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc Original PR: pytorch/pytorch#115074 Updated testing PR: pytorch/pytorch#141240 Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820 Differential Revision: D52890934 Pulled By: ezyang fbshipit-source-id: 23af4111a80b471d810e0bf828f4d49a19b4ba80
facebook-github-bot
pushed a commit
to pytorch/torchrec
that referenced
this pull request
Nov 21, 2024
Summary: X-link: facebookresearch/generative-recommenders#129 X-link: pytorch/FBGEMM#3387 X-link: facebookresearch/FBGEMM#476 Pull Request resolved: #2562 As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of `torch.nn.Module` instances. As far as I can see, the underlying issue of pytorch/pytorch#81462 in `torch.nn.parallel.DistributedDataParallel` has been fixed in the meantime by actually typing `register_comm_hook` correctly. The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling `__getattr__`". (I'll probably be offline for a while, not able to react here...) cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc Original PR: pytorch/pytorch#115074 Updated testing PR: pytorch/pytorch#141240 Test Plan: Imported from GitHub, without a `Test Plan:` line. Sandcastle, with "buildall" pragma. Also, I took all projects that wobbled from D65753120 and proactively ran pyre on those targets too. Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820 Differential Revision: D52890934 Pulled By: ezyang fbshipit-source-id: 23af4111a80b471d810e0bf828f4d49a19b4ba80
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: pytorch/FBGEMM#3387
X-link: https://github.com/facebookresearch/FBGEMM/pull/476
X-link: pytorch/torchrec#2562
As laid out in pytorch/pytorch#81462 (comment) the change in pytorch/pytorch#104321 was not necessary and largely destroys the type-safety of
torch.nn.Module
instances.As far as I can see, the underlying issue of pytorch/pytorch#81462 in
torch.nn.parallel.DistributedDataParallel
has been fixed in the meantime by actually typingregister_comm_hook
correctly.The proper solution to issues like pytorch/pytorch#81462 is to give the underlying field/method a proper type annotation, then there should be no need to go for a "type system disabling
__getattr__
".(I'll probably be offline for a while, not able to react here...)
cc H-Huang awgu kwen2501 wanchaol fegin fduwjj wz337 wconstab d4l3k c-p-i-o voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang aakhundov avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4 XilunWu rec mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse tianyu-l kiukchung lucasllc
X-link: pytorch/pytorch#115074
Reviewed By: malfet, aorenste, gineshidalgo99, larryliu0820
Differential Revision: D52890934
Pulled By: ezyang