vllm.transformers_utils.configs.arctic
Arctic model configuration
ARCTIC_PRETRAINED_CONFIG_ARCHIVE_MAP
module-attribute
¶
ARCTIC_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"arctic": "https://huggingface.co/Snowflake/snowflake-arctic-instruct/tree/main/config.json"
}
ArcticConfig
¶
Bases: PretrainedConfig
This is the configuration class to store the configuration of a [ArcticModel
]. It is used to instantiate an
Arctic model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the #TODO(rsamdani): add what model has the default config..
Configuration objects inherit from [PretrainedConfig
] and can be used to control the model outputs. Read the
documentation from [PretrainedConfig
] for more information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vocab_size
|
`int`, *optional*, defaults to 32000
|
Vocabulary size of the Arctic model. Defines the number of different tokens that can be represented by the
|
32000
|
hidden_size
|
`int`, *optional*, defaults to 4096
|
Dimension of the hidden representations. |
4096
|
intermediate_size
|
`int`, *optional*, defaults to 14336
|
Dimension of the MLP representations. |
14336
|
num_hidden_layers
|
`int`, *optional*, defaults to 32
|
Number of hidden layers in the Transformer encoder. |
32
|
num_attention_heads
|
`int`, *optional*, defaults to 32
|
Number of attention heads for each attention layer in the Transformer encoder. |
32
|
num_key_value_heads
|
`int`, *optional*, defaults to 8
|
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
None
|
hidden_act
|
`str` or `function`, *optional*, defaults to `"silu"`
|
The non-linear activation function (function or string) in the decoder. |
'silu'
|
max_position_embeddings
|
`int`, *optional*, defaults to `4096*32`
|
The maximum sequence length that this model might ever be used with. Arctic's sliding window attention allows sequence of up to 4096*32 tokens. |
4096
|
initializer_range
|
`float`, *optional*, defaults to 0.02
|
The standard deviation of the truncated_normal_initializer for initializing all weight matrices. |
0.02
|
rms_norm_eps
|
`float`, *optional*, defaults to 1e-05
|
The epsilon used by the rms normalization layers. |
1e-05
|
use_cache
|
`bool`, *optional*, defaults to `True`
|
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if |
True
|
pad_token_id
|
`int`, *optional*
|
The id of the padding token. |
None
|
bos_token_id
|
`int`, *optional*, defaults to 1
|
The id of the "beginning-of-sequence" token. |
1
|
eos_token_id
|
`int`, *optional*, defaults to 2
|
The id of the "end-of-sequence" token. |
2
|
tie_word_embeddings
|
`bool`, *optional*, defaults to `False`
|
Whether the model's input and output word embeddings should be tied. |
False
|
rope_theta
|
`float`, *optional*, defaults to 1000000.0
|
The base period of the RoPE embeddings. |
1000000.0
|
sliding_window
|
`int`, *optional*
|
Sliding window attention window size. If not specified, will default to |
None
|
attention_dropout
|
`float`, *optional*, defaults to 0.0
|
The dropout ratio for the attention probabilities. |
0.0
|
num_experts_per_tok
|
`int`, *optional*, defaults to 2
|
The number of experts to root per-token, can be also interpreted as the |
1
|
num_local_experts
|
`int`, *optional*, defaults to 8
|
Number of experts per Sparse MLP layer. |
8
|
router_aux_loss_coef
|
`float`, *optional*, defaults to 0.001
|
The aux loss factor for the total loss. |
0.001
|
>>> from transformers import ArcticModel, ArcticConfig
>>> # Initializing a Arctic 7B style configuration TODO(rsamdani): verify which model does the default configuration correspond to.
>>> configuration = ArcticConfig()
>>> # Initializing a model from the Arctic 7B style configuration
>>> model = ArcticModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
Source code in vllm/transformers_utils/configs/arctic.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
enable_expert_tensor_parallelism
instance-attribute
¶
keys_to_ignore_at_inference
class-attribute
instance-attribute
¶
moe_train_capacity_factor
instance-attribute
¶
__init__
¶
__init__(
vocab_size=32000,
hidden_size=4096,
intermediate_size=14336,
num_hidden_layers=32,
num_attention_heads=32,
num_key_value_heads=None,
hidden_act="silu",
max_position_embeddings=4096,
initializer_range=0.02,
rms_norm_eps=1e-05,
use_cache=True,
pad_token_id=None,
bos_token_id=1,
eos_token_id=2,
tie_word_embeddings=False,
rope_theta=1000000.0,
sliding_window=None,
attention_dropout=0.0,
num_experts_per_tok=1,
num_local_experts=8,
router_aux_loss_coef=0.001,
moe_layer_frequency=2,
parallel_attn_mlp_res=False,
moe_train_capacity_factor=1,
moe_eval_capacity_factor=1,
enable_expert_tensor_parallelism=False,
moe_min_capacity=0,
moe_token_dropping=True,
quantization=None,
**kwargs,
)
Source code in vllm/transformers_utils/configs/arctic.py
from_dict
classmethod
¶
from_dict(
config_dict: dict[str, Any], **kwargs
) -> ArcticConfig