-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
295 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
proto_library(fleet_executor_desc_proto SRCS fleet_executor_desc.proto) | ||
cc_library(fleet_executor SRCS fleet_executor.cc DEPS fleet_executor_desc_proto) | ||
|
||
if(WITH_PYTHON) | ||
py_proto_compile(fleet_executor_desc_py_proto SRCS fleet_executor_desc.proto) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) 2021 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/distributed/fleet_executor/fleet_executor.h" | ||
#include "paddle/fluid/distributed/fleet_executor/runtime_graph.h" | ||
#include "paddle/fluid/framework/program_desc.h" | ||
|
||
namespace paddle { | ||
namespace distributed { | ||
|
||
FleetExecutor::FleetExecutor(const std::string& exe_desc_str) { | ||
// Initialize Executor | ||
} | ||
|
||
FleetExecutor::~FleetExecutor() { | ||
// Destroy Executor | ||
} | ||
|
||
void FleetExecutor::Init(const paddle::framework::ProgramDesc& program_desc) { | ||
// Compile and Initialize | ||
} | ||
|
||
void FleetExecutor::Run() { | ||
// Run | ||
} | ||
|
||
void FleetExecutor::Release() { | ||
// Release | ||
} | ||
|
||
} // namespace distributed | ||
} // namespace paddle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) 2021 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 "paddle/fluid/distributed/fleet_executor/fleet_executor_desc.pb.h" | ||
#include "paddle/fluid/platform/macros.h" | ||
|
||
namespace paddle { | ||
namespace framework { | ||
class ProgramDesc; | ||
} | ||
|
||
namespace distributed { | ||
class RuntimeGraph; | ||
|
||
class FleetExecutor final { | ||
public: | ||
FleetExecutor() = delete; | ||
FleetExecutor(const std::string& exe_desc_str); | ||
~FleetExecutor(); | ||
void Init(const paddle::framework::ProgramDesc& program_desc); | ||
void Run(); | ||
void Release(); | ||
|
||
private: | ||
DISABLE_COPY_AND_ASSIGN(FleetExecutor); | ||
FleetExecutorDesc exe_desc_; | ||
std::unique_ptr<RuntimeGraph> runtime_graph_; | ||
}; | ||
|
||
} // namespace distributed | ||
} // namespace paddle |
21 changes: 21 additions & 0 deletions
21
paddle/fluid/distributed/fleet_executor/fleet_executor_desc.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2021 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.distributed; | ||
|
||
message FleetExecutorDesc { | ||
optional string grain = 1 [ default = "coarse" ]; | ||
repeated string addrs = 2; // "ip:port" of all ranks | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2021 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 | ||
|
||
namespace paddle { | ||
namespace framework { | ||
class ProgramDesc; | ||
} | ||
|
||
namespace distributed { | ||
|
||
class RuntimeGraph final { | ||
public: | ||
RuntimeGraph() = default; | ||
explicit RuntimeGraph(const paddle::framework::ProgramDesc &program) {} | ||
~RuntimeGraph() = default; | ||
|
||
DISABLE_COPY_AND_ASSIGN(RuntimeGraph); | ||
}; | ||
|
||
} // namespace distributed | ||
} // namespace paddle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2021 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/pybind/bind_fleet_executor.h" | ||
#include <pybind11/stl.h> | ||
#include "paddle/fluid/distributed/fleet_executor/fleet_executor.h" | ||
#include "paddle/fluid/framework/program_desc.h" | ||
|
||
namespace py = pybind11; | ||
|
||
namespace paddle { | ||
namespace pybind { | ||
|
||
using paddle::distributed::FleetExecutor; | ||
|
||
void BindFleetExecutor(py::module* m) { | ||
py::class_<FleetExecutor>(*m, "FleetExecutor") | ||
.def(py::init<const std::string&>()) | ||
.def("init", &FleetExecutor::Init) | ||
.def("run", &FleetExecutor::Run); | ||
} | ||
} // namespace pybind | ||
} // namespace paddle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2021 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 <pybind11/pybind11.h> | ||
|
||
namespace paddle { | ||
namespace pybind { | ||
|
||
void BindFleetExecutor(pybind11::module* m); | ||
|
||
} // namespace pybind | ||
} // namespace paddle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.