| 781 | } |
| 782 | |
| 783 | std::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 | |
| 801 | void CompiledProgram::PrepareNCCLCommunicator(Scope *global_scope) { |
| 802 | if (member_->build_strategy_.reduce_ == |