(
self,
device_id: int,
engine: Union[Path, Engine],
executor_config: Optional[tllm.ExecutorConfig] = None,
batched_logits_processor: Optional[BatchedLogitsProcessor] = None,
postproc_worker_config: Optional[PostprocWorkerConfig] = None,
is_llm_executor: Optional[bool] = None,
hf_model_dir: Optional[Path] = None,
tokenizer: Optional[TokenizerBase] = None,
llm_args: Optional[BaseLlmArgs] = None,
rpc_addr: Optional[str] = None,
hmac_key: Optional[bytes] = None,
)
| 206 | class RayGPUWorker(RpcWorkerMixin, BaseWorker): |
| 207 | |
| 208 | def __init__( |
| 209 | self, |
| 210 | device_id: int, |
| 211 | engine: Union[Path, Engine], |
| 212 | executor_config: Optional[tllm.ExecutorConfig] = None, |
| 213 | batched_logits_processor: Optional[BatchedLogitsProcessor] = None, |
| 214 | postproc_worker_config: Optional[PostprocWorkerConfig] = None, |
| 215 | is_llm_executor: Optional[bool] = None, |
| 216 | hf_model_dir: Optional[Path] = None, |
| 217 | tokenizer: Optional[TokenizerBase] = None, |
| 218 | llm_args: Optional[BaseLlmArgs] = None, |
| 219 | rpc_addr: Optional[str] = None, |
| 220 | hmac_key: Optional[bytes] = None, |
| 221 | ) -> None: |
| 222 | global logger |
| 223 | from tensorrt_llm.logger import logger |
| 224 | |
| 225 | super().__init__( |
| 226 | engine=engine, |
| 227 | executor_config=executor_config, |
| 228 | batched_logits_processor=batched_logits_processor, |
| 229 | postproc_worker_config=postproc_worker_config, |
| 230 | is_llm_executor=is_llm_executor, |
| 231 | hf_model_dir=hf_model_dir, |
| 232 | tokenizer=tokenizer, |
| 233 | llm_args=llm_args, |
| 234 | ) |
| 235 | |
| 236 | self.device_id = device_id |
| 237 | self.global_rank = torch.distributed.get_rank() |
| 238 | if self.global_rank > 1: |
| 239 | logger.set_rank(self.global_rank) |
| 240 | |
| 241 | if rpc_addr is None: |
| 242 | raise RuntimeError( |
| 243 | "RPC mode enabled but no rpc_addr provided to RayGPUWorker") |
| 244 | self.init_rpc_worker(self.global_rank, rpc_addr, hmac_key) |
| 245 | self.start_rpc_server() |
| 246 | |
| 247 | def setup_engine(self): |
| 248 | if torch.distributed.is_initialized( |
nothing calls this directly
no test coverage detected