Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Conversation

@reedwm
Copy link
Contributor

@reedwm reedwm commented Sep 3, 2020

This RFC will be open for comment until October 14, 2020. The comment period is longer than usual in order to give a lot of time to investigate and test TF32.

Enabling TensorFloat-32 by default

Status Proposed
RFC # 287
Author(s) Reed Wanderman-Milne (reedwm@google.com)
Sponsor Sanjoy Das (sanjoy@google.com)
Updated 2020-09-03

Objective

Enable TensorFloat-32 by default.

This will improve performance but lower numeric precision for certain ops like matmul and convolutions by default.


## Design Proposal

The design is to flip the default value of [`tf.config.experimental.enable_tensor_float_32_execution`](https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_tensor_float_32_execution) from False to True.
Copy link

Choose a reason for hiding this comment

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

Would it be practical to provide a user control for setting the default type with a global toggle, for all numerical ops? That might be useful in case there isn't a one-size-fits-all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is somewhat orthogonal to TensorFloat-32, since TF32 is not a TensorFlow dtype. Even with TF32 enabled, tf.linalg.matmul outputs float32 tensors when passed float32 inputs. The only effect of TF32 is increased performance and inputs to ops like matmul are rounded from 23 bits of precision to 10 bits of precision.

There should be an API to set the default dtype for ops like tf.ones that don't take an input tensor. But I think ops like matmul should continue to unconditionally output tensors of the same dtype as the inputs.

reedwm and others added 2 commits October 14, 2020 11:50
This section summarizes what was discussed during the design review.
@ematejska
Copy link

Design Reive Notes were added to the RFC document. This is accepted.

@ematejska ematejska added RFC: Accepted RFC Design Document: Accepted by Review and removed RFC: Proposed RFC Design Document labels Oct 16, 2020
@ematejska ematejska merged commit 7a21081 into tensorflow:master Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes RFC: Accepted RFC Design Document: Accepted by Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants