import{s as lr,n as ur,o as dr}from"../chunks/scheduler.56725da7.js";import{S as pr,i as gr,e as s,s as r,c as l,h as fr,a as m,d as e,b as a,f as _,g as u,j as v,k as c,l as o,m as i,n as d,t as p,o as g,p as f}from"../chunks/index.18a26576.js";import{C as _r}from"../chunks/CopyLLMTxtMenu.b9295305.js";import{D as h}from"../chunks/Docstring.ec5e484c.js";import{H as x}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.61bde07c.js";function cr(Fn){let C,oe,re,ie,K,se,N,me,R,Wn="The transformation specs API defines how model weights are transformed between the original Transformers implementation and the custom implementation optimized for Neuron devices. This enables automatic weight conversion during model loading and checkpoint consolidation.",le,U,ue,H,de,$,B,on,qt,qn=`This class defines the interface for transforming model weights between the original Transformers implementation
and the custom implementation for Neuron.`,sn,I,J,mn,zt,zn="Adapts the PEFT config to match the custom modeling implementation.",ln,F,O,un,Qt,Qn="Transforms the state dict from the original Transformers model to match the custom modeling implementation.",dn,W,X,pn,At,An="Returns the set of parameter names that this spec would affect.",gn,q,Y,fn,jt,jn="Guesses the PEFT type of the module associated to the spec.",_n,z,Z,cn,Gt,Gn="Restores the PEFT config to the original one that matches the original Transformers implementation.",hn,Q,tt,$n,Kt,Kn=`Produces the weights associated to this transformation spec from the custom model to match the original
Transformers weights.`,pe,et,ge,T,nt,vn,Nt,Nn="Defines a list of transformation specs for a given module of the model.",fe,rt,_e,L,at,bn,Rt,Rn=`This class is used to mark a module as a custom module. It is used to identify the modules that contain weights
that need to transformed when loading and saving the model.`,ce,ot,he,it,$e,P,st,yn,Ut,Un=`Represents a transformation where multiple linear layers are fused into a single linear layer.
It can handle the case where the fused linear layer is sharded across multiple tensor parallel ranks.`,ve,mt,be,y,lt,xn,Ht,Hn=`Represents the transformation of separate query, key, and value projections into a single GQAQKVColumnParalleLinear
projection.`,wn,A,ut,Cn,Bt,Bn="Computes the permutation for the query weight for a given TP rank.",Tn,j,dt,Ln,Jt,Jn="Creates the local version of the key or value projections weight for the given TP rank.",Pn,G,pt,Sn,Ot,On="Creates the local version of the query or output projections weight for the given TP rank.",ye,gt,xe,ft,we,S,_t,Mn,Xt,Xn=`Shards a tensor along a given axis and return a slice corresponding to the rank.
This will round up the layer to the next multiple if there is need to pad the tensor.`,Ce,M,ct,Vn,Yt,Yn="Shards individual weights across the tensor parallel ranks and fuses them into a single weight.",Te,ht,Le,$t,vt,Pe,bt,yt,Se,xt,wt,Me,Ct,Ve,V,Tt,kn,Zt,Zn="Transforms the state dict from the original Transformers model to match the custom modeling implementation.",ke,k,Lt,Dn,te,tr=`Consolidates the sharded state dicts produced by saving the custom model into a single state dict that matches the
original Transformers model weights.`,De,Pt,Ee,D,St,En,ee,er=`Creates the metadata to be saved with the model weights to be able to reconstruct the original weights when
consolidating the sharded state dicts.`,Ie,E,Mt,In,ne,nr="Returns the tensor model parallel attributes of a tensor.",Fe,Vt,We,kt,Dt,qe,Et,It,ze,Ft,Wt,Qe,ae,Ae;return K=new _r({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),N=new x({props:{title:"Model Weight Transformation Specs",local:"model-weight-transformation-specs",headingTag:"h1"}}),U=new x({props:{title:"Base Classes",local:"base-classes",headingTag:"h2"}}),H=new x({props:{title:"ModelWeightTransformationSpec",local:"optimum.neuron.models.training.ModelWeightTransformationSpec",headingTag:"h3"}}),B=new h({props:{name:"class optimum.neuron.models.training.ModelWeightTransformationSpec",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec",parameters:[],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L91"}}),J=new h({props:{name:"adapt_peft_config",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.adapt_peft_config",parameters:[{name:"peft_config",val:": PeftConfig"},{name:"inplace",val:": bool = False"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L121"}}),O=new h({props:{name:"adapt_state_dict",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.adapt_state_dict",parameters:[{name:"module_fully_qualified_name",val:": str"},{name:"named_parameters",val:": dict[str, torch.nn.parameter.Parameter]"},{name:"orig_state_dict",val:": dict[str, torch.Tensor]"},{name:"upstanding_sharded_params",val:": dict[str, torch.Tensor]"},{name:"inplace",val:": bool = False"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L157"}}),X=new h({props:{name:"get_relevant_parameter_names",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.get_relevant_parameter_names",parameters:[{name:"module_fully_qualified_name",val:": str"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L107"}}),Y=new h({props:{name:"guess_peft_type",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.guess_peft_type",parameters:[{name:"model",val:": Module"},{name:"module_fully_qualified_name",val:": str"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L114"}}),Z=new h({props:{name:"to_original_peft_config",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.to_original_peft_config",parameters:[{name:"peft_config",val:": PeftConfig"},{name:"inplace",val:": bool = False"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L128"}}),tt=new h({props:{name:"to_original_weights",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.to_original_weights",parameters:[{name:"module_fully_qualified_name",val:": str"},{name:"sharded_state_dicts",val:": dict[str, list[torch.Tensor]]"},{name:"parameters_metadata",val:": dict[str, dict[str, typing.Any]]"}],parametersDescription:[{anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.to_original_weights.sharded_state_dicts",description:`<strong>sharded_state_dicts</strong> (dict[str, list[torch.Tensor]]) &#x2014; The sharded state dicts from the custom modeling
implementation.`,name:"sharded_state_dicts"},{anchor:"optimum.neuron.models.training.ModelWeightTransformationSpec.to_original_weights.parameters_metadata",description:"<strong>parameters_metadata</strong> (dict[str, dict[str, Any]]) &#x2014; Metadata about the parameters in the original model.",name:"parameters_metadata"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L207",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A tuple containing the transformed weights and a list of the
names of the parameters to remove from the final state dict.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>tuple[dict[str, torch.Tensor], list[str]]</p>
`}}),et=new x({props:{title:"ModelWeightTransformationSpecs",local:"optimum.neuron.models.training.ModelWeightTransformationSpecs",headingTag:"h3"}}),nt=new h({props:{name:"class optimum.neuron.models.training.ModelWeightTransformationSpecs",anchor:"optimum.neuron.models.training.ModelWeightTransformationSpecs",parameters:[{name:"module_fully_qualified_name",val:": str | None = None"},{name:"specs",val:": optimum.neuron.models.training.transformations_utils.ModelWeightTransformationSpec | list[optimum.neuron.models.training.transformations_utils.ModelWeightTransformationSpec] = <factory>"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L239"}}),rt=new x({props:{title:"CustomModule",local:"optimum.neuron.models.training.CustomModule",headingTag:"h3"}}),at=new h({props:{name:"class optimum.neuron.models.training.CustomModule",anchor:"optimum.neuron.models.training.CustomModule",parameters:[],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L342"}}),ot=new x({props:{title:"Transformation Specifications",local:"transformation-specifications",headingTag:"h2"}}),it=new x({props:{title:"FusedLinearsSpec",local:"optimum.neuron.models.training.FusedLinearsSpec",headingTag:"h3"}}),st=new h({props:{name:"class optimum.neuron.models.training.FusedLinearsSpec",anchor:"optimum.neuron.models.training.FusedLinearsSpec",parameters:[{name:"fused_linear_name",val:": str"},{name:"linear_names",val:": list[str]"},{name:"bias",val:": bool"},{name:"fuse_axis",val:": typing.Union[typing.Literal[0], typing.Literal[1], typing.Literal['column'], typing.Literal['row']]"},{name:"original_dims",val:": list[int]"},{name:"tp_size",val:": int = <factory>"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L365"}}),mt=new x({props:{title:"GQAQKVColumnParallelLinearSpec",local:"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec",headingTag:"h3"}}),lt=new h({props:{name:"class optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec",anchor:"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec",parameters:[{name:"gqa_qkv_projection_name",val:": str"},{name:"query_projection_name",val:": str"},{name:"key_projection_name",val:": str"},{name:"value_projection_name",val:": str"},{name:"output_projection_name",val:": str"},{name:"num_attention_heads",val:": int"},{name:"num_key_value_heads",val:": int"},{name:"kv_size_multiplier",val:": int"},{name:"q_output_size_per_partition",val:": int"},{name:"kv_output_size_per_partition",val:": int"},{name:"fuse_qkv",val:": bool"},{name:"bias",val:": bool"},{name:"tp_size",val:": int = <factory>"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L736"}}),ut=new h({props:{name:"compute_query_indices_for_rank",anchor:"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec.compute_query_indices_for_rank",parameters:[{name:"tp_size",val:": int"},{name:"tp_rank",val:": int"},{name:"num_attention_heads",val:": int"},{name:"num_key_value_heads",val:": int"},{name:"kv_size_multiplier",val:": int"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L808"}}),dt=new h({props:{name:"create_kv_proj_local_weight_from_regular_weight",anchor:"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec.create_kv_proj_local_weight_from_regular_weight",parameters:[{name:"weight_data",val:": Tensor"},{name:"kv_size_multiplier",val:": int"},{name:"output_size_per_partition",val:": int"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L851"}}),pt=new h({props:{name:"create_query_or_output_projection_local_weight_from_regular_weight",anchor:"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec.create_query_or_output_projection_local_weight_from_regular_weight",parameters:[{name:"weight_data",val:": Tensor"},{name:"num_attention_heads",val:": int"},{name:"num_key_value_heads",val:": int"},{name:"kv_size_multiplier",val:": int"},{name:"query_or_output_proj",val:": typing.Union[typing.Literal['query'], typing.Literal['output']]"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L866"}}),gt=new x({props:{title:"Utility Functions",local:"utility-functions",headingTag:"h2"}}),ft=new x({props:{title:"Weight Creation Functions",local:"optimum.neuron.models.training.transformations_utils.create_local_weight_with_padding",headingTag:"h3"}}),_t=new h({props:{name:"optimum.neuron.models.training.transformations_utils.create_local_weight_with_padding",anchor:"optimum.neuron.models.training.transformations_utils.create_local_weight_with_padding",parameters:[{name:"full_weight",val:": Tensor"},{name:"partition_dim",val:": int"},{name:"stride",val:": int"},{name:"out_weight",val:": torch.Tensor | None = None"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L54"}}),ct=new h({props:{name:"optimum.neuron.models.training.transformations_utils.create_local_fused_weight",anchor:"optimum.neuron.models.training.transformations_utils.create_local_fused_weight",parameters:[{name:"tp_rank",val:""},{name:"tp_size",val:""},{name:"individual_weights",val:""},{name:"partition_dim",val:""},{name:"fuse_axis",val:""},{name:"out_weight",val:" = None"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L73"}}),ht=new x({props:{title:"Model-level Functions",local:"optimum.neuron.models.training.specialize_transformation_specs_for_model",headingTag:"h3"}}),vt=new h({props:{name:"optimum.neuron.models.training.specialize_transformation_specs_for_model",anchor:"optimum.neuron.models.training.specialize_transformation_specs_for_model",parameters:[{name:"model",val:": Module"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1458"}}),yt=new h({props:{name:"optimum.neuron.models.training.adapt_peft_config_for_model",anchor:"optimum.neuron.models.training.adapt_peft_config_for_model",parameters:[{name:"model",val:": Module"},{name:"peft_config",val:": peft.config.PeftConfig | dict[str, peft.config.PeftConfig]"},{name:"inplace",val:": bool = False"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1467"}}),wt=new h({props:{name:"optimum.neuron.models.training.to_original_peft_config_for_model",anchor:"optimum.neuron.models.training.to_original_peft_config_for_model",parameters:[{name:"model",val:": Module"},{name:"peft_config",val:": PeftConfig"},{name:"inplace",val:": bool = False"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1484"}}),Ct=new x({props:{title:"State Dict Functions",local:"optimum.neuron.models.training.adapt_state_dict",headingTag:"h3"}}),Tt=new h({props:{name:"optimum.neuron.models.training.adapt_state_dict",anchor:"optimum.neuron.models.training.adapt_state_dict",parameters:[{name:"model",val:": Module"},{name:"state_dict",val:": dict[str, torch.Tensor]"},{name:"upstanding_sharded_params",val:": dict[str, torch.Tensor]"},{name:"inplace",val:": bool = False"},{name:"**peft_kwargs",val:": Any"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1516"}}),Lt=new h({props:{name:"optimum.neuron.models.training.to_original_weights",anchor:"optimum.neuron.models.training.to_original_weights",parameters:[{name:"transformations_specs",val:": list[optimum.neuron.models.training.transformations_utils.ModelWeightTransformationSpecs]"},{name:"sharded_state_dicts",val:": dict[str, list[torch.Tensor]]"},{name:"parameters_metadata",val:": dict[str, dict[str, typing.Any]]"},{name:"**peft_kwargs",val:": Any"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1590"}}),Pt=new x({props:{title:"Metadata Functions",local:"optimum.neuron.models.training.create_parameter_metadata",headingTag:"h3"}}),St=new h({props:{name:"optimum.neuron.models.training.create_parameter_metadata",anchor:"optimum.neuron.models.training.create_parameter_metadata",parameters:[{name:"model",val:""}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1659"}}),Mt=new h({props:{name:"optimum.neuron.models.training.transformations_utils.get_tensor_model_parallel_attributes",anchor:"optimum.neuron.models.training.transformations_utils.get_tensor_model_parallel_attributes",parameters:[{name:"tensor",val:": Tensor"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1645"}}),Vt=new x({props:{title:"Helper Functions",local:"optimum.neuron.models.training.transformations_utils.remove_adapter_name",headingTag:"h3"}}),Dt=new h({props:{name:"optimum.neuron.models.training.transformations_utils.remove_adapter_name",anchor:"optimum.neuron.models.training.transformations_utils.remove_adapter_name",parameters:[{name:"name",val:": str"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1501"}}),It=new h({props:{name:"optimum.neuron.models.training.transformations_utils.is_base_layer",anchor:"optimum.neuron.models.training.transformations_utils.is_base_layer",parameters:[{name:"name",val:": str"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1505"}}),Wt=new h({props:{name:"optimum.neuron.models.training.transformations_utils.get_adapter_name",anchor:"optimum.neuron.models.training.transformations_utils.get_adapter_name",parameters:[{name:"parameter_fully_qualified_name",val:": str"}],source:"https://github.com/huggingface/optimum-neuron/blob/vr_1057/optimum/neuron/models/training/transformations_utils.py#L1509"}}),{c(){C=s("meta"),oe=r(),re=s("p"),ie=r(),l(K.$$.fragment),se=r(),l(N.$$.fragment),me=r(),R=s("p"),R.textContent=Wn,le=r(),l(U.$$.fragment),ue=r(),l(H.$$.fragment),de=r(),$=s("div"),l(B.$$.fragment),on=r(),qt=s("p"),qt.textContent=qn,sn=r(),I=s("div"),l(J.$$.fragment),mn=r(),zt=s("p"),zt.textContent=zn,ln=r(),F=s("div"),l(O.$$.fragment),un=r(),Qt=s("p"),Qt.textContent=Qn,dn=r(),W=s("div"),l(X.$$.fragment),pn=r(),At=s("p"),At.textContent=An,gn=r(),q=s("div"),l(Y.$$.fragment),fn=r(),jt=s("p"),jt.textContent=jn,_n=r(),z=s("div"),l(Z.$$.fragment),cn=r(),Gt=s("p"),Gt.textContent=Gn,hn=r(),Q=s("div"),l(tt.$$.fragment),$n=r(),Kt=s("p"),Kt.textContent=Kn,pe=r(),l(et.$$.fragment),ge=r(),T=s("div"),l(nt.$$.fragment),vn=r(),Nt=s("p"),Nt.textContent=Nn,fe=r(),l(rt.$$.fragment),_e=r(),L=s("div"),l(at.$$.fragment),bn=r(),Rt=s("p"),Rt.textContent=Rn,ce=r(),l(ot.$$.fragment),he=r(),l(it.$$.fragment),$e=r(),P=s("div"),l(st.$$.fragment),yn=r(),Ut=s("p"),Ut.textContent=Un,ve=r(),l(mt.$$.fragment),be=r(),y=s("div"),l(lt.$$.fragment),xn=r(),Ht=s("p"),Ht.textContent=Hn,wn=r(),A=s("div"),l(ut.$$.fragment),Cn=r(),Bt=s("p"),Bt.textContent=Bn,Tn=r(),j=s("div"),l(dt.$$.fragment),Ln=r(),Jt=s("p"),Jt.textContent=Jn,Pn=r(),G=s("div"),l(pt.$$.fragment),Sn=r(),Ot=s("p"),Ot.textContent=On,ye=r(),l(gt.$$.fragment),xe=r(),l(ft.$$.fragment),we=r(),S=s("div"),l(_t.$$.fragment),Mn=r(),Xt=s("p"),Xt.textContent=Xn,Ce=r(),M=s("div"),l(ct.$$.fragment),Vn=r(),Yt=s("p"),Yt.textContent=Yn,Te=r(),l(ht.$$.fragment),Le=r(),$t=s("div"),l(vt.$$.fragment),Pe=r(),bt=s("div"),l(yt.$$.fragment),Se=r(),xt=s("div"),l(wt.$$.fragment),Me=r(),l(Ct.$$.fragment),Ve=r(),V=s("div"),l(Tt.$$.fragment),kn=r(),Zt=s("p"),Zt.textContent=Zn,ke=r(),k=s("div"),l(Lt.$$.fragment),Dn=r(),te=s("p"),te.textContent=tr,De=r(),l(Pt.$$.fragment),Ee=r(),D=s("div"),l(St.$$.fragment),En=r(),ee=s("p"),ee.textContent=er,Ie=r(),E=s("div"),l(Mt.$$.fragment),In=r(),ne=s("p"),ne.textContent=nr,Fe=r(),l(Vt.$$.fragment),We=r(),kt=s("div"),l(Dt.$$.fragment),qe=r(),Et=s("div"),l(It.$$.fragment),ze=r(),Ft=s("div"),l(Wt.$$.fragment),Qe=r(),ae=s("p"),this.h()},l(t){const n=fr("svelte-u9bgzb",document.head);C=m(n,"META",{name:!0,content:!0}),n.forEach(e),oe=a(t),re=m(t,"P",{}),_(re).forEach(e),ie=a(t),u(K.$$.fragment,t),se=a(t),u(N.$$.fragment,t),me=a(t),R=m(t,"P",{"data-svelte-h":!0}),v(R)!=="svelte-15ybmaq"&&(R.textContent=Wn),le=a(t),u(U.$$.fragment,t),ue=a(t),u(H.$$.fragment,t),de=a(t),$=m(t,"DIV",{class:!0});var b=_($);u(B.$$.fragment,b),on=a(b),qt=m(b,"P",{"data-svelte-h":!0}),v(qt)!=="svelte-piuo5k"&&(qt.textContent=qn),sn=a(b),I=m(b,"DIV",{class:!0});var je=_(I);u(J.$$.fragment,je),mn=a(je),zt=m(je,"P",{"data-svelte-h":!0}),v(zt)!=="svelte-1g1rip0"&&(zt.textContent=zn),je.forEach(e),ln=a(b),F=m(b,"DIV",{class:!0});var Ge=_(F);u(O.$$.fragment,Ge),un=a(Ge),Qt=m(Ge,"P",{"data-svelte-h":!0}),v(Qt)!=="svelte-tud2d"&&(Qt.textContent=Qn),Ge.forEach(e),dn=a(b),W=m(b,"DIV",{class:!0});var Ke=_(W);u(X.$$.fragment,Ke),pn=a(Ke),At=m(Ke,"P",{"data-svelte-h":!0}),v(At)!=="svelte-1fydw30"&&(At.textContent=An),Ke.forEach(e),gn=a(b),q=m(b,"DIV",{class:!0});var Ne=_(q);u(Y.$$.fragment,Ne),fn=a(Ne),jt=m(Ne,"P",{"data-svelte-h":!0}),v(jt)!=="svelte-1hsjtcs"&&(jt.textContent=jn),Ne.forEach(e),_n=a(b),z=m(b,"DIV",{class:!0});var Re=_(z);u(Z.$$.fragment,Re),cn=a(Re),Gt=m(Re,"P",{"data-svelte-h":!0}),v(Gt)!=="svelte-123nqpe"&&(Gt.textContent=Gn),Re.forEach(e),hn=a(b),Q=m(b,"DIV",{class:!0});var Ue=_(Q);u(tt.$$.fragment,Ue),$n=a(Ue),Kt=m(Ue,"P",{"data-svelte-h":!0}),v(Kt)!=="svelte-1c8f7rm"&&(Kt.textContent=Kn),Ue.forEach(e),b.forEach(e),pe=a(t),u(et.$$.fragment,t),ge=a(t),T=m(t,"DIV",{class:!0});var He=_(T);u(nt.$$.fragment,He),vn=a(He),Nt=m(He,"P",{"data-svelte-h":!0}),v(Nt)!=="svelte-2r62m5"&&(Nt.textContent=Nn),He.forEach(e),fe=a(t),u(rt.$$.fragment,t),_e=a(t),L=m(t,"DIV",{class:!0});var Be=_(L);u(at.$$.fragment,Be),bn=a(Be),Rt=m(Be,"P",{"data-svelte-h":!0}),v(Rt)!=="svelte-e9fug5"&&(Rt.textContent=Rn),Be.forEach(e),ce=a(t),u(ot.$$.fragment,t),he=a(t),u(it.$$.fragment,t),$e=a(t),P=m(t,"DIV",{class:!0});var Je=_(P);u(st.$$.fragment,Je),yn=a(Je),Ut=m(Je,"P",{"data-svelte-h":!0}),v(Ut)!=="svelte-biyc3t"&&(Ut.textContent=Un),Je.forEach(e),ve=a(t),u(mt.$$.fragment,t),be=a(t),y=m(t,"DIV",{class:!0});var w=_(y);u(lt.$$.fragment,w),xn=a(w),Ht=m(w,"P",{"data-svelte-h":!0}),v(Ht)!=="svelte-4ok2dl"&&(Ht.textContent=Hn),wn=a(w),A=m(w,"DIV",{class:!0});var Oe=_(A);u(ut.$$.fragment,Oe),Cn=a(Oe),Bt=m(Oe,"P",{"data-svelte-h":!0}),v(Bt)!=="svelte-10anslq"&&(Bt.textContent=Bn),Oe.forEach(e),Tn=a(w),j=m(w,"DIV",{class:!0});var Xe=_(j);u(dt.$$.fragment,Xe),Ln=a(Xe),Jt=m(Xe,"P",{"data-svelte-h":!0}),v(Jt)!=="svelte-1uml703"&&(Jt.textContent=Jn),Xe.forEach(e),Pn=a(w),G=m(w,"DIV",{class:!0});var Ye=_(G);u(pt.$$.fragment,Ye),Sn=a(Ye),Ot=m(Ye,"P",{"data-svelte-h":!0}),v(Ot)!=="svelte-irpg0a"&&(Ot.textContent=On),Ye.forEach(e),w.forEach(e),ye=a(t),u(gt.$$.fragment,t),xe=a(t),u(ft.$$.fragment,t),we=a(t),S=m(t,"DIV",{class:!0});var Ze=_(S);u(_t.$$.fragment,Ze),Mn=a(Ze),Xt=m(Ze,"P",{"data-svelte-h":!0}),v(Xt)!=="svelte-duprsz"&&(Xt.textContent=Xn),Ze.forEach(e),Ce=a(t),M=m(t,"DIV",{class:!0});var tn=_(M);u(ct.$$.fragment,tn),Vn=a(tn),Yt=m(tn,"P",{"data-svelte-h":!0}),v(Yt)!=="svelte-rss5dk"&&(Yt.textContent=Yn),tn.forEach(e),Te=a(t),u(ht.$$.fragment,t),Le=a(t),$t=m(t,"DIV",{class:!0});var rr=_($t);u(vt.$$.fragment,rr),rr.forEach(e),Pe=a(t),bt=m(t,"DIV",{class:!0});var ar=_(bt);u(yt.$$.fragment,ar),ar.forEach(e),Se=a(t),xt=m(t,"DIV",{class:!0});var or=_(xt);u(wt.$$.fragment,or),or.forEach(e),Me=a(t),u(Ct.$$.fragment,t),Ve=a(t),V=m(t,"DIV",{class:!0});var en=_(V);u(Tt.$$.fragment,en),kn=a(en),Zt=m(en,"P",{"data-svelte-h":!0}),v(Zt)!=="svelte-tud2d"&&(Zt.textContent=Zn),en.forEach(e),ke=a(t),k=m(t,"DIV",{class:!0});var nn=_(k);u(Lt.$$.fragment,nn),Dn=a(nn),te=m(nn,"P",{"data-svelte-h":!0}),v(te)!=="svelte-1f7f90"&&(te.textContent=tr),nn.forEach(e),De=a(t),u(Pt.$$.fragment,t),Ee=a(t),D=m(t,"DIV",{class:!0});var rn=_(D);u(St.$$.fragment,rn),En=a(rn),ee=m(rn,"P",{"data-svelte-h":!0}),v(ee)!=="svelte-1a59kht"&&(ee.textContent=er),rn.forEach(e),Ie=a(t),E=m(t,"DIV",{class:!0});var an=_(E);u(Mt.$$.fragment,an),In=a(an),ne=m(an,"P",{"data-svelte-h":!0}),v(ne)!=="svelte-13y8yz3"&&(ne.textContent=nr),an.forEach(e),Fe=a(t),u(Vt.$$.fragment,t),We=a(t),kt=m(t,"DIV",{class:!0});var ir=_(kt);u(Dt.$$.fragment,ir),ir.forEach(e),qe=a(t),Et=m(t,"DIV",{class:!0});var sr=_(Et);u(It.$$.fragment,sr),sr.forEach(e),ze=a(t),Ft=m(t,"DIV",{class:!0});var mr=_(Ft);u(Wt.$$.fragment,mr),mr.forEach(e),Qe=a(t),ae=m(t,"P",{}),_(ae).forEach(e),this.h()},h(){c(C,"name","hf:doc:metadata"),c(C,"content",hr),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,n){o(document.head,C),i(t,oe,n),i(t,re,n),i(t,ie,n),d(K,t,n),i(t,se,n),d(N,t,n),i(t,me,n),i(t,R,n),i(t,le,n),d(U,t,n),i(t,ue,n),d(H,t,n),i(t,de,n),i(t,$,n),d(B,$,null),o($,on),o($,qt),o($,sn),o($,I),d(J,I,null),o(I,mn),o(I,zt),o($,ln),o($,F),d(O,F,null),o(F,un),o(F,Qt),o($,dn),o($,W),d(X,W,null),o(W,pn),o(W,At),o($,gn),o($,q),d(Y,q,null),o(q,fn),o(q,jt),o($,_n),o($,z),d(Z,z,null),o(z,cn),o(z,Gt),o($,hn),o($,Q),d(tt,Q,null),o(Q,$n),o(Q,Kt),i(t,pe,n),d(et,t,n),i(t,ge,n),i(t,T,n),d(nt,T,null),o(T,vn),o(T,Nt),i(t,fe,n),d(rt,t,n),i(t,_e,n),i(t,L,n),d(at,L,null),o(L,bn),o(L,Rt),i(t,ce,n),d(ot,t,n),i(t,he,n),d(it,t,n),i(t,$e,n),i(t,P,n),d(st,P,null),o(P,yn),o(P,Ut),i(t,ve,n),d(mt,t,n),i(t,be,n),i(t,y,n),d(lt,y,null),o(y,xn),o(y,Ht),o(y,wn),o(y,A),d(ut,A,null),o(A,Cn),o(A,Bt),o(y,Tn),o(y,j),d(dt,j,null),o(j,Ln),o(j,Jt),o(y,Pn),o(y,G),d(pt,G,null),o(G,Sn),o(G,Ot),i(t,ye,n),d(gt,t,n),i(t,xe,n),d(ft,t,n),i(t,we,n),i(t,S,n),d(_t,S,null),o(S,Mn),o(S,Xt),i(t,Ce,n),i(t,M,n),d(ct,M,null),o(M,Vn),o(M,Yt),i(t,Te,n),d(ht,t,n),i(t,Le,n),i(t,$t,n),d(vt,$t,null),i(t,Pe,n),i(t,bt,n),d(yt,bt,null),i(t,Se,n),i(t,xt,n),d(wt,xt,null),i(t,Me,n),d(Ct,t,n),i(t,Ve,n),i(t,V,n),d(Tt,V,null),o(V,kn),o(V,Zt),i(t,ke,n),i(t,k,n),d(Lt,k,null),o(k,Dn),o(k,te),i(t,De,n),d(Pt,t,n),i(t,Ee,n),i(t,D,n),d(St,D,null),o(D,En),o(D,ee),i(t,Ie,n),i(t,E,n),d(Mt,E,null),o(E,In),o(E,ne),i(t,Fe,n),d(Vt,t,n),i(t,We,n),i(t,kt,n),d(Dt,kt,null),i(t,qe,n),i(t,Et,n),d(It,Et,null),i(t,ze,n),i(t,Ft,n),d(Wt,Ft,null),i(t,Qe,n),i(t,ae,n),Ae=!0},p:ur,i(t){Ae||(p(K.$$.fragment,t),p(N.$$.fragment,t),p(U.$$.fragment,t),p(H.$$.fragment,t),p(B.$$.fragment,t),p(J.$$.fragment,t),p(O.$$.fragment,t),p(X.$$.fragment,t),p(Y.$$.fragment,t),p(Z.$$.fragment,t),p(tt.$$.fragment,t),p(et.$$.fragment,t),p(nt.$$.fragment,t),p(rt.$$.fragment,t),p(at.$$.fragment,t),p(ot.$$.fragment,t),p(it.$$.fragment,t),p(st.$$.fragment,t),p(mt.$$.fragment,t),p(lt.$$.fragment,t),p(ut.$$.fragment,t),p(dt.$$.fragment,t),p(pt.$$.fragment,t),p(gt.$$.fragment,t),p(ft.$$.fragment,t),p(_t.$$.fragment,t),p(ct.$$.fragment,t),p(ht.$$.fragment,t),p(vt.$$.fragment,t),p(yt.$$.fragment,t),p(wt.$$.fragment,t),p(Ct.$$.fragment,t),p(Tt.$$.fragment,t),p(Lt.$$.fragment,t),p(Pt.$$.fragment,t),p(St.$$.fragment,t),p(Mt.$$.fragment,t),p(Vt.$$.fragment,t),p(Dt.$$.fragment,t),p(It.$$.fragment,t),p(Wt.$$.fragment,t),Ae=!0)},o(t){g(K.$$.fragment,t),g(N.$$.fragment,t),g(U.$$.fragment,t),g(H.$$.fragment,t),g(B.$$.fragment,t),g(J.$$.fragment,t),g(O.$$.fragment,t),g(X.$$.fragment,t),g(Y.$$.fragment,t),g(Z.$$.fragment,t),g(tt.$$.fragment,t),g(et.$$.fragment,t),g(nt.$$.fragment,t),g(rt.$$.fragment,t),g(at.$$.fragment,t),g(ot.$$.fragment,t),g(it.$$.fragment,t),g(st.$$.fragment,t),g(mt.$$.fragment,t),g(lt.$$.fragment,t),g(ut.$$.fragment,t),g(dt.$$.fragment,t),g(pt.$$.fragment,t),g(gt.$$.fragment,t),g(ft.$$.fragment,t),g(_t.$$.fragment,t),g(ct.$$.fragment,t),g(ht.$$.fragment,t),g(vt.$$.fragment,t),g(yt.$$.fragment,t),g(wt.$$.fragment,t),g(Ct.$$.fragment,t),g(Tt.$$.fragment,t),g(Lt.$$.fragment,t),g(Pt.$$.fragment,t),g(St.$$.fragment,t),g(Mt.$$.fragment,t),g(Vt.$$.fragment,t),g(Dt.$$.fragment,t),g(It.$$.fragment,t),g(Wt.$$.fragment,t),Ae=!1},d(t){t&&(e(oe),e(re),e(ie),e(se),e(me),e(R),e(le),e(ue),e(de),e($),e(pe),e(ge),e(T),e(fe),e(_e),e(L),e(ce),e(he),e($e),e(P),e(ve),e(be),e(y),e(ye),e(xe),e(we),e(S),e(Ce),e(M),e(Te),e(Le),e($t),e(Pe),e(bt),e(Se),e(xt),e(Me),e(Ve),e(V),e(ke),e(k),e(De),e(Ee),e(D),e(Ie),e(E),e(Fe),e(We),e(kt),e(qe),e(Et),e(ze),e(Ft),e(Qe),e(ae)),e(C),f(K,t),f(N,t),f(U,t),f(H,t),f(B),f(J),f(O),f(X),f(Y),f(Z),f(tt),f(et,t),f(nt),f(rt,t),f(at),f(ot,t),f(it,t),f(st),f(mt,t),f(lt),f(ut),f(dt),f(pt),f(gt,t),f(ft,t),f(_t),f(ct),f(ht,t),f(vt),f(yt),f(wt),f(Ct,t),f(Tt),f(Lt),f(Pt,t),f(St),f(Mt),f(Vt,t),f(Dt),f(It),f(Wt)}}}const hr='{"title":"Model Weight Transformation Specs","local":"model-weight-transformation-specs","sections":[{"title":"Base Classes","local":"base-classes","sections":[{"title":"ModelWeightTransformationSpec","local":"optimum.neuron.models.training.ModelWeightTransformationSpec","sections":[],"depth":3},{"title":"ModelWeightTransformationSpecs","local":"optimum.neuron.models.training.ModelWeightTransformationSpecs","sections":[],"depth":3},{"title":"CustomModule","local":"optimum.neuron.models.training.CustomModule","sections":[],"depth":3}],"depth":2},{"title":"Transformation Specifications","local":"transformation-specifications","sections":[{"title":"FusedLinearsSpec","local":"optimum.neuron.models.training.FusedLinearsSpec","sections":[],"depth":3},{"title":"GQAQKVColumnParallelLinearSpec","local":"optimum.neuron.models.training.GQAQKVColumnParallelLinearSpec","sections":[],"depth":3}],"depth":2},{"title":"Utility Functions","local":"utility-functions","sections":[{"title":"Weight Creation Functions","local":"optimum.neuron.models.training.transformations_utils.create_local_weight_with_padding","sections":[],"depth":3},{"title":"Model-level Functions","local":"optimum.neuron.models.training.specialize_transformation_specs_for_model","sections":[],"depth":3},{"title":"State Dict Functions","local":"optimum.neuron.models.training.adapt_state_dict","sections":[],"depth":3},{"title":"Metadata Functions","local":"optimum.neuron.models.training.create_parameter_metadata","sections":[],"depth":3},{"title":"Helper Functions","local":"optimum.neuron.models.training.transformations_utils.remove_adapter_name","sections":[],"depth":3}],"depth":2}],"depth":1}';function $r(Fn){return dr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cr extends pr{constructor(C){super(),gr(this,C,$r,cr,lr,{})}}export{Cr as component};
