Skip to content

Conversation

@virajbshah
Copy link
Contributor

  • Instruction annotations are currently stored as floats in the C++ graph builder.
  • This matches the type currently used by the models (tf.dtypes.float32), but not the proto storage type (double).
  • For consistency, store annotations as doubles at the C++ end, then narrow down to the type the models use.

 * Factor out the per-instruction add to graph logic.
 * This change is in preparation for further changes to the graph
   construction logic.
 * Specifically, this should make the trace graph construction
   logic cleaner.
 * Move annotation adding logic to `AddInstructionAnnotations`.
 * Remove default annotation magic number.
 * Instruction annotations are currently stored as `float`s in the C++
   parts of the codebase.
 * This matches the type currently used by the models
   (`tf.dtypes.float32`), but not the proto storage type (`double`).
 * For consistency, store annotations as `double`s at the C++ end,
   then cast them to whatever type the models require.
Copy link
Collaborator

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

What's the benefit of doing the narrowing to float later versus earlier? It doesn't seem like this patch really enables anything and it will increase memory consumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants