-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[dynamo] nn parameterization causing increased compile time #125314
Comments
cc @jbschlosser @jansel for initial ideas on getting compile times back down. |
#123804 was a correctness fix -- though maybe we could allowlist away whatever property is triggering the extra compile time. |
Well one quick fix would be to not restart analysis for parametrizations and instead skip tracing into them entirely, as I did in the original impl of #121041. But it'd be better to figure out how to fully inline them.
The parametrization mechanism injects a |
As we are recommending parametrization as the way to solve serialization for tensor subclasses, it is much, much better to support them. |
Workaround for #125314 and #125478. We no longer make parametrized nn.Modules unspecialized. Instead, when we are about to call a function from the `torch.nn.utils.parametrize` module, we skip the frame. The script from #125314 now outputs ``` parametrize=True: 6587ms parametrize=False: 1729ms parametrize=True: 4497ms parametrize=False: 1539ms ``` Pull Request resolved: #125710 Approved by: https://github.com/jansel, https://github.com/jbschlosser
We now trace through nn module parametrization. |
Internal link: https://fb.workplace.com/groups/1075192433118967/permalink/1421189078519299/
Minimal repro:
Bisected to find the following commits responsible: #121041 (~200ms -> ~4500ms locally) and #123804 (~4500ms -> ~20000ms locally).
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng
The text was updated successfully, but these errors were encountered: