forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow (temporarily?) non-fake input during ONNX export with fake mode (…
…pytorch#105246) Although input and model are expected to be fake during ONNX export with fake mode enabled, apparently some models can create new parameters during tracing. That makes internal checks on dynamo side to fail when we dont set `allow_non_fake_input=True` for `torch._dynamo.export`. pytorch#105077 tracks this issue and if a proper fix is done, we will set `allow_non_fake_input=False` again Additionally to that, a possible bug was found at torch.nn.Module.state_dict() in which some registered buffers are not listed. This is being tracked by pytorch#105233 but in the mean time, we are merging `state_dict()` and `named_buffers()` results to create a full `state_dict` for the model Two more complex/larger tests are added to the ONNX export which are the same for the experimental symbolic tracing: tiny gpt2 and toy mlp (https://github.com/pytorch/pytorch/blob/main/test/onnx/test_fx_to_onnx_with_onnxruntime.py#L766-L825) ps: pytorch#105464 tracks pending tasks/limitations from this PR Pull Request resolved: pytorch#105246 Approved by: https://github.com/BowenBao
- Loading branch information
1 parent
04da0c7
commit 842616b
Showing
4 changed files
with
90 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
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