[K3] Allow tpu to import kimi_k3.common (#51529)
Signed-off-by: Jeff Ma <jeffjma@umich.edu>
This commit is contained in:
@@ -13,13 +13,20 @@ from vllm.platforms import current_platform
|
||||
|
||||
# The NVIDIA branch is the static default that type-checkers see; the ROCm
|
||||
# branch overrides it at runtime (kept type-compatible via type: ignore).
|
||||
if TYPE_CHECKING or not current_platform.is_rocm():
|
||||
# TPU plugins import the shared ``common`` modules through this package, but
|
||||
# register their own model classes. Do not eagerly import a GPU implementation.
|
||||
if TYPE_CHECKING:
|
||||
from .nvidia.model import KimiK3ForConditionalGeneration, KimiLinearForCausalLM
|
||||
from .nvidia.mtp import KimiK3MTP
|
||||
else:
|
||||
elif current_platform.device_type == "tpu":
|
||||
pass
|
||||
elif current_platform.is_rocm():
|
||||
from .amd.linear import KimiLinearForCausalLM # type: ignore[assignment]
|
||||
from .amd.model import KimiK3ForConditionalGeneration # type: ignore[assignment]
|
||||
from .amd.mtp import KimiK3MTP # type: ignore[assignment]
|
||||
else:
|
||||
from .nvidia.model import KimiK3ForConditionalGeneration, KimiLinearForCausalLM
|
||||
from .nvidia.mtp import KimiK3MTP
|
||||
|
||||
__all__ = [
|
||||
"KimiK3ForConditionalGeneration",
|
||||
|
||||
Reference in New Issue
Block a user