Skip to content

Commit 31e82d6

Browse files
author
twitter-team
committed
improvements from external prs
-fix corner case where dr converter failed when initializing Closes #550
1 parent 23fa75d commit 31e82d6

31 files changed

+304
-243
lines changed

navi/dr_transform/src/all_config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ pub struct RenamedFeatures {
4444
}
4545

4646
pub fn parse(json_str: &str) -> Result<AllConfig, Error> {
47-
serde_json::from_str(json_str)
47+
let all_config: AllConfig = serde_json::from_str(json_str)?;
48+
Ok(all_config)
4849
}

navi/dr_transform/src/converter.rs

Lines changed: 146 additions & 116 deletions
Large diffs are not rendered by default.

navi/navi/proto/tensorflow/core/framework/full_type.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ enum FullTypeId {
122122
// TFT_TENSOR[TFT_INT32, TFT_UNKNOWN]
123123
// is a Tensor of int32 element type and unknown shape.
124124
//
125-
// TODO: Define TFT_SHAPE and add more examples.
125+
// TODO(mdan): Define TFT_SHAPE and add more examples.
126126
TFT_TENSOR = 1000;
127127

128128
// Array (or tensorflow::TensorList in the variant type registry).
@@ -178,7 +178,7 @@ enum FullTypeId {
178178
// object (for now).
179179

180180
// The bool element type.
181-
// TODO
181+
// TODO(mdan): Quantized types, legacy representations (e.g. ref)
182182
TFT_BOOL = 200;
183183
// Integer element types.
184184
TFT_UINT8 = 201;
@@ -195,7 +195,7 @@ enum FullTypeId {
195195
TFT_DOUBLE = 211;
196196
TFT_BFLOAT16 = 215;
197197
// Complex element types.
198-
// TODO: Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
198+
// TODO(mdan): Represent as TFT_COMPLEX[TFT_DOUBLE] instead?
199199
TFT_COMPLEX64 = 212;
200200
TFT_COMPLEX128 = 213;
201201
// The string element type.
@@ -240,7 +240,7 @@ enum FullTypeId {
240240
// ownership is in the true sense: "the op argument representing the lock is
241241
// available".
242242
// Mutex locks are the dynamic counterpart of control dependencies.
243-
// TODO: Properly document this thing.
243+
// TODO(mdan): Properly document this thing.
244244
//
245245
// Parametrization: TFT_MUTEX_LOCK[].
246246
TFT_MUTEX_LOCK = 10202;
@@ -271,6 +271,6 @@ message FullTypeDef {
271271
oneof attr {
272272
string s = 3;
273273
int64 i = 4;
274-
// TODO: list/tensor, map? Need to reconcile with TFT_RECORD, etc.
274+
// TODO(mdan): list/tensor, map? Need to reconcile with TFT_RECORD, etc.
275275
}
276276
}

navi/navi/proto/tensorflow/core/framework/function.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ message FunctionDefLibrary {
2323
// with a value. When a GraphDef has a call to a function, it must
2424
// have binding for every attr defined in the signature.
2525
//
26-
// TODO:
26+
// TODO(zhifengc):
2727
// * device spec, etc.
2828
message FunctionDef {
2929
// The definition of the function's name, arguments, return values,

navi/navi/proto/tensorflow/core/framework/node_def.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ message NodeDef {
6161
// one of the names from the corresponding OpDef's attr field).
6262
// The values must have a type matching the corresponding OpDef
6363
// attr's type field.
64-
// TODO: Add some examples here showing best practices.
64+
// TODO(josh11b): Add some examples here showing best practices.
6565
map<string, AttrValue> attr = 5;
6666

6767
message ExperimentalDebugInfo {

navi/navi/proto/tensorflow/core/framework/op_def.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ message OpDef {
9696
// Human-readable description.
9797
string description = 4;
9898

99-
// TODO: bool is_optional?
99+
// TODO(josh11b): bool is_optional?
100100

101101
// --- Constraints ---
102102
// These constraints are only in effect if specified. Default is no
@@ -139,7 +139,7 @@ message OpDef {
139139
// taking input from multiple devices with a tree of aggregate ops
140140
// that aggregate locally within each device (and possibly within
141141
// groups of nearby devices) before communicating.
142-
// TODO: Implement that optimization.
142+
// TODO(josh11b): Implement that optimization.
143143
bool is_aggregate = 16; // for things like add
144144

145145
// Other optimizations go here, like

navi/navi/proto/tensorflow/core/framework/step_stats.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ message MemoryStats {
5353

5454
// Time/size stats recorded for a single execution of a graph node.
5555
message NodeExecStats {
56-
// TODO: Use some more compact form of node identity than
56+
// TODO(tucker): Use some more compact form of node identity than
5757
// the full string name. Either all processes should agree on a
5858
// global id (cost_id?) for each node, or we should use a hash of
5959
// the name.

navi/navi/proto/tensorflow/core/framework/tensor.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framewo
1616
message TensorProto {
1717
DataType dtype = 1;
1818

19-
// Shape of the tensor. TODO: sort out the 0-rank issues.
19+
// Shape of the tensor. TODO(touts): sort out the 0-rank issues.
2020
TensorShapeProto tensor_shape = 2;
2121

2222
// Only one of the representations below is set, one of "tensor_contents" and

navi/navi/proto/tensorflow/core/protobuf/config.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ message ConfigProto {
532532

533533
// We removed the flag client_handles_error_formatting. Marking the tag
534534
// number as reserved.
535-
// TODO: Should we just remove this tag so that it can be
535+
// TODO(shikharagarwal): Should we just remove this tag so that it can be
536536
// used in future for other purpose?
537537
reserved 2;
538538

@@ -576,7 +576,7 @@ message ConfigProto {
576576
// - If isolate_session_state is true, session states are isolated.
577577
// - If isolate_session_state is false, session states are shared.
578578
//
579-
// TODO: Add a single API that consistently treats
579+
// TODO(b/129330037): Add a single API that consistently treats
580580
// isolate_session_state and ClusterSpec propagation.
581581
bool share_session_state_in_clusterspec_propagation = 8;
582582

@@ -704,7 +704,7 @@ message ConfigProto {
704704

705705
// Options for a single Run() call.
706706
message RunOptions {
707-
// TODO Turn this into a TraceOptions proto which allows
707+
// TODO(pbar) Turn this into a TraceOptions proto which allows
708708
// tracing to be controlled in a more orthogonal manner?
709709
enum TraceLevel {
710710
NO_TRACE = 0;
@@ -781,7 +781,7 @@ message RunMetadata {
781781
repeated GraphDef partition_graphs = 3;
782782

783783
message FunctionGraphs {
784-
// TODO: Include some sort of function/cache-key identifier?
784+
// TODO(nareshmodi): Include some sort of function/cache-key identifier?
785785
repeated GraphDef partition_graphs = 1;
786786

787787
GraphDef pre_optimization_graph = 2;

navi/navi/proto/tensorflow/core/protobuf/coordination_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ service CoordinationService {
194194

195195
// Report error to the task. RPC sets the receiving instance of coordination
196196
// service agent to error state permanently.
197-
// TODO: Consider splitting this into a different RPC service.
197+
// TODO(b/195990880): Consider splitting this into a different RPC service.
198198
rpc ReportErrorToAgent(ReportErrorToAgentRequest)
199199
returns (ReportErrorToAgentResponse);
200200

0 commit comments

Comments
 (0)