Skip to content

Commit 7371792

Browse files
committed
update
1 parent d478151 commit 7371792

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lightllm/server/api_start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def normal_or_p_d_start(args):
6666
if args.enable_mps:
6767
from lightllm.utils.device_utils import enable_mps, set_gpu_exclusive_mode
6868

69-
enable_mps()
7069
for i in range(args.tp):
7170
set_gpu_exclusive_mode(gpu_index=i)
71+
enable_mps()
7272

7373
if args.run_mode not in ["normal", "prefill", "decode"]:
7474
return

lightllm/server/visualserver/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def wait_to_model_ready(self):
5555
for dp_rank_id in range(self.vit_dp):
5656
tp_ports_each_dp = self.visual_model_rpc_ports[dp_rank_id]
5757
for tp_rank_id in range(self.vit_tp):
58-
device_id = dp_rank_id * self.vit_tp + tp_rank_id
58+
device_id = self.args.visual_gpu_ids[dp_rank_id * self.vit_tp + tp_rank_id]
5959
rpc_model = await start_model_process(
6060
port=tp_ports_each_dp[tp_rank_id], vit_tp=self.vit_tp, device_id=device_id
6161
)

lightllm/utils/start_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ def start_submodule_processes(self, start_funcs=[], start_args=[]):
4343
def terminate_all_processes(self):
4444
from lightllm.utils.envs_utils import get_env_start_args
4545

46-
is_enable_mps = get_env_start_args().enable_mps
47-
world_size = get_env_start_args().tp
48-
4946
def kill_recursive(proc):
5047
try:
5148
parent = psutil.Process(proc.pid)
@@ -62,6 +59,10 @@ def kill_recursive(proc):
6259
if proc.is_alive():
6360
kill_recursive(proc)
6461
proc.join()
62+
63+
# recover the gpu compute mode
64+
is_enable_mps = get_env_start_args().enable_mps
65+
world_size = get_env_start_args().tp
6566
if is_enable_mps:
6667
from lightllm.utils.device_utils import stop_mps, set_gpu_default_mode
6768

0 commit comments

Comments
 (0)