Skip to content

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Jul 2, 2019

Stack:
    :white_circle:  #22239 Open up AliasAnalysisKind for any ops  💛
    :white_circle:  #22175 AliasAnalysisKind::CONSERVATIVE/FROM_SCHEMA  💛
    :black_circle:  #22476 Fix dead code elimination in onnx export  💛
    :white_circle:  #22461 EraseNumberTypes cleans itself up  💚

Dead code elimination assumes a valid jit graph because it checks if operators have side effects.
The onnx export path destroys the jit graph right before calling dead code elimination, but it actually doesn't care about side effects.
We can just call dead code elimination and disable side effect lookup and things should work.

Differential Revision: D16100172

Differential Revision: D16100172
Differential Version: 85987667
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: onnx Related to torch.onnx labels Jul 2, 2019
Differential Revision: D16100172
Differential Version: 85991639
@smessmer smessmer requested a review from houseroad July 2, 2019 23:58
Copy link
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 17cc798.

xzhu1900 pushed a commit to xzhu1900/pytorch that referenced this pull request Jul 5, 2019
Summary:
Pull Request resolved: pytorch#22476

Dead code elimination assumes a valid jit graph because it checks if operators have side effects.
The onnx export path destroys the jit graph right before calling dead code elimination, but it actually doesn't care about side effects.
We can just call dead code elimination and disable side effect lookup and things should work.

Reviewed By: houseroad

Differential Revision: D16100172

fbshipit-source-id: 8c790055e0d76c4227394cafa93b07d1310f2cea
@suo
Copy link
Member

suo commented Jul 9, 2019

Hi @houseroad, @smessmer, next time can you loop in a JIT team member to review a change to a core optimization pass? I have concerns because this essentially adds a flag that says "make this pass produce incorrect results"—we should try to quarantine such special-case behavior to the ONNX level instead of adding it to the JIT itself.

@houseroad
Copy link
Member

Sure, I agree

@eellison
Copy link
Contributor

eellison commented Jul 9, 2019

Can we try to unmerge & find a different approach ?

@ezyang ezyang deleted the export-D16100172 branch July 19, 2019 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: onnx Related to torch.onnx oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants