+
    œ°³jk  ã                   óh   € ^ RI Ht ^RIHt ^RIHt ]! RR7      ] ! R R]4      4       4       tR.tR# )	é    )Ústrict)ÚPreTrainedConfig)Úauto_docstringz
skt/A.X-K2)Ú
checkpointc                   ón  a a€ ] tR t^t oRtRtR.tRRRRRRR	R
RRRR
RRRRRRRR
RRRRRR
/tRR.R.3RRR.R.3RR.R.3/tRRRRRRRR/t	R R!/t
R"tR#tR$tR%t^0t^ t^ t^t^€tR&t^€tR't^ t^@t^@tR(tR(t^tR)tR*tR+tR,t R-t!R)t"R(t#R.t$R.t%R/t&R(t'R(t(R/t)R0t*R#t+^€t,^t-^@t.R(t/^t0V 3R1 lt1V 3R2 lt2V3R3 lt3R4t4Vt5V ;t6# )5Ú
AXK2Configa}  
n_group (`int`, *optional*):
    Number of expert groups for grouped routing, used by the larger A.X-K2 releases. `None` (the
    A.X-K2-Light default) routes over all experts without group restriction.
topk_group (`int`, *optional*):
    Number of expert groups the top-k selection is restricted to when `n_group` is set.
mlp_layer_types (`list`, *optional*):
    MLP type pattern for each layer (`"dense"` or `"sparse"`). Derived from the (legacy) kwargs
    `first_k_dense_replace` / `moe_layer_freq` when not provided.
index_topk (`int`, *optional*, defaults to 2048):
    Number of top tokens selected by the indexer for sparse attention.
index_head_dim (`int`, *optional*, defaults to 128):
    Head dimension for the indexer projections (DSA).
index_n_heads (`int`, *optional*, defaults to 16):
    Number of heads for the indexer projections (DSA).
gated_norm_rank (`int`, *optional*, defaults to 16):
    Bottleneck rank for the low-rank input-dependent gate used by `AXK2GatedRMSNorm`. The gate wraps
    `input_layernorm` on every layer and `post_attention_layernorm` on MoE layers.

```python
>>> from transformers import AXK2Config, AXK2Model

>>> # Initializing an A.X-K2 style configuration
>>> configuration = AXK2Config()

>>> # Initializing a model from the configuration
>>> model = AXK2Model(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```Úaxk2Úpast_key_valueszlayers.*.self_attn.q_gate_projÚcolwisez%layers.*.self_attn.kv_a_proj_with_mqaÚmla_kv_a_projzlayers.*.self_attn.kv_b_projzlayers.*.self_attn.o_projÚrowwisez!layers.*.mlp.experts.gate_up_projÚpacked_colwisezlayers.*.mlp.experts.down_projzlayers.*.mlp.expertsÚmoe_tp_expertsz%layers.*.mlp.shared_experts.gate_projz#layers.*.mlp.shared_experts.up_projz%layers.*.mlp.shared_experts.down_projzlayers.*.mlp.gate_projzlayers.*.mlp.up_projzlayers.*.mlp.down_projÚembed_tokensÚ	input_idsÚinputs_embedsÚlayersÚhidden_statesÚattention_maskÚnormzlayers.*.mlp.gateÚ	ep_routerÚgrouped_gemmÚnum_local_expertsÚn_routed_expertsi € i   i   i   g      @i€  NTÚsilui   g{®Gáz”?g�íµ ÷Æ°>ik Fg        c                óÈ  <€ V P                   V P                  ,           V n        V P                  V n        V P                  fd   VP                  R^4      pVP                  R^4      p\        V P                  4       Uu. uF  pWB8¼  d   WC,          ^ 8X  d   RMRNK  	  upV n        V P                  f   R.V P                  ,          V n        \        SV `(  ! R/ VB  R # u upi )NÚfirst_k_dense_replaceÚmoe_layer_freqÚsparseÚdenseÚdeepseek_sparse_attention© )Úqk_nope_head_dimÚqk_rope_head_dimÚqk_head_dimÚhead_dimÚmlp_layer_typesÚpopÚrangeÚnum_hidden_layersÚlayer_typesÚsuperÚ__post_init__)ÚselfÚkwargsr   r   ÚiÚ	__class__s   &,   €Úl/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/axk2/configuration_axk2.pyr-   ÚAXK2Config.__post_init__†   sØ   ø€ Ø×0Ñ0°4×3HÑ3HÕHˆÔð ×-Ñ-ˆŒð ×ÑÒ'Ø$*§J¡JÐ/FÈÓ$JÐ!Ø#ŸZ™ZÐ(8¸!Ó<ˆNô ˜t×5Ñ5Ô6ó$á6�Að Ô6¸1Õ;MÐQRÔ;R‘ÐX_Ò_Ù6ñ$ˆDÔ ð ×ÑÒ#Ø ;Ð<¸t×?UÑ?UÕUˆDÔä‰ÒÑ' Ô'ùò$s   Á> Cc                óP  <€ \         SV `  4        V P                  e   V P                  ^ 8:  d   \        RV P                   R24      hV P                  R J V P
                  R J 8w  d'   \        RV P                   RV P
                   R24      hV P                  eŒ   V P                  V P                  ,          ^ 8w  d'   \        RV P                   RV P                   R24      hV P
                  V P                  8”  d'   \        RV P
                   R	V P                   R24      hR # R # )
NzkA.X-K2 requires a positive `q_lora_rank` (the indexer and output gate read the query LoRA bottleneck), got Ú.zc`n_group` and `topk_group` must be set together (both `None` for non-grouped routing), got n_group=z, topk_group=z`n_routed_experts` (z") must be divisible by `n_group` (z).z`topk_group` (z) cannot exceed `n_group` ()r,   Úvalidate_architectureÚq_lora_rankÚ
ValueErrorÚn_groupÚ
topk_groupr   )r.   r1   s   &€r2   r6   Ú AXK2Config.validate_architecture›   s.  ø€ Ü‰Ñ%Ô'Ø×ÑÒ# t×'7Ñ'7¸1Ô'<Üð$Ø$(×$4Ñ$4Ð#5°Qð8óð ð �L‰L˜DÐ  d§o¡o¸Ð&=Ô>ÜðØŸ<™<˜.¨°d·o±oÐ5FÀaðIóð ð �<‰<Ò#Ø×$Ñ$ t§|¡|Õ3°qÔ8Ü Ø*¨4×+@Ñ+@Ð*AÐAcÐdh×dpÑdpÐcqÐqsÐtóð ð �‰ §¡Ô-Ü  >°$·/±/Ð1BÐB]Ð^b×^jÑ^jÐ]kÐkmÐ!nÓoÐoñ .ñ $ó    c                ó¢  <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R	&   S[;R
&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ ;R&   S[;R&   S[;R&   S[ ;R&   S[;R&   S[;R&   S[;R&   S[ R,          ;R&   S[ R,          ;R&   S[ S[S[ ,          ,          R,          ;R&   S[;R&   S[R,          ;R&   S[S[,          R,          ;R&   S[;R &   S[S[ ,          ;R!&   S[ ;R"&   S[ ;R#&   S[ ;R$&   S[ ;R%&   S[S[,          R,          ;R&&   S[ ;R'&   # )(é   Ú
vocab_sizeÚhidden_sizeÚintermediate_sizeÚmoe_intermediate_sizer*   Únum_attention_headsÚnum_key_value_headsÚn_shared_expertsr   Úrouted_scaling_factorÚkv_lora_rankr7   r$   Ú
v_head_dimr#   Nr9   r:   Únum_experts_per_tokÚnorm_topk_probÚ
hidden_actÚmax_position_embeddingsÚinitializer_rangeÚrms_norm_epsÚ	use_cacheÚpad_token_idÚbos_token_idÚeos_token_idÚtie_word_embeddingsÚrope_parametersr'   Úattention_biasÚattention_dropoutÚ
index_topkÚindex_head_dimÚindex_n_headsr&   r+   Úgated_norm_rank)ÚintÚfloatÚboolÚstrÚlistÚdict)ÚformatÚ__classdict__s   "€r2   Ú__annotate__ÚAXK2Config.__annotate__   sv  ø‡ ‚ ñF ÑñG ñH ÑñI ñJ Ñ!ñK ñL Ñ$ñM ñN ÑñO ñP Ñ!ñQ ñR Ñ!ñS ñT ÑñU ñV ÑñW ñX !Ñ&ñY ñZ Ññ[ ñ\ Ññ] ñ^ Ññ_ ñ` Ñña ñb Ññc ñh �4�ZÑñi ñj �d•
Ñ!ñk ñl Ñ ñm ñn Ñño ñp Ññq ñr !Ñ)ñs ñt Ñ#ñu ñv Ññw ñx Ññy ñz ˜•*Ñ#ñ{ ñ| ˜•*Ñ%ñ} ñ~ ™™S�	•/ DÕ(Ñ1ñ ñ@ Ñ%ñA ñB ˜D•[Ñ'ñC ñD ™#•Y Õ%Ñ,ñE ñF Ñ ñG ñH ™s•{Ñ(ñI ñJ ÑñK ñL ÑñM ñN ÑñO ñP ÑñQ ñR ‘c•˜TÕ!Ñ(ñS ñT ÑòU r<   )r&   r+   r'   r%   )7Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
model_typeÚkeys_to_ignore_at_inferenceÚbase_model_tp_planÚbase_model_pp_planÚbase_model_ep_planÚattribute_mapr?   r@   rA   rB   r*   rC   rD   rE   r   rF   rG   r7   r$   rH   r#   r9   r:   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   r'   rU   rV   rW   rX   rY   r&   r+   rZ   r-   r6   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r1   rb   s   @@r2   r   r      s²  ù‡ € ñð@ €JØ#4Ð"5Ðð 	)¨)Ø/°Ø&¨	Ø# YØ+Ð-=Ø(¨)ØÐ 0Ø/°Ø-¨yØ/°Ø  )Ø 	Ø  )ðÐð  	˜+˜¨Ð(9Ð:Ø�OÐ%5Ð6¸Ð8IÐJØ�/Ð" _Ð$5Ð6ðÐð 	˜[Ø+¨^Ø(¨.ØÐ 0ð	Ðð )Ð*<Ð=€Mà€JØ€KØ!ÐØ!$ÐØÐØ!ÐØ!ÐØÐØÐØ#&ÐØ€LØ€KØÐØ€JØÐð €GØ!€JØ ÐØ€NØ€JØ#)ÐØ#ÐØ€LØ€IØ#€LØ%€LØ+1€LØ %ÐØ#'€OØ(,€OØ €NØ%(ÐØ€JØ€NØ€MØ€HØ$(€KØ€Oõ(õ*p÷C … r<   r   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Ú__all__r"   r<   r2   Ú<module>rx      sI   ðõ( /å 3Ý #ñ ˜<Ô(ØôQpÐ!ó Qpó ó )ðQpðh ˆ.‚r<   