[Hardware][TPU] Optionally import for TPU backend (#18269)
Signed-off-by: Siyuan Liu <lsiyuan@google.com> Signed-off-by: Jade Zheng <zheng.shoujian@outlook.com> Co-authored-by: Carol Zheng <cazheng@google.com> Co-authored-by: Jade Zheng <zheng.shoujian@outlook.com> Co-authored-by: Hongmin Fan <fanhongmin@google.com>
This commit is contained in:
@@ -267,3 +267,11 @@ def init_tpu_worker_distributed_environment(
|
||||
ensure_model_parallel_initialized(parallel_config.tensor_parallel_size,
|
||||
parallel_config.pipeline_parallel_size,
|
||||
parallel_config.enable_expert_parallel)
|
||||
|
||||
|
||||
try:
|
||||
from tpu_commons.worker import TPUWorker as TPUCommonsWorker
|
||||
TPUWorker = TPUCommonsWorker # type: ignore
|
||||
except ImportError:
|
||||
logger.info("tpu_commons not found, using vLLM's TPUWorker.")
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user