-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ONNX] Add eliminate_unused_items pass #38812
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
Conversation
@BowenBao @neginraoof please review |
💊 CI failures summary and remediationsAs of commit b72eb36 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 76 times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A high level question, won't general lint pass and dce pass work here?
dce pass doesn't remove unused initializers and the only unused inputs that it removes are from prim:fork node: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/passes/dead_code_elimination.cpp#L51 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment inline, LGTM
@houseroad can you please review this. |
@houseroad flake8 and ci.pytorch.org test failure are not caused by this PR |
@houseroad clang-tidy failure is because of onnxTypeToScalarTypeMap in constant_fold pass: Do you have any other comment or can we merge this PR? |
Do you want to create some constant to address the issue? |
@houseroad I added constants ::ONNX_NAMESPACE::TensorProto_DataType_* to replace numbers 1 - 12 in onnxTypeToScalarTypeMap inside constant folding pass that were causing clang-tidy failure on the CI. However clang-tidy does not have the generated onnx header so it will still fail on the CI. |
@houseroad can we merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we let clang-tidy pass?
@houseroad please have a look, the clang-tidy issue is resolved. :) |
@houseroad CI is green, can we merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@houseroad merged this pull request in 547ea78. |
This PR: