Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pip install lmdeploy
The default prebuilt package is compiled on **CUDA 12**. If CUDA 11+ (>=11.3) is required, you can install lmdeploy by:

```shell
export LMDEPLOY_VERSION=0.7.2.post1
export LMDEPLOY_VERSION=0.7.3
export PYTHON_VERSION=38
pip install https://github.com/InternLM/lmdeploy/releases/download/v${LMDEPLOY_VERSION}/lmdeploy-${LMDEPLOY_VERSION}+cu118-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-manylinux2014_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cu118
```
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_cn/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pip install lmdeploy
默认的预构建包是在 **CUDA 12** 上编译的。如果需要 CUDA 11+ (>=11.3),你可以使用以下命令安装 lmdeploy:

```shell
export LMDEPLOY_VERSION=0.7.2.post1
export LMDEPLOY_VERSION=0.7.3
export PYTHON_VERSION=38
pip install https://github.com/InternLM/lmdeploy/releases/download/v${LMDEPLOY_VERSION}/lmdeploy-${LMDEPLOY_VERSION}+cu118-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-manylinux2014_x86_64.whl --extra-index-url https://download.pytorch.org/whl/cu118
```
Expand Down
26 changes: 21 additions & 5 deletions lmdeploy/pytorch/engine/executor/ray_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,17 @@ def __init__(self,
logger.info('Warming up distribute environment, this might take long time, please waiting...')
ray.get([worker.warmup_dist.remote() for worker in self.workers])

def collective_rpc(self, method: str, args: Tuple[Any] = None, kwargs: Dict[str, Any] = None):
def collective_rpc(self,
method: str,
args: Tuple[Any] = None,
kwargs: Dict[str, Any] = None,
timeout: float = None):
"""collective rpc."""
if args is None:
args = list()
if kwargs is None:
kwargs = dict()
return ray.get([getattr(worker, method).remote(*args, **kwargs) for worker in self.workers])
return ray.get([getattr(worker, method).remote(*args, **kwargs) for worker in self.workers], timeout=timeout)

def build_model(self):
"""build model."""
Expand Down Expand Up @@ -293,9 +297,21 @@ def stop(self):

def release(self):
"""release."""
self.collective_rpc('release')
for worker in self.workers:
ray.kill(worker)
if self.dp == 1:
try:
self.collective_rpc('release', timeout=5.0)
logger.debug('RayExecutor workers released.')
except ray.exceptions.GetTimeoutError:
logger.info('Ray release timeout.')

try:
self.collective_rpc('exit')
logger.debug('RayExecutor workers exited.')
except ray.exceptions.RayActorError as e:
logger.debug(f'ray actor exit: {e}')
else:
[ray.kill(worker) for worker in self.workers]

ray.util.remove_placement_group(self.placement_group)

def _compile_dag(self):
Expand Down
2 changes: 1 addition & 1 deletion lmdeploy/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) OpenMMLab. All rights reserved.
from typing import Tuple

__version__ = '0.7.2.post1'
__version__ = '0.7.3'
short_version = __version__


Expand Down
Loading