#pragma once #include #include #include #include namespace torch { namespace distributed { namespace rpc { class TORCH_API RequestCallbackImpl : public RequestCallbackNoPython { public: std::unique_ptr deserializePythonRpcCommand( std::unique_ptr rpc, const MessageType& messageType) const override; c10::intrusive_ptr processPythonCall( RpcCommandBase& rpc) const override; c10::intrusive_ptr processScriptCall( RpcCommandBase& rpc) const override; c10::intrusive_ptr processScriptRemoteCall( RpcCommandBase& rpc) const override; c10::intrusive_ptr processPythonRemoteCall( RpcCommandBase& rpc, std::shared_ptr ctx) const override; void processPythonRRefFetchCall( RpcCommandBase& rpc, const c10::intrusive_ptr& responseFuture, std::shared_ptr ctx) const override; void handleRRefDelete(c10::intrusive_ptr& rref) const override; c10::intrusive_ptr processRpcWithErrors( RpcCommandBase& rpc, const MessageType& messageType, std::shared_ptr ctx) const override; bool cudaAvailable() const override; void processRRefBackward( RpcCommandBase& rpc, const c10::intrusive_ptr& responseFuture) const override; // Helpers to run user-defined functions, operators and other computations. c10::intrusive_ptr runJitFunction( const c10::QualifiedName& name, std::vector& stack, bool isAsyncExecution) const; c10::intrusive_ptr runPythonFunction( const py::object& function, bool isAsyncExecution) const; }; } // namespace rpc } // namespace distributed } // namespace torch