Instructions to use open-machine/Qwen3-8B-FlashNorm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use open-machine/Qwen3-8B-FlashNorm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="open-machine/Qwen3-8B-FlashNorm") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("open-machine/Qwen3-8B-FlashNorm") model = AutoModelForCausalLM.from_pretrained("open-machine/Qwen3-8B-FlashNorm") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use open-machine/Qwen3-8B-FlashNorm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "open-machine/Qwen3-8B-FlashNorm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "open-machine/Qwen3-8B-FlashNorm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/open-machine/Qwen3-8B-FlashNorm
- SGLang
How to use open-machine/Qwen3-8B-FlashNorm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "open-machine/Qwen3-8B-FlashNorm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "open-machine/Qwen3-8B-FlashNorm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "open-machine/Qwen3-8B-FlashNorm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "open-machine/Qwen3-8B-FlashNorm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use open-machine/Qwen3-8B-FlashNorm with Docker Model Runner:
docker model run hf.co/open-machine/Qwen3-8B-FlashNorm
Add library_name and paper link
Browse filesHi! I'm Niels from the community science team at Hugging Face. I'm opening this PR to improve the model card for your FlashNorm checkpoint.
Changes include:
- Added `library_name: transformers` to the metadata to enable the "Use in Transformers" snippet and button on the Hub.
- Explicitly linked the research paper [FlashNorm: Fast Normalization for Transformers](https://huggingface.co/papers/2407.09577).
- Added a BibTeX citation section for the paper.
- Preserved existing usage instructions and technical details.
|
@@ -1,17 +1,20 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
base_model: Qwen/Qwen3-8B
|
| 4 |
-
|
| 5 |
-
- flashnorm
|
| 6 |
-
- transformer-tricks
|
| 7 |
-
- efficient-inference
|
| 8 |
-
- weightless-rmsnorm
|
| 9 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
# Qwen3-8B-FlashNorm
|
| 13 |
|
| 14 |
-
FlashNorm-prepared checkpoint of [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B)
|
|
|
|
|
|
|
| 15 |
|
| 16 |
> **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.
|
| 17 |
|
|
@@ -23,7 +26,7 @@ An exact reformulation of `RMSNorm -> Linear`:
|
|
| 23 |
- After folding, the RMSNorm layer has no learnable per-channel scale. At runtime it simply divides by `rms(x)`.
|
| 24 |
- The resulting model computes the same output as the original, by Proposition 1 of the FlashNorm paper.
|
| 25 |
|
| 26 |
-
See the [paper](https://
|
| 27 |
|
| 28 |
## Usage
|
| 29 |
|
|
@@ -53,6 +56,20 @@ A warning about missing norm weights is expected; Transformers defaults those to
|
|
| 53 |
|
| 54 |
Not yet supported. See the tracking issue linked above.
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
## License
|
| 57 |
|
| 58 |
-
Inherited from the source model.
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: Qwen/Qwen3-8B
|
| 3 |
+
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- flashnorm
|
| 8 |
+
- transformer-tricks
|
| 9 |
+
- efficient-inference
|
| 10 |
+
- weightless-rmsnorm
|
| 11 |
---
|
| 12 |
|
| 13 |
# Qwen3-8B-FlashNorm
|
| 14 |
|
| 15 |
+
This is a FlashNorm-prepared checkpoint of [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B), as presented in the paper [FlashNorm: Fast Normalization for Transformers](https://huggingface.co/papers/2407.09577).
|
| 16 |
+
|
| 17 |
+
Mathematically equivalent to the source model. 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.
|
| 18 |
|
| 19 |
> **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.
|
| 20 |
|
|
|
|
| 26 |
- After folding, the RMSNorm layer has no learnable per-channel scale. At runtime it simply divides by `rms(x)`.
|
| 27 |
- The resulting model computes the same output as the original, by Proposition 1 of the FlashNorm paper.
|
| 28 |
|
| 29 |
+
See the [paper](https://huggingface.co/papers/2407.09577) and the [transformer-tricks](https://github.com/OpenMachine-ai/transformer-tricks) repo for details.
|
| 30 |
|
| 31 |
## Usage
|
| 32 |
|
|
|
|
| 56 |
|
| 57 |
Not yet supported. See the tracking issue linked above.
|
| 58 |
|
| 59 |
+
## Citation
|
| 60 |
+
|
| 61 |
+
```bibtex
|
| 62 |
+
@misc{graef2024flashnormfastnormalizationtransformers,
|
| 63 |
+
title={FlashNorm: Fast Normalization for Transformers},
|
| 64 |
+
author={Nils Graef and Matthew Clapp and Andrew Wasielewski},
|
| 65 |
+
year={2024},
|
| 66 |
+
eprint={2407.09577},
|
| 67 |
+
archivePrefix={arXiv},
|
| 68 |
+
primaryClass={cs.LG},
|
| 69 |
+
url={https://arxiv.org/abs/2407.09577},
|
| 70 |
+
}
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
## License
|
| 74 |
|
| 75 |
+
Inherited from the source model.
|