Skip to content

Commit

Permalink
upgrade to 2.2 (#8)
Browse files Browse the repository at this point in the history
* upgrade tf to 2.2
* pin protobuf to 3.12.2
  • Loading branch information
figroc authored Jul 4, 2020
1 parent b55bc49 commit cbb0674
Show file tree
Hide file tree
Showing 38 changed files with 212 additions and 138 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ addons:
- mono
- nuget
- pkg-config
- protobuf
- rust
casks:
- dotnet-sdk

before_install:
- |
git -C $(brew --repo homebrew/core) checkout f13bf9adadfe0525c2f4aaeb18b21c636bd7ce1a
brew unlink protobuf && HOMEBREW_NO_AUTO_UPDATE=1 brew install protobuf
git -C $(brew --repo homebrew/core) checkout master
before_cache:
- brew cleanup
- find /usr/local/Homebrew \! -regex ".+\.git.+" -delete
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Grpc tools are needed for building variant packages.

See `.travis.yml` for details.

*NOTE: grpc@1.26 and protobuf@3.11 are required*
*NOTE: grpc@1.30 and protobuf@3.12 are required*

Target | Command | Outputs | Artifacts
-------|-----------------|-------------|----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.0
18 changes: 12 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.11"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.12"
}
}

//---export-begin---//
ext {
vers = [tfs: file("VERSION").text.trim(),
jvm: "8",
grpc: "1.26.0",
proto: "3.11.0"]
grpc: "1.30.0",
proto: "3.12.0"]
dist = [build: "release",
name: [_: project.name,
title: project.name.tokenize("-").collect{it.capitalize()}.join(" "),
Expand All @@ -24,10 +24,10 @@ ext {
i == 0 ? ((v as int) + 1) : v
}.join("."),
node: "1.24.0",
rust: "0.4.6"],
rust: "0.6.0"],
proto: [_: vers.proto,
go: "1.3.2",
rust: "2.10.1"]],
go: "1.4.2",
rust: "2.14.0"]],
license: "Apache-2.0",
author: [_: "Figroc Chen <figroc@gmail.com>",
id: "figroc",
Expand Down Expand Up @@ -62,6 +62,12 @@ static def pathOfExecutable(name) {
return path.in.text.trim()
}

static def resultOfShellCode(cmd) {
def shell = "bash -c '${cmd}'".execute()
shell.waitFor()
return shell.in.text.trim()
}

apply from: "gradle/grpc.gradle"
apply from: "gradle/cmake.gradle"
apply from: "gradle/java.gradle"
Expand Down
2 changes: 1 addition & 1 deletion crate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.rs/${TFSCLIENT_NAME}"
categories = ["api-bindings", "science"]

[dependencies]
futures = "0.1.25"
futures = "0.3.5"
grpcio = "${TFSCLIENT_VERSION_GRPC_RUST}"
protobuf = "${TFSCLIENT_VERSION_PROTO_RUST}"

Expand Down
19 changes: 8 additions & 11 deletions gradle/golang.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ task generateProtoGo {
standardOutput file("${source}/go.mod").newOutputStream()
commandLine "envsubst"
}
fileTree(source){ include "*", "github.com/*" }.visit { fd ->
if (fd.file.file) return
if (fd.path == "github.com") return
copy {
from "${source}/go.mod"
into "${source}/${fd.path}"
filter { line ->
line.startsWith("module") ? "module ${fd.path}" : line
}
}
}
}
}

Expand Down Expand Up @@ -124,6 +113,14 @@ task finalizeProtoGo {
}
fileTree(source){ include "*" }.visit { fd ->
if (fd.file.file) return
copy {
from "${source}/go.mod"
into "${source}/${fd.path}"
filter { line ->
line.startsWith("module") ? "module ${fd.path}" : line
}
}
println("generate mod: ${fd.path}/go.mod")
file("${source}/go.mod").append("\nreplace ${fd.path} => ./${fd.path}\n")
}
exec {
Expand Down
10 changes: 2 additions & 8 deletions gradle/rust.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
task installProtocGenRust(type: Exec) {
onlyIf {
pathOfExecutable("protoc-gen-rust") == ""
}
commandLine "cargo", "install", "protobuf-codegen"
commandLine "cargo", "install", "--vers", dist.version.proto.rust, "protobuf-codegen"
}

task installGrpcRustPlugin(type: Exec) {
onlyIf {
pathOfExecutable("grpc_rust_plugin") == ""
}
commandLine "cargo", "install", "grpcio-compiler"
commandLine "cargo", "install", "--vers", dist.version.grpc.rust, "grpcio-compiler"
}

task generateProtoRust {
Expand Down
10 changes: 6 additions & 4 deletions proto/tensorflow/core/example/example.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// model training or inference.
syntax = "proto3";

package tensorflow;

import "tensorflow/core/example/feature.proto";

option cc_enable_arenas = true;
option java_outer_classname = "ExampleProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";

// An Example is a mostly-normalized data format for storing data for
// training and inference. It contains a key-value store (features); where
Expand Down Expand Up @@ -87,7 +89,7 @@ package tensorflow;

message Example {
Features features = 1;
};
}

// A SequenceExample is an Example representing one or more sequences, and
// some context. The context contains features which apply to the entire
Expand Down Expand Up @@ -298,4 +300,4 @@ message Example {
message SequenceExample {
Features context = 1;
FeatureLists feature_lists = 2;
};
}
14 changes: 8 additions & 6 deletions proto/tensorflow/core/example/feature.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@
//

syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "FeatureProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.example";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example";
package tensorflow;
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto";

// Containers to hold repeated fundamental values.
message BytesList {
Expand All @@ -80,12 +82,12 @@ message Feature {
FloatList float_list = 2;
Int64List int64_list = 3;
}
};
}

