Skip to content

Conversation

@lara-hdr
Copy link
Contributor

@lara-hdr lara-hdr commented Apr 4, 2019

Strip the doc_string by default from the exported ONNX models (this string has the stack trace and information about the local repos and folders, which can be confidential).

The users can still generate the doc_string by specifying add_doc_string=True in torch.onnx.export().

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Apr 4, 2019
@ezyang ezyang added module: onnx Related to torch.onnx module: bc-breaking Related to a BC-breaking change labels Apr 5, 2019
@ezyang
Copy link
Contributor

ezyang commented Apr 5, 2019

The patch looks reasonable. It is technically BC-breaking because the default behavior changes; maybe that's OK. It's a little weird that you flip the meaning of the boolean between the frontend and backend.

@lara-hdr
Copy link
Contributor Author

lara-hdr commented Apr 5, 2019

@ezyang, I set the default to strip the doc string as it is more confidential, and the stack trace does not add much value to the generated model.

The backend already uses "strip_doc_string" which I didn't want to change. From the front end side, it seemed to me that add_doc_string would make more sense from the user's point of view (especially if the default is generating the model without the doc_string), which is why I flip the meaning of the boolean. But I can change it to use strip_doc_string everywhere (or add_doc_string everywhere).

@ezyang ezyang requested a review from houseroad April 5, 2019 19:29
@lara-hdr
Copy link
Contributor Author

@houseroad any update on this?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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.

stripping doc by default should be fine. could you address my comments and resolve the conflicts?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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.

@lara-hdr
Copy link
Contributor Author

@houseroad, any other comments? (the lint error is not related to this PR)
Thanks

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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.

Looks good. Thanks!

@houseroad
Copy link
Member

rebase and resolve the conflicts?

@lara-hdr
Copy link
Contributor Author

@houseroad, I resolved the conflicts, could we merge this?
Thank you!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in 9983c24.

zhangguanheng66 pushed a commit to zhangguanheng66/pytorch that referenced this pull request May 6, 2019
Summary:
Strip the doc_string by default from the exported ONNX models (this string has the stack trace and information about the local repos and folders, which can be confidential).

The users can still generate the doc_string by specifying add_doc_string=True in torch.onnx.export().
Pull Request resolved: pytorch#18882

Differential Revision: D14889684

Pulled By: houseroad

fbshipit-source-id: 26d2c23c8dc3f484544aa854b507ada429adb9b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: bc-breaking Related to a BC-breaking change module: onnx Related to torch.onnx oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants