fix(config): Support setting Mamba state dtype via config file (#18532)
Co-authored-by: 瑀澈 <yuche.lz@alibaba-inc.com>
This commit is contained in:
@@ -3,7 +3,11 @@ from typing import Any
|
||||
|
||||
from transformers.configuration_utils import PretrainedConfig
|
||||
|
||||
from sglang.srt.configs.mamba_utils import Mamba2CacheParams, Mamba2StateShape
|
||||
from sglang.srt.configs.mamba_utils import (
|
||||
Mamba2CacheParams,
|
||||
Mamba2StateShape,
|
||||
mamba2_state_dtype,
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -71,4 +75,6 @@ class JetNemotronConfig(PretrainedConfig):
|
||||
conv_kernel=jet_block_config.conv_size,
|
||||
)
|
||||
|
||||
return Mamba2CacheParams(shape=shape, layers=self.linear_layer_ids)
|
||||
return Mamba2CacheParams(
|
||||
shape=shape, layers=self.linear_layer_ids, dtype=mamba2_state_dtype(self)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user