message Features {
// Map from feature name to feature.
map<string, Feature> feature = 1;
};
}

// Containers for sequential data.
//
Expand All @@ -97,9 +99,9 @@ message Features {
//
message FeatureList {
repeated Feature feature = 1;
};
}

message FeatureLists {
// Map from feature name to feature list.
map<string, FeatureList> feature_list = 1;
};
}
5 changes: 3 additions & 2 deletions proto/tensorflow/core/framework/allocation_description.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
syntax = "proto3";

package tensorflow;

option cc_enable_arenas = true;
option java_outer_classname = "AllocationDescriptionProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/allocation_description_go_proto";

message AllocationDescription {
// Total number of bytes requested
Expand All @@ -25,4 +26,4 @@ message AllocationDescription {

// Address of the allocation.
uint64 ptr = 6;
};
}
10 changes: 6 additions & 4 deletions proto/tensorflow/core/framework/attr_value.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/tensor.proto";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "AttrValueProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/tensor.proto";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/attr_value_go_proto";

// Protocol buffer representing the value for an attr used to configure an Op.
// Comment indicates the corresponding attr type. Only the field matching the
Expand Down
18 changes: 15 additions & 3 deletions proto/tensorflow/core/framework/cost_graph.proto
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";

option cc_enable_arenas = true;
option java_outer_classname = "CostGraphProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/tensor_shape.proto";
import "tensorflow/core/framework/types.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/cost_graph_go_proto";

message CostGraphDef {
message Node {
Expand Down Expand Up @@ -74,4 +76,14 @@ message CostGraphDef {
bool inaccurate = 17;
}
repeated Node node = 1;

// Total cost of this graph, typically used for balancing decisions.
message AggregatedCost {
// Aggregated cost value.
float cost = 1;

// Aggregated cost dimension (e.g. 'memory', 'compute', 'network').
string dimension = 2;
}
repeated AggregatedCost cost = 2;
}
21 changes: 17 additions & 4 deletions proto/tensorflow/core/framework/function.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/op_def.proto";

option cc_enable_arenas = true;
option java_outer_classname = "FunctionProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/op_def.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/function_go_proto";

// A library is a set of named functions.
message FunctionDefLibrary {
Expand Down Expand Up @@ -37,6 +39,17 @@ message FunctionDef {
}
map<uint32, ArgAttrs> arg_attr = 7;

// Unique IDs for each resource argument, used to track aliasing resources. If
// Argument A and Argument B alias each other, then
// resource_arg_unique_ids[A.index] == resource_arg_unique_ids[B.index].
//
// If this field is empty, none of the arguments could alias; otherwise, every
// resource argument should have an entry in this field.
//
// When instantiated, the unique IDs will be attached to the _Arg nodes'
// "_resource_arg_unique_id" attribute.
map<uint32, uint32> resource_arg_unique_id = 8;

// NOTE: field id 2 deleted on Jan 11, 2017, GraphDef version 21.
reserved 2;

Expand Down
12 changes: 7 additions & 5 deletions proto/tensorflow/core/framework/graph.proto
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/function.proto";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/versions.proto";

option cc_enable_arenas = true;
option java_outer_classname = "GraphProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/node_def.proto";
import "tensorflow/core/framework/function.proto";
import "tensorflow/core/framework/versions.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_proto";

// Represents the graph of operations
message GraphDef {
Expand Down Expand Up @@ -53,4 +55,4 @@ message GraphDef {
// consumer does not start until all return values of the callee
// function are ready.
FunctionDefLibrary library = 2;
};
}
10 changes: 6 additions & 4 deletions proto/tensorflow/core/framework/node_def.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
syntax = "proto3";

package tensorflow;

import "tensorflow/core/framework/attr_value.proto";

option cc_enable_arenas = true;
option java_outer_classname = "NodeProto";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
import "tensorflow/core/framework/attr_value.proto";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/node_def_go_proto";

message NodeDef {
// The name given to this operator. Used for naming inputs,
Expand Down Expand Up @@ -79,8 +81,8 @@ message NodeDef {
// `original_node_names` can be used to map errors originating at the
// current ndoe to some top level source code.
repeated string original_func_names = 2;
};
}

// This stores debug information associated with the node.
ExperimentalDebugInfo experimental_debug_info = 6;
};
}
2 changes: 1 addition & 1 deletion proto/tensorflow/core/framework/op_def.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ option cc_enable_arenas = true;
option java_outer_classname = "OpDefProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/op_def_go_proto";
import "tensorflow/core/framework/attr_value.proto";
import "tensorflow/core/framework/types.proto";

Expand Down
Loading

0 comments on commit cbb0674

Please sign in to comment.