add attn_rms_norm_eps (#8)
Browse files- use specific rms_norm_eps for attn layer (d417ea779138edf602457609bc43ecb399d188ff)
Files changed (3)
21 unmodified lines2223242526274 unmodified lines3233343521 unmodified lines"num_hidden_layers": 32,"num_key_value_heads": 16,"rms_norm_eps": 1e-06,"rope_scaling": null,"rope_theta": 500000.0,"sliding_window": null,4 unmodified lines"use_cache": true,"use_sliding_window": false,"vocab_size": 219520}21 unmodified lines222324252627284 unmodified lines3334353621 unmodified lines"num_hidden_layers": 32,"num_key_value_heads": 16,"rms_norm_eps": 1e-06,"attn_rms_norm_eps": 1e-05,"rope_scaling": null,"rope_theta": 500000.0,"sliding_window": null,4 unmodified lines"use_cache": true,"use_sliding_window": false,"vocab_size": 219520}
41 unmodified lines4243444546474871 unmodified lines12012112212312412523 unmodified lines1491501511521531549 unmodified lines16416516616741 unmodified linesinitializer_range (`float`, *optional*, defaults to 0.02):The standard deviation of the truncated_normal_initializer for initializing all weight matrices.rms_norm_eps (`float`, *optional*, defaults to 1e-06):The epsilon used by the rms normalization layers.use_cache (`bool`, *optional*, defaults to `True`):Whether or not the model should return the last key/values attentions (not used by all models). Onlyrelevant if `config.is_decoder=True`.71 unmodified linesmax_position_embeddings=32768,initializer_range=0.02,rms_norm_eps=1e-6,use_cache=True,tie_word_embeddings=False,rope_theta=10000.0,23 unmodified linesself.hidden_act = hidden_actself.initializer_range = initializer_rangeself.rms_norm_eps = rms_norm_epsself.use_cache = use_cacheself.rope_theta = rope_thetaself.rope_scaling = rope_scaling9 unmodified linestie_word_embeddings=tie_word_embeddings,**kwargs,)logger.info(f' kwargs : {kwargs}')41 unmodified lines42434445464748495071 unmodified lines12212312412512612712823 unmodified lines1521531541551561571589 unmodified lines16816917017141 unmodified linesinitializer_range (`float`, *optional*, defaults to 0.02):The standard deviation of the truncated_normal_initializer for initializing all weight matrices.rms_norm_eps (`float`, *optional*, defaults to 1e-06):The epsilon used by the rms normalization layers, except for the rms normalization in the attention layer.attn_rms_norm_eps (`float`, *optional*, defaults to 1e-05):The epsilon used by the rms normalization in the attention layer.use_cache (`bool`, *optional*, defaults to `True`):Whether or not the model should return the last key/values attentions (not used by all models). Onlyrelevant if `config.is_decoder=True`.71 unmodified linesmax_position_embeddings=32768,initializer_range=0.02,rms_norm_eps=1e-6,attn_rms_norm_eps=1e-5,use_cache=True,tie_word_embeddings=False,rope_theta=10000.0,23 unmodified linesself.hidden_act = hidden_actself.initializer_range = initializer_rangeself.rms_norm_eps = rms_norm_epsself.attn_rms_norm_eps = attn_rms_norm_epsself.use_cache = use_cacheself.rope_theta = rope_thetaself.rope_scaling = rope_scaling9 unmodified linestie_word_embeddings=tie_word_embeddings,**kwargs,)logger.info(f' kwargs : {kwargs}')
361 unmodified lines362363364365366367368361 unmodified linessetattr(self, name, nn.Parameter(torch.zeros(self.head_dim, dtype=torch.float32)))getattr(self, name).data.normal_(mean=0.0, std=0.1)self.subln = MotifRMSNorm(2 * self.head_dim, eps=config.rms_norm_eps)self.lambda_init = 0.8 - 0.6 * math.exp(-0.3 * (layer_idx - 1))self.rotary_emb = MotifRotaryEmbeddingWithCache(self.head_dim,361 unmodified lines362363364365366367368361 unmodified linessetattr(self, name, nn.Parameter(torch.zeros(self.head_dim, dtype=torch.float32)))getattr(self, name).data.normal_(mean=0.0, std=0.1)self.subln = MotifRMSNorm(2 * self.head_dim, eps=config.attn_rms_norm_eps)self.lambda_init = 0.8 - 0.6 * math.exp(-0.3 * (layer_idx - 1))self.rotary_emb = MotifRotaryEmbeddingWithCache(self.head_dim,
config.json+2-1
configuration_motif.py+6-2
modeling_motif.py+1-1