Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into my-cool-stuff
commit
1560eb4a6d
@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
IF(MOBILE_INFERENCE)
|
||||
return()
|
||||
ENDIF()
|
||||
|
||||
include (ExternalProject)
|
||||
|
||||
# NOTE: gzstream is needed when linking with ctr reader.
|
||||
|
||||
SET(GZSTREAM_SOURCES_DIR ${THIRD_PARTY_PATH}/gzstream)
|
||||
SET(GZSTREAM_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gzstream)
|
||||
SET(GZSTREAM_INCLUDE_DIR "${GZSTREAM_INSTALL_DIR}/include/" CACHE PATH "gzstream include directory." FORCE)
|
||||
|
||||
ExternalProject_Add(
|
||||
extern_gzstream
|
||||
DEPENDS zlib
|
||||
GIT_REPOSITORY "https://github.com/jacquesqiao/gzstream.git"
|
||||
GIT_TAG ""
|
||||
PREFIX ${GZSTREAM_SOURCES_DIR}
|
||||
UPDATE_COMMAND ""
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
BUILD_COMMAND make EXTERN_CPPFLAGS="-I${THIRD_PARTY_PATH}/install/zlib/include" EXTERM_LDFLAGS="-L${THIRD_PARTY_PATH}/install/zlib/lib" -j8
|
||||
INSTALL_COMMAND mkdir -p ${GZSTREAM_INSTALL_DIR}/lib/ && mkdir -p ${GZSTREAM_INSTALL_DIR}/include/
|
||||
&& cp ${GZSTREAM_SOURCES_DIR}/src/extern_gzstream/libgzstream.a ${GZSTREAM_INSTALL_DIR}/lib
|
||||
&& cp -r ${GZSTREAM_SOURCES_DIR}/src/extern_gzstream/gzstream.h ${GZSTREAM_INSTALL_DIR}/include
|
||||
)
|
||||
|
||||
ADD_LIBRARY(gzstream STATIC IMPORTED GLOBAL)
|
||||
SET_PROPERTY(TARGET gzstream PROPERTY IMPORTED_LOCATION
|
||||
"${GZSTREAM_INSTALL_DIR}/lib/libgzstream.a")
|
||||
|
||||
include_directories(${GZSTREAM_INCLUDE_DIR})
|
||||
ADD_DEPENDENCIES(gzstream extern_gzstream zlib)
|
@ -0,0 +1,138 @@
|
||||
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License. */
|
||||
|
||||
#include "paddle/fluid/framework/async_executor.h"
|
||||
#include "google/protobuf/io/zero_copy_stream_impl.h"
|
||||
#include "google/protobuf/message.h"
|
||||
#include "google/protobuf/text_format.h"
|
||||
|
||||
#include "gflags/gflags.h"
|
||||
#include "paddle/fluid/framework/data_feed_factory.h"
|
||||
#include "paddle/fluid/framework/executor_thread_worker.h"
|
||||
#include "paddle/fluid/framework/feed_fetch_method.h"
|
||||
#include "paddle/fluid/framework/feed_fetch_type.h"
|
||||
#include "paddle/fluid/framework/lod_rank_table.h"
|
||||
#include "paddle/fluid/framework/lod_tensor_array.h"
|
||||
#include "paddle/fluid/framework/op_registry.h"
|
||||
#include "paddle/fluid/framework/reader.h"
|
||||
#include "paddle/fluid/inference/io.h"
|
||||
#include "paddle/fluid/platform/place.h"
|
||||
#include "paddle/fluid/pybind/pybind.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
AsyncExecutor::AsyncExecutor(Scope* scope, const platform::Place& place)
|
||||
: root_scope_(scope), place_(place) {}
|
||||
|
||||
void AsyncExecutor::CreateThreads(
|
||||
ExecutorThreadWorker* worker, const ProgramDesc& main_program,
|
||||
const std::shared_ptr<DataFeed>& reader,
|
||||
const std::vector<std::string>& fetch_var_names, Scope* root_scope,
|
||||
const int thread_index, const bool debug) {
|
||||
worker->SetThreadId(thread_index);
|
||||
worker->SetDebug(debug);
|
||||
worker->SetRootScope(root_scope);
|
||||
worker->CreateThreadResource(main_program, place_);
|
||||
worker->SetDataFeed(reader);
|
||||
worker->SetFetchVarNames(fetch_var_names);
|
||||
worker->BindingDataFeedMemory();
|
||||
}
|
||||
|
||||
void PrepareReaders(std::vector<std::shared_ptr<DataFeed>>& readers, // NOLINT
|
||||
const int thread_num, const DataFeedDesc& data_feed_desc,
|
||||
const std::vector<std::string>& filelist) {
|
||||
readers.resize(thread_num);
|
||||
for (size_t i = 0; i < readers.size(); ++i) {
|
||||
readers[i] = DataFeedFactory::CreateDataFeed(data_feed_desc.name());
|
||||
readers[i]->Init(data_feed_desc); // set batch_size and queue_size here
|
||||
}
|
||||
readers[0]->SetFileList(filelist);
|
||||
}
|
||||
|
||||
void AsyncExecutor::RunFromFile(const ProgramDesc& main_program,
|
||||
const std::string& data_feed_desc_str,
|
||||
const std::vector<std::string>& filelist,
|
||||
const int thread_num,
|
||||
const std::vector<std::string>& fetch_var_names,
|
||||
const bool debug) {
|
||||
std::vector<std::thread> threads;
|
||||
|
||||
auto& block = main_program.Block(0);
|
||||
for (auto var_name : fetch_var_names) {
|
||||
auto var_desc = block.FindVar(var_name);
|
||||
auto shapes = var_desc->GetShape();
|
||||
PADDLE_ENFORCE(shapes[shapes.size() - 1] == 1,
|
||||
"var %s: Fetched var has wrong shape, "
|
||||
"only variables with the last dimension size 1 supported",
|
||||
var_name);
|
||||
}
|
||||
|
||||
DataFeedDesc data_feed_desc;
|
||||
google::protobuf::TextFormat::ParseFromString(data_feed_desc_str,
|
||||
&data_feed_desc);
|
||||
|
||||
int actual_thread_num = thread_num;
|
||||
int file_cnt = filelist.size();
|
||||
PADDLE_ENFORCE(file_cnt > 0, "File list cannot be empty");
|
||||
|
||||
if (actual_thread_num > file_cnt) {
|
||||
VLOG(1) << "Thread num = " << thread_num << ", file num = " << file_cnt
|
||||
<< ". Changing thread_num = " << file_cnt;
|
||||
actual_thread_num = file_cnt;
|
||||
}
|
||||
|
||||
/*
|
||||
readerDesc: protobuf description for reader initlization
|
||||
argument: class_name, batch_size, use_slot, queue_size, buffer_size,
|
||||
padding_index
|
||||
|
||||
reader:
|
||||
1) each thread has a reader, reader will read input data and
|
||||
put it into input queue
|
||||
2) each reader has a Next() iterface, that can fetch an instance
|
||||
from the input queue
|
||||
*/
|
||||
// todo: should be factory method for creating datafeed
|
||||
std::vector<std::shared_ptr<DataFeed>> readers;
|
||||
PrepareReaders(readers, actual_thread_num, data_feed_desc, filelist);
|
||||
|
||||
std::vector<std::shared_ptr<ExecutorThreadWorker>> workers;
|
||||
workers.resize(actual_thread_num);
|
||||
for (auto& worker : workers) {
|
||||
worker.reset(new ExecutorThreadWorker);
|
||||
}
|
||||
|
||||
// prepare thread resource here
|
||||
for (int thidx = 0; thidx < actual_thread_num; ++thidx) {
|
||||
CreateThreads(workers[thidx].get(), main_program, readers[thidx],
|
||||
fetch_var_names, root_scope_, thidx, debug);
|
||||
}
|
||||
|
||||
// start executing ops in multiple threads
|
||||
for (int thidx = 0; thidx < actual_thread_num; ++thidx) {
|
||||
threads.push_back(
|
||||
std::thread(&ExecutorThreadWorker::TrainFiles, workers[thidx].get()));
|
||||
}
|
||||
|
||||
for (auto& th : threads) {
|
||||
th.join();
|
||||
}
|
||||
|
||||
root_scope_->DropKids();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
} // einit_modelnd namespace framework
|
||||
} // end namespace paddle
|
@ -0,0 +1,58 @@
|
||||
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex> // NOLINT
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <thread> // NOLINT
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
#include "paddle/fluid/framework/data_feed.pb.h"
|
||||
#include "paddle/fluid/framework/executor.h"
|
||||
#include "paddle/fluid/framework/executor_thread_worker.h"
|
||||
#include "paddle/fluid/framework/program_desc.h"
|
||||
#include "paddle/fluid/framework/scope.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
class AsyncExecutor {
|
||||
public:
|
||||
AsyncExecutor(Scope* scope, const platform::Place& place);
|
||||
virtual ~AsyncExecutor() {}
|
||||
void RunFromFile(const ProgramDesc& main_program,
|
||||
const std::string& data_feed_desc_str,
|
||||
const std::vector<std::string>& filelist,
|
||||
const int thread_num,
|
||||
const std::vector<std::string>& fetch_names,
|
||||
const bool debug = false);
|
||||
|
||||
private:
|
||||
void CreateThreads(ExecutorThreadWorker* worker,
|
||||
const ProgramDesc& main_program,
|
||||
const std::shared_ptr<DataFeed>& reader,
|
||||
const std::vector<std::string>& fetch_var_names,
|
||||
Scope* root_scope, const int thread_index,
|
||||
const bool debug);
|
||||
|
||||
public:
|
||||
Scope* root_scope_;
|
||||
platform::Place place_;
|
||||
};
|
||||
|
||||
} // namespace framework
|
||||
} // namespace paddle
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,30 @@
|
||||
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License. */
|
||||
syntax = "proto2";
|
||||
package paddle.framework;
|
||||
|
||||
message Slot {
|
||||
required string name = 1;
|
||||
required string type = 2;
|
||||
optional bool is_dense = 3 [ default = false ];
|
||||
optional bool is_used = 4 [ default = false ];
|
||||
}
|
||||
|
||||
message MultiSlotDesc { repeated Slot slots = 1; }
|
||||
|
||||
message DataFeedDesc {
|
||||
optional string name = 1;
|
||||
optional int32 batch_size = 2 [ default = 32 ];
|
||||
optional MultiSlotDesc multi_slot_desc = 3;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License. */
|
||||
|
||||
#include "paddle/fluid/framework/data_feed_factory.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "paddle/fluid/framework/data_feed.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
typedef std::shared_ptr<DataFeed> (*Createdata_feedFunction)();
|
||||
typedef std::unordered_map<std::string, Createdata_feedFunction> data_feedMap;
|
||||
data_feedMap g_data_feed_map;
|
||||
|
||||
#define REGISTER_DATAFEED_CLASS(data_feed_class) \
|
||||
namespace { \
|
||||
std::shared_ptr<DataFeed> Creator_##data_feed_class() { \
|
||||
return std::shared_ptr<DataFeed>(new data_feed_class); \
|
||||
} \
|
||||
class __Registerer_##data_feed_class { \
|
||||
public: \
|
||||
__Registerer_##data_feed_class() { \
|
||||
g_data_feed_map[#data_feed_class] = &Creator_##data_feed_class; \
|
||||
} \
|
||||
}; \
|
||||
__Registerer_##data_feed_class g_registerer_##data_feed_class; \
|
||||
} // namespace
|
||||
|
||||
std::string DataFeedFactory::DataFeedTypeList() {
|
||||
std::string data_feed_types;
|
||||
for (auto iter = g_data_feed_map.begin(); iter != g_data_feed_map.end();
|
||||
++iter) {
|
||||
if (iter != g_data_feed_map.begin()) {
|
||||
data_feed_types += ", ";
|
||||
}
|
||||
data_feed_types += iter->first;
|
||||
}
|
||||
return data_feed_types;
|
||||
}
|
||||
|
||||
std::shared_ptr<DataFeed> DataFeedFactory::CreateDataFeed(
|
||||
std::string data_feed_class) {
|
||||
if (g_data_feed_map.count(data_feed_class) < 1) {
|
||||
exit(-1);
|
||||
}
|
||||
return g_data_feed_map[data_feed_class]();
|
||||
}
|
||||
|
||||
REGISTER_DATAFEED_CLASS(MultiSlotDataFeed);
|
||||
} // namespace framework
|
||||
} // namespace paddle
|
@ -0,0 +1,29 @@
|
||||
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "paddle/fluid/framework/data_feed.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
class DataFeedFactory {
|
||||
public:
|
||||
static std::string DataFeedTypeList();
|
||||
static std::shared_ptr<DataFeed> CreateDataFeed(std::string data_feed_class);
|
||||
};
|
||||
} // namespace framework
|
||||
} // namespace paddle
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,125 @@
|
||||
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "paddle/fluid/framework/details/all_reduce_deps_pass.h"
|
||||
#include "paddle/fluid/framework/details/all_reduce_op_handle.h"
|
||||
#include "paddle/fluid/framework/details/multi_devices_helper.h"
|
||||
#include "paddle/fluid/framework/details/op_graph_view.h"
|
||||
#include "paddle/fluid/framework/details/var_handle.h"
|
||||
#include "paddle/fluid/framework/ir/graph_helper.h"
|
||||
#include "paddle/fluid/framework/op_proto_maker.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
namespace details {
|
||||
|
||||
static constexpr char kAllOpDescs[] = "all_op_descs";
|
||||
|
||||
VarHandle* GetValidInput(const OpHandleBase* a) {
|
||||
for (auto p : a->Inputs()) {
|
||||
VarHandle* b = dynamic_cast<VarHandle*>(p);
|
||||
if (b) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<ir::Graph> AllReduceDepsPass::ApplyImpl(
|
||||
std::unique_ptr<ir::Graph> graph) const {
|
||||
auto graph_ops = ir::FilterByNodeWrapper<OpHandleBase>(*graph);
|
||||
|
||||
// get vars order
|
||||
int order = 0;
|
||||
std::unordered_map<std::string, int> vars;
|
||||
// TODO(gongwb): use graph topology sort to find the order of operators.
|
||||
// Note that must assert topology sort is stable
|
||||
auto& ops = Get<const std::vector<OpDesc*>>(kAllOpDescs);
|
||||
for (auto* op_desc : ops) {
|
||||
auto outputs = op_desc->Outputs();
|
||||
for (auto& o_it : outputs) {
|
||||
for (auto& v : o_it.second) { // values
|
||||
vars[v] = order;
|
||||
}
|
||||
}
|
||||
order++;
|
||||
}
|
||||
|
||||
std::vector<OpHandleBase*> dist_ops;
|
||||
// get allreduce ops.
|
||||
for (auto& op : graph_ops) {
|
||||
// FIXME(gongwb):add broad cast.
|
||||
if (op->Name() == "all_reduce" || op->Name() == "reduce") {
|
||||
dist_ops.push_back(op);
|
||||
}
|
||||
}
|
||||
|
||||
VLOG(10) << "dist_ops size:" << dist_ops.size() << std::endl;
|
||||
|
||||
std::sort(dist_ops.begin(), dist_ops.end(), [&](OpHandleBase* op1,
|
||||
OpHandleBase* op2) {
|
||||
VarHandle* i0 = dynamic_cast<VarHandle*>(GetValidInput(op1));
|
||||
VarHandle* i1 = dynamic_cast<VarHandle*>(GetValidInput(op2));
|
||||
|
||||
PADDLE_ENFORCE(i0 != nullptr && i1 != nullptr, "%s convert to %s error",
|
||||
op1->DebugString(), op2->DebugString());
|
||||
|
||||
auto l_it = vars.find(i0->name_);
|
||||
auto r_it = vars.find(i1->name_);
|
||||
|
||||
if (l_it->second < r_it->second) return true;
|
||||
|
||||
if (l_it->second == r_it->second) {
|
||||
return i0->name_ < i1->name_;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// add dependency.
|
||||
auto& sorted_ops = dist_ops;
|
||||
for (size_t i = 1; i < sorted_ops.size(); ++i) {
|
||||
auto* dep_var = new DummyVarHandle(graph->CreateControlDepVar());
|
||||
|
||||
auto* pre_op = sorted_ops[i - 1];
|
||||
auto* op = sorted_ops[i];
|
||||
|
||||
pre_op->AddOutput(dep_var);
|
||||
op->AddInput(dep_var);
|
||||
graph->Get<GraphDepVars>(kGraphDepVars).emplace(dep_var);
|
||||
|
||||
VLOG(10) << "add all_reduce sequential dependencies between " << pre_op
|
||||
<< " and " << op;
|
||||
|
||||
VLOG(10) << "pre_op:" << pre_op->DebugString()
|
||||
<< ", op:" << op->DebugString();
|
||||
}
|
||||
|
||||
return graph;
|
||||
}
|
||||
|
||||
} // namespace details
|
||||
} // namespace framework
|
||||
} // namespace paddle
|
||||
|
||||
REGISTER_PASS(all_reduce_deps_pass,
|
||||
paddle::framework::details::AllReduceDepsPass)
|
||||
.RequirePassAttr(paddle::framework::details::kAllOpDescs);
|
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "paddle/fluid/framework/ir/graph.h"
|
||||
#include "paddle/fluid/framework/ir/pass.h"
|
||||
|
||||
namespace paddle {
|
||||
namespace framework {
|
||||
namespace details {
|
||||
|
||||
// TODO(gongwb): overlap allreduce with backward computation.
|
||||
class AllReduceDepsPass : public ir::Pass {
|
||||
protected:
|
||||
std::unique_ptr<ir::Graph> ApplyImpl(
|
||||
std::unique_ptr<ir::Graph> graph) const override;
|
||||
};
|
||||
|
||||
} // namespace details
|
||||
} // namespace framework
|
||||
} // namespace paddle
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue