-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[fleet_executor] Framework for fleet executor #36892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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_; | ||
LiYuRio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| } // namespace distributed | ||
| } // namespace paddle | ||
21 changes: 21 additions & 0 deletions
21
paddle/fluid/distributed/fleet_executor/fleet_executor_desc.proto
This file contains hidden or 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 hidden or 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) {} | ||
LiYuRio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ~RuntimeGraph() = default; | ||
|
|
||
| DISABLE_COPY_AND_ASSIGN(RuntimeGraph); | ||
| }; | ||
|
|
||
| } // namespace distributed | ||
| } // namespace paddle | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.