vllm.models.deepseek_v4.amd.model ¶
Classes:
DeepseekV4ForCausalLM ¶
Bases: Module, SupportsPP, SupportsEagle3
Methods:
-
get_mtp_target_hidden_states–Pre-hc_head residual stream buffer (max_num_batched_tokens,
Source code in vllm/models/deepseek_v4/amd/model.py
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 | |
get_mtp_target_hidden_states() ¶
Pre-hc_head residual stream buffer (max_num_batched_tokens, hc_mult * hidden_size) for the MTP draft model. Populated by forward(); valid after each target step.
Source code in vllm/models/deepseek_v4/amd/model.py
_fuse_shared_experts_enabled(config, prefix='') ¶
Whether to fuse the shared expert into the routed MXFP4 grouped GEMM.
Fusion fuses the shared expert into the routed experts' MXFP4 grouped GEMM, so it only applies where the shared expert is the same precision as the routed experts. Some layers may carry a shared expert in a different quantization than the routed experts; when so, it runs as its own linear and must not be fused.
Source code in vllm/models/deepseek_v4/amd/model.py
_shared_experts_are_fp4(config, layer_idx=None) ¶
Whether the shared experts are MXFP4 and thus fusable.
layer_idx=None resolves the model-wide default (global scheme), used by the main-model weight loader / mapper callers that operate per-model.