+5








e126687a9a
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com> Signed-off-by: andyluo7 <andy.luo@amd.com> Signed-off-by: lishunyang12 <lishunyang03@gmail.com> Signed-off-by: Harry Huang <huanghaoyan.hhy@alibaba-inc.com> Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg> Signed-off-by: Isotr0py <Isotr0py@outlook.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: KungYork <firelikest@163.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai> Co-authored-by: andyluo7 <43718156+andyluo7@users.noreply.github.com> Co-authored-by: Isotr0py <mozf@inferact.ai> Co-authored-by: andyluo7 <andy.luo@amd.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: lishunyang12 <lishunyang03@gmail.com> Co-authored-by: Vadim Gimpelson <156319763+vadiklyutiy@users.noreply.github.com> Co-authored-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: OpenAI Codex <codex@openai.com>
62 lines
1.7 KiB
Python
62 lines
1.7 KiB
Python
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
|
"""Qwen4Exp model package."""
|
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
from .common.hyperconnection import (
|
|
GatedResidual,
|
|
GroupedGemmaRMSNorm,
|
|
HyperConnectionBase,
|
|
HyperConnectionConfig,
|
|
)
|
|
|
|
if TYPE_CHECKING:
|
|
from .nvidia.model import (
|
|
Qwen4ExpForCausalLM,
|
|
Qwen4ExpForConditionalGeneration,
|
|
)
|
|
from .nvidia.mtp import Qwen4ExpMTP
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
if name in {
|
|
"Qwen4ExpForCausalLM",
|
|
"Qwen4ExpForConditionalGeneration",
|
|
"Qwen4ExpMTP",
|
|
}:
|
|
from vllm.platforms import current_platform
|
|
|
|
if current_platform.is_xpu() or current_platform.is_tpu():
|
|
raise NotImplementedError("Qwen4Exp currently supports CUDA and ROCm only")
|
|
if current_platform.is_rocm():
|
|
from .amd.model import (
|
|
Qwen4ExpForCausalLM,
|
|
Qwen4ExpForConditionalGeneration,
|
|
)
|
|
from .amd.mtp import Qwen4ExpMTP
|
|
else:
|
|
from .nvidia.model import (
|
|
Qwen4ExpForCausalLM,
|
|
Qwen4ExpForConditionalGeneration,
|
|
)
|
|
from .nvidia.mtp import Qwen4ExpMTP
|
|
|
|
return {
|
|
"Qwen4ExpForCausalLM": Qwen4ExpForCausalLM,
|
|
"Qwen4ExpForConditionalGeneration": (Qwen4ExpForConditionalGeneration),
|
|
"Qwen4ExpMTP": Qwen4ExpMTP,
|
|
}[name]
|
|
raise AttributeError(name)
|
|
|
|
|
|
__all__ = [
|
|
"GatedResidual",
|
|
"GroupedGemmaRMSNorm",
|
|
"HyperConnectionBase",
|
|
"HyperConnectionConfig",
|
|
"Qwen4ExpForCausalLM",
|
|
"Qwen4ExpForConditionalGeneration",
|
|
"Qwen4ExpMTP",
|
|
]
|