FlashNorm-prepared checkpoint of meta-llama/Llama-3.1-8B. Mathematically equivalent to the source model. This model was presented in the paper FlashNorm: Fast Normalization for Transformers.
The per-channel RMSNorm weight tensors (input_layernorm.weight, post_attention_layernorm.weight, model.norm.weight) are folded into the following linear layers and then removed from the state dict entirely.
Framework support note. Stock vLLM currently does not load this checkpoint because the norm weight tensors are absent. The upstream patch to accept missing tensors is tracked at: TBD (vLLM issue link). Until the patch lands, use HuggingFace Transformers; it loads this with a warning that norm weights were not initialized and defaults them to ones, which is the correct behavior for FlashNorm.
An exact reformulation of RMSNorm -> Linear:
g into the following linear layer: W_star = W @ diag(g), computed once at checkpoint conversion.rms(x).See the paper and the transformer-tricks repo for details.
transformer_tricksimport transformer_tricks as tt
tt.flashify_repo('meta-llama/Llama-3.1-8B', strict=True)
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained('open-machine/Llama-3.1-8B-FlashNorm')
model = AutoModelForCausalLM.from_pretrained('open-machine/Llama-3.1-8B-FlashNorm')
ids = tok('Once upon a time', return_tensors='pt').input_ids
out = model.generate(ids, max_new_tokens=50, do_sample=False)
print(tok.decode(out[0], skip_special_tokens=True))
A warning about missing norm weights is expected; Transformers defaults those to ones, which is the correct value for a FlashNorm checkpoint.
Not yet supported. See the tracking issue linked above.
Inherited from the source model.
@misc{graef2024flashnormfastnormalizationtransformers,
title={FlashNorm: Fast Normalization for Transformers},
author={Nils Graef and Matthew Clapp and Andrew Wasielewski},
year={2024},
eprint={2407.09577},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2407.09577},
}
FlashNorm-prepared checkpoint of meta-llama/Llama-3.1-8B. Mathematically equivalent to the source model. This model was presented in the paper FlashNorm: Fast Normalization for Transformers.
The per-channel RMSNorm weight tensors (input_layernorm.weight, post_attention_layernorm.weight, model.norm.weight) are folded into the following linear layers and then removed from the state dict entirely.
Framework support note. Stock vLLM currently does not load this checkpoint because the norm weight tensors are absent. The upstream patch to accept missing tensors is tracked at: TBD (vLLM issue link). Until the patch lands, use HuggingFace Transformers; it loads this with a warning that norm weights were not initialized and defaults them to ones, which is the correct behavior for FlashNorm.
An exact reformulation of RMSNorm -> Linear:
g into the following linear layer: W_star = W @ diag(g), computed once at checkpoint conversion.rms(x).See the paper and the transformer-tricks repo for details.
transformer_tricksimport transformer_tricks as tt
tt.flashify_repo('meta-llama/Llama-3.1-8B', strict=True)
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained('open-machine/Llama-3.1-8B-FlashNorm')
model = AutoModelForCausalLM.from_pretrained('open-machine/Llama-3.1-8B-FlashNorm')
ids = tok('Once upon a time', return_tensors='pt').input_ids
out = model.generate(ids, max_new_tokens=50, do_sample=False)
print(tok.decode(out[0], skip_special_tokens=True))
A warning about missing norm weights is expected; Transformers defaults those to ones, which is the correct value for a FlashNorm checkpoint.
Not yet supported. See the tracking issue linked above.
Inherited from the source model.
@misc{graef2024flashnormfastnormalizationtransformers,
title={FlashNorm: Fast Normalization for Transformers},
author={Nils Graef and Matthew Clapp and Andrew Wasielewski},
year={2024},
eprint={2407.09577},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2407.09577},
}