Skip to content
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

Fix funcdef lookup in auto_mixed_precision grappler pass #30140

Merged
merged 1 commit into from Jul 1, 2019

Conversation

benbarsdell
Copy link
Contributor

Non-inlined funcdefs only exist in the graph's function registry instead of the global op registry. Such ops (e.g., tf.nn.swish) previously caused the auto_mixed_precision grappler pass to fail.

This commit also adds a test for such cases.

attn @reedwm
cc @nluehr

- Non-inlined funcdefs only exist in the graph's function registry
  instead of the global op registry. Such ops (e.g., tf.nn.swish)
  previously caused the auto_mixed_precision grappler pass to fail.
- This commit also adds a test for such cases.
@tensorflow-bot tensorflow-bot bot added the size:M CL Change Size: Medium label Jun 25, 2019
@rthadur rthadur self-assigned this Jun 25, 2019
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Jun 25, 2019
@rthadur rthadur requested a review from reedwm June 25, 2019 17:34
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jun 25, 2019
@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jun 25, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jun 25, 2019
@yifeif yifeif merged commit 30b268b into tensorflow:master Jul 1, 2019
PR Queue automation moved this from Approved by Reviewer to Merged Jul 1, 2019
pull bot pushed a commit to Pandinosaurus/tensorflow that referenced this pull request Jul 1, 2019
@cklsoft
Copy link

cklsoft commented Jul 10, 2019

@benbarsdell Will auto_mixed_precision do the automatic loss scaling? We only need to set auto_mixed_precision=True in ConfigProto?

@nluehr
Copy link
Contributor

nluehr commented Jul 10, 2019

Loss scaling is not implemented within the grappler graph optimizer. Setting auto_mixed_precision=True in ConfigProto will convert FP32 ops in your graph to fp16, but will not insert the additional operations to implement loss scaling.

You can enable both loss scaling and the graph optimizer by wrapping your optimizer in tf.train.experimental.enable_mixed_precision_graph_rewrite(). See https://www.tensorflow.org/api_docs/python/tf/train/experimental/enable_mixed_precision_graph_rewrite for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:M CL Change Size: Medium
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

8 participants