-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Add Gloo and NCCL migration backends with elastic support (#7)
- Loading branch information
1 parent
0b48bbc
commit 6b7b099
Showing
22 changed files
with
765 additions
and
253 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[submodule "third_party/pygloo"] | ||
path = third_party/pygloo | ||
url = https://github.com/ZeldaHuang/pygloo | ||
branch = llumnix |
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,51 @@ | ||
# Copyright (c) 2024, Alibaba Group; | ||
# 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. | ||
|
||
.PHONY: init | ||
init: | ||
@git submodule update --init --recursive | ||
|
||
.PHONY: install | ||
install: | ||
pip install -e . | ||
|
||
.PHONY: lint | ||
lint: check_pylint_installed | ||
pylint --rcfile=.pylintrc ./llumnix | ||
|
||
.PHONY: test | ||
test: | ||
pytest -vs --ignore=third_party/ --disable-warnings | ||
|
||
#################### pygloo install for gloo migration backend begin #################### | ||
|
||
BAZEL_CMD = bazel | ||
PYGLOO_DIR = third_party/pygloo | ||
|
||
.PHONY: pygloo | ||
pygloo: init | ||
./tools/pygloo_install.sh | ||
|
||
##################### pygloo install for gloo migration backend end ##################### | ||
|
||
##################################### pylint begin ###################################### | ||
|
||
PYLINT_VERSION = 2.12.2 | ||
|
||
.PHONY: check_pylint_installed | ||
check_pylint_installed: | ||
@command -v pylint >/dev/null 2>&1 || { \ | ||
echo "pylint is not installed. Installing pylint $(PYLINT_VERSION)..."; \ | ||
python3 -m pip install pylint==$(PYLINT_VERSION); } | ||
|
||
###################################### pylint end ####################################### |
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
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,41 @@ | ||
# Copyright (c) 2024, Alibaba Group; | ||
# 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. | ||
|
||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
|
||
class MigrationBackendBase(ABC): | ||
@abstractmethod | ||
def init_backend(self, group_name, world_size, rank) -> bool: | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def destory_backend(self) -> None: | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def warmup(self) -> bool: | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def migrate_cache(self, src_handle, src_blocks: List[int], dst_blocks: List[int]) -> None: | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def do_send(self, dst_handle, blocks: List[int]): | ||
raise NotImplementedError | ||
|
||
@abstractmethod | ||
def do_recv(self, src_handle, blocks: List[int]): | ||
raise NotImplementedError |
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.