-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support postproc inputs to be list or dict with outputs from other po…
…stproc modules (#2733) Summary: Postproc modules with collection inputs (list or dict) with non-static (derived from input or other postproc) elements were not properly rewritten - input elements remained fx.Nodes even during the actual model forward (i.e. outside rewrite, during pipeline execution) To illustrate: ``` def forward(model_input: ...) -> ...: modified_input = model_input.float_features + 1 sharded_module_input = self.postproc(model_input, modified_input) # works sharded_module_input = self.postproc(model_input, [123]) # works sharded_module_input = self.postproc(model_input, [torch.ones_like(modified_input)]) # fails sharded_module_input = self.postproc(model_input, [modified_input]) # fails sharded_module_input = self.postproc(model_input, { 'a': 123 }) # works sharded_module_input = self.postproc(model_input, { 'a': torch.ones_like(modified_input) }) # fails sharded_module_input = self.postproc(model_input, { 'a': modified_input }) # fails return self.ebc(sharded_module_input) ``` Differential Revision: D69292525
- Loading branch information
1 parent
f269be7
commit 9066e6b
Showing
3 changed files
with
457 additions
and
191 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
Oops, something went wrong.