We use bazel 3 as part of large monorepo to integrate with torch.  In order to support large amounts of concurrent builds, we must execute our build actions remotely and this entails serializing the files needed for the build action.  However, protobuf serialization has a hard limit of 2gb which makes the libtorch_cuda.so unable to be used remotely, which in turn makes many actions in our repository unable to execute remotely.  Running these actions locally would be very bad for build performance, so I was looking for ways to shrink libtorch_cuda.so.
I tried stripping out debug symbols:
strip --strip-debug libtorch_cuda.so
strip --strip-unneeded libtorch_cuda.so
no effect.
Do you have any suggestions?