[reland] Add some TORCH_API annotations to RPC (#60169)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60169
Reland of #59939.
ghstack-source-id: 131706861
Test Plan: CI
Reviewed By: mrshenli
Differential Revision: D29193233
fbshipit-source-id: 91d3ef9003b9da7b99e1b9310b7f5a6c505d3b99