Skip to content

Commit

Permalink
Revert "[CI] Add comprehensive testing: migration, e2e, and bench (#30)"
Browse files Browse the repository at this point in the history
This reverts commit 91a6454.
  • Loading branch information
KuilongCui authored Sep 19, 2024
1 parent 91a6454 commit 5051371
Show file tree
Hide file tree
Showing 48 changed files with 51 additions and 803 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/bench_test.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/e2e_test.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/migration_test.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/offline_inference.yml

This file was deleted.

33 changes: 15 additions & 18 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pylint
name: Pylint

on:
push:
Expand All @@ -9,24 +9,21 @@ on:
- main

jobs:
cancel_previous_workflows:
runs-on: [self-hosted]
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
all_but_latest: true

pylint_test:
needs: cancel_previous_workflows
runs-on: [self-hosted]
timeout-minutes: 10
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint==2.12.2
- name: Analysing the code with pylint
run: |
nvidia-docker run --rm -t --net host --ipc host \
-v ${PWD}:/workspace \
-w /workspace \
registry.cn-beijing.aliyuncs.com/llumnix/llumnix-dev:20240909_action_678a439 \
bash -c "pip install -e . > /dev/null && make lint"
pylint --rcfile=.pylintrc --output-format=parseable --jobs=8 $( find llumnix/ -type f -name '*.py')
31 changes: 0 additions & 31 deletions .github/workflows/unit_test.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/whl.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ install:

.PHONY: lint
lint: check_pylint_installed check_pytest_installed
@pylint --rcfile=.pylintrc -s n --jobs=32 ./llumnix
@pylint --rcfile=.pylintrc -s n ./llumnix

@pylint --rcfile=.pylintrc \
--disable=protected-access,super-init-not-called,unused-argument,redefined-outer-name,invalid-name \
-s n --jobs=32 ./tests
-s n ./tests

.PHONY: test
test: check_pytest_installed
@pytest -x -v --ignore=third_party/ --ignore=tests/e2e_test --disable-warnings
@pytest -x -q --ignore=third_party/ --disable-warnings

#################### pygloo install for gloo migration backend begin ####################

Expand Down
3 changes: 1 addition & 2 deletions llumnix/backends/vllm/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def step(self) -> None:
instance_info.step_id = next(self.step_counter)
instance_info.timestamp = time.time()
instance_info.latency = self.model_executor.last_inference_latency

seq_groups = self.scheduler.running
if seq_groups:
tot_blocks = []
Expand Down Expand Up @@ -261,8 +260,8 @@ def commit_dst_request(self, backend_request: SequenceGroupLlumnix) -> None:
logger.info("add seq {} to block table".format(seq.seq_id))
pre_alloc_blocks = self.engine.scheduler.pre_alloc_cache_dict.pop(backend_request.request_id)
self.engine.scheduler.block_manager.add_block_table(pre_alloc_blocks, seq.seq_id)
backend_request.reset_migration_args()
self.add_running_request(backend_request)
backend_request.reset_migration_args()

def send_blocks(self, dst_ray_actor: "ray.actor.ActorHandle", src_blocks: List[int], dst_blocks: List[int]) -> None:
ray.get(dst_ray_actor.execute_engine_method.remote("_run_workers",
Expand Down
12 changes: 0 additions & 12 deletions llumnix/backends/vllm/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import time
from typing import Dict, List
import math
import ray
Expand All @@ -22,13 +21,11 @@
from vllm.worker.worker import Worker
from vllm.config import CacheConfig, ModelConfig, ParallelConfig
from vllm.worker.cache_engine import CacheEngine
from vllm.config import _GB

from llumnix.logger import init_logger
from llumnix.backends.vllm.utils import _sample_with_torch
from llumnix.backends.vllm.migration_backend import MigrationBackendBase, get_migration_backend
from llumnix.internal_config import MigrationConfig
from llumnix.utils import convert_bytes

logger = init_logger(__name__)

Expand Down Expand Up @@ -107,19 +104,10 @@ def init_migration(self, instance_id: str, migration_config: MigrationConfig, sr

def migrate_cache(self, src_worker_handle_list, src_blocks: List[int], dst_blocks: List[int]) -> None:
src_worker_handle = src_worker_handle_list[self.rank]

start_time = time.time()
try:
self.migration_backend.migrate_cache(src_worker_handle, src_blocks, dst_blocks)
except ray.exceptions.RayActorError:
logger.info("[migrate_cache] self.rank: {}, src_worker_handle {} is dead".format(self.rank, src_worker_handle))
end_time = time.time()

total_kv_cache_size = len(src_blocks) * CacheEngine.get_cache_block_size(
self.cache_config, self.model_config, self.parallel_config)
speed = total_kv_cache_size/_GB/(end_time - start_time)
logger.info("[migration_cache] blocks_num: {}, total_kv_cache_size: {}, time: {}s, speed: {}GB/s."
.format(len(src_blocks), convert_bytes(total_kv_cache_size), end_time-start_time, speed))

def do_recv(self, *args, **kwargs):
return self.migration_backend.do_recv(*args, **kwargs)
Expand Down
6 changes: 3 additions & 3 deletions llumnix/entrypoints/llumnix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import time
from typing import List, Tuple
import asyncio
import socket
import ray

from llumnix.llm_engine_manager import LLMEngineManager, MANAGER_ACTOR_NAME
Expand All @@ -39,9 +38,10 @@
MAX_TASK_RETRIES = 300
RETRIES_INTERVALS = 0.1


def get_ip_address():
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
result = subprocess.run(['hostname', '-i'], stdout=subprocess.PIPE, check=True)
ip_address = result.stdout.decode('utf-8').strip()
return ip_address

def launch_ray_cluster(ray_cluster_port: int) -> subprocess.CompletedProcess:
Expand Down
14 changes: 0 additions & 14 deletions llumnix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,3 @@

def random_uuid() -> str:
return str(uuid.uuid4().hex)

def convert_bytes(bytes_size):
"""Convert bytes to KB, MB, GB, etc."""
if bytes_size < 0:
raise ValueError("Size must be a non-negative integer.")

size_suffixes = ['B', 'KB', 'MB', 'GB', 'TB']
index = 0

while bytes_size >= 1024 and index < len(size_suffixes) - 1:
bytes_size /= 1024.0
index += 1

return f"{bytes_size:.2f} {size_suffixes[index]}"
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
asyncio_default_fixture_loop_scope = function
asyncio_default_fixture_loop_scope = function
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
from llumnix.internal_config import MigrationConfig
from llumnix.llumlet.request import LlumnixRequest, RequestInferenceType

# pylint: disable=unused-import
from tests.unit_test.rpc.test_queue import request_output_queue_server
# pylint: disable=unused-import
from tests.conftest import setup_ray_env
from tests.utils import setup_ray_env
from tests.rpc.test_queue import request_output_queue_server


from .test_llm_engine import MockEngine
from .utils import create_dummy_prompt
Expand Down
Loading

0 comments on commit 5051371

Please sign in to comment.