MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / CloneGraphToMultiDevices

Method CloneGraphToMultiDevices

paddle/fluid/framework/compiled_program.cc:783–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783std::vector<ir::Graph *> CompiledProgram::CloneGraphToMultiDevices(
784 ir::Graph *graph) {
785 std::vector<ir::Graph *> graphs;
786 if (member_->build_strategy_.async_mode_) {
787 PADDLE_ENFORCE_EQ(member_->IsUseCUDA(member_->use_device_),
788 false,
789 common::errors::Unavailable(
790 "gpu mode does not support async_mode_ now!"));
791 graphs.push_back(graph);
792 for (size_t i = 1; i < member_->places_.size(); ++i) {
793 auto *tmp_graph = new ir::Graph(graph->OriginProgram());
794 graphs.push_back(tmp_graph);
795 }
796 }
797
798 return graphs;
799}
800
801void CompiledProgram::PrepareNCCLCommunicator(Scope *global_scope) {
802 if (member_->build_strategy_.reduce_ ==

Callers

nothing calls this directly

Calls 3

IsUseCUDAMethod · 0.80
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected