#include "cpp_c10d_extension.hpp" #include namespace c10d { ProcessGroupTest::WorkTest::~WorkTest() {} bool ProcessGroupTest::WorkTest::isCompleted() { return true; } bool ProcessGroupTest::WorkTest::isSuccess() const { return true; } bool ProcessGroupTest::WorkTest::wait(std::chrono::milliseconds /* unused */) { return true; } ProcessGroupTest::ProcessGroupTest(int rank, int size) : ProcessGroup(rank, size) {} ProcessGroupTest::~ProcessGroupTest() {} c10::intrusive_ptr ProcessGroupTest::broadcast( std::vector& tensors, const BroadcastOptions& opts) { return c10::make_intrusive(); } c10::intrusive_ptr ProcessGroupTest::allreduce( std::vector& tensors, const AllreduceOptions& opts) { return c10::make_intrusive(); } c10::intrusive_ptr ProcessGroupTest::allreduce_coalesced( std::vector& tensors, const AllreduceCoalescedOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support allreduce_coalesced"); } c10::intrusive_ptr ProcessGroupTest::reduce( std::vector& tensors, const ReduceOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support reduce"); } c10::intrusive_ptr ProcessGroupTest::allgather( std::vector>& outputTensors, std::vector& inputTensors, const AllgatherOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support allgather"); } c10::intrusive_ptr ProcessGroupTest::_allgather_base( at::Tensor& outputBuffer, at::Tensor& inputBuffer, const AllgatherOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support _allgather_base"); } c10::intrusive_ptr ProcessGroupTest::barrier( const BarrierOptions& opts) { return c10::make_intrusive(); } c10::intrusive_ptr ProcessGroupTest::gather( std::vector>& outputTensors, std::vector& inputTensors, const GatherOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support gather"); } c10::intrusive_ptr ProcessGroupTest::scatter( std::vector& outputTensors, std::vector>& inputTensors, const ScatterOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support scatter"); } c10::intrusive_ptr ProcessGroupTest::reduce_scatter( std::vector& outputTensors, std::vector>& inputTensors, const ReduceScatterOptions& opts) { throw std::runtime_error("ProcessGroupTest does not support reduce_scatter"); } c10::intrusive_ptr ProcessGroupTest::send( std::vector& tensors, int dstRank, int tag) { throw std::runtime_error("ProcessGroupTest does not support send"); } c10::intrusive_ptr ProcessGroupTest::recv( std::vector& tensors, int srcRank, int tag) { throw std::runtime_error("ProcessGroupTest does not support recv"); } c10::intrusive_ptr ProcessGroupTest::recvAnysource( std::vector& tensor, int tag) { throw std::runtime_error("ProcessGroupTest does not support recvAnysource"); } c10::intrusive_ptr ProcessGroupTest::createProcessGroupTest( const c10::intrusive_ptr<::c10d::Store>& store, int rank, int size, const std::chrono::duration& timeout) { return c10::make_intrusive(rank, size); } PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { m.def("createProcessGroupTest", &ProcessGroupTest::createProcessGroupTest); } } // namespace c10d