About how grpc works on tensorflow?

Hi guys, I am recently doing research about how gRPC works on TensorFlow and the possibility to replace it with a specific gRPC I download from the official gRPC github repo. Does anyone know how TensorFlow configs the gRPC components and what kind of stuff I need to change? Thank you!

I wouldnā€™t consider myself a TF build expert and there may be a better way to do this. The GRPC dependency is defined here: tensorflow/tensorflow/workspace2.bzl at master Ā· tensorflow/tensorflow Ā· GitHub

You can clone the repository and replace the URLs with whatever specific release you want. Make sure you also replace the sha256 with the matching one as well.

Once you change the version, you can follow the directions to build TF from source. No guarantees that changing the GRPC version will work correctly when building TF master.

3 Likes

It is quite common:

1 Like

Thank you so much Sean, Iā€™ll try it on weekend. Iā€™ll keep my post updated.

You might need to update both GRPC and protobuf dependencies, as GRPC might come with a version of protobuf and these 2 versions need to be exactly the same

2 Likes

Yeah I know what you are saying but I am just exploring the possibility of replace tensorflowā€™s default gRPC with another reformed gRPC.

Hi Sean! Quick update. The goal is to try to replace the original one with a local gRPC. Not by replacing a URL to do so. Could you please give me some hints about it? Thank you so much!

So I update a local Grpc. For example, if I optimize Grpc and have a backup on my pc. How should I make it works on tensorflow. Sorry my question might be a little confusing and any help would be appreciated.

@Haoran_Jiang That shouldnā€™t be a problem! You can use Bazel to specify a local repository:

https://docs.bazel.build/versions/main/external.html#depending-on-other-bazel-projects

So you can replace tf_http_archive with the local repository rule as a stand in. There might be some additional troubleshooting beyond just specifying the local repository path, but this should be a start.

1 Like

Thank you so much Sean. Iā€™ll try it tomorrow and hopefully, I can update my post tomorrow. Anyway, thank you so much for your help!

Hi Sean, I tried your way but itā€™s not working. Because our campus is using nsf file system and I canā€™t build tensorflow from the source code. There is a bug of bazel. Thank you!