[TPU] make ptxla not imported when using tpu_commons (#23081)
Signed-off-by: Chengji Yao <chengjiyao@gmail.com> Signed-off-by: Chengji Yao <chengjiyao@google.com> Co-authored-by: Chengji Yao <chengjiyao@gmail.com>
This commit is contained in:
co-authored by
Chengji Yao
parent
a4454e9401
commit
e9d6a3db69
@@ -24,6 +24,8 @@ else:
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
USE_TPU_COMMONS = False
|
||||
|
||||
|
||||
class TpuPlatform(Platform):
|
||||
_enum = PlatformEnum.TPU
|
||||
@@ -201,6 +203,7 @@ class TpuPlatform(Platform):
|
||||
try:
|
||||
from tpu_commons.platforms import TpuPlatform as TpuCommonsPlatform
|
||||
TpuPlatform = TpuCommonsPlatform # type: ignore
|
||||
USE_TPU_COMMONS = True
|
||||
except ImportError:
|
||||
logger.info("tpu_commons not found, using vLLM's TpuPlatform")
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user