@@ -82,14 +82,15 @@ def __init__(
8282 if self .enable_multimodal :
8383 self .cache_client = rpyc .connect ("localhost" , args .cache_port , config = {"allow_pickle" : True })
8484 self .cache_client ._channel .stream .sock .setsockopt (socket .IPPROTO_TCP , socket .TCP_NODELAY , 1 )
85- if not self .args .disable_vision :
86- from lightllm .server .visualserver .vit_connect import VITConnectionManager
8785
88- self .vit_manager = VITConnectionManager (args , context , args .visual_port , self .cache_client )
86+ if not self .args .disable_vision :
87+ from lightllm .server .visualserver .vit_connect import VITConnectionManager
8988
90- if not self .args .disable_audio :
91- self .send_to_audio = context .socket (zmq .PUSH )
92- self .send_to_audio .connect (f"{ args .zmq_mode } 127.0.0.1:{ args .audio_port } " )
89+ self .vit_manager = VITConnectionManager (args , context , args .visual_port , self .cache_client )
90+
91+ if not self .args .disable_audio :
92+ self .send_to_audio = context .socket (zmq .PUSH )
93+ self .send_to_audio .connect (f"{ args .zmq_mode } 127.0.0.1:{ args .audio_port } " )
9394
9495 if args .enable_cpu_cache and not self .args .enable_multimodal :
9596 self .send_to_multi_level_kv_cache = context .socket (zmq .PUSH )
@@ -151,7 +152,6 @@ async def _alloc_resource(self, items, uuids, token_nums, datas):
151152 if self .args .enable_remote_vit :
152153 # 避免远端lru被逐出
153154 self .cache_client .root .get_items_embed (uid_list , False )
154- return
155155
156156 ready_flags = obtain (self .cache_client .root .get_items_data (uid_list ))
157157 update_data_ids = []
@@ -592,25 +592,13 @@ async def transfer_to_next_module(
592592
593593 if self .pd_mode .is_P_or_NORMAL ():
594594 group_req_index = group_req_objs .to_group_req_index ()
595- has_images = len (group_req_index .multimodal_params .images ) > 0
596- has_audios = len (group_req_index .multimodal_params .audios ) > 0
597-
598- if has_images and not self .args .disable_vision :
599- free_mode = "all"
600- if self .args .enable_remote_vit and has_audios and not self .args .disable_audio :
601- free_mode = "images"
602-
603- await self .vit_manager .send_to_vit (
604- group_req_index , protocol = pickle .HIGHEST_PROTOCOL , free_mode = free_mode
605- )
606-
595+ if not self .args .disable_vision :
596+ await self .vit_manager .send_to_vit (group_req_index , protocol = pickle .HIGHEST_PROTOCOL )
607597 if not self .args .enable_remote_vit :
608598 return
609599
610- if has_audios and not self .args .disable_audio :
600+ if not self .args .disable_audio :
611601 self .send_to_audio .send_pyobj (group_req_index , protocol = pickle .HIGHEST_PROTOCOL )
612- if self .args .enable_remote_vit :
613- group_req_index .multimodal_params .free ()
614602 return
615603
616604 if self .args .enable_cpu_cache :
0 commit comments