Downloads · 30 days
9
8% of all-time downloads
mikudev/L3-8B-Stheno-v3.2-FP8
L3-8B-Stheno-v3.2-FP8 is a machine learning model from mikudev. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Original Model: https://huggingface.co/Sao10K/L3-8B-Stheno-v3.2
Downloads · 30 days
9
8% of all-time downloads
All-time downloads
108
Public
Parameters
8B
9.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors9.1 GB · 100%
How the weights are stored.
F8_E4M37B · 87%
From the Hugging Face model README
Original Model: https://huggingface.co/Sao10K/L3-8B-Stheno-v3.2
Quantized with FP8 using https://github.com/neuralmagic/AutoFP8
Script:
from datasets import load_dataset
from transformers import AutoTokenizer
from auto_fp8 import AutoFP8ForCausalLM, BaseQuantizeConfig
pretrained_model_dir = "Sao10K/L3-8B-Stheno-v3.2"
quantized_model_dir = "L3-8B-Stheno-v3.2-FP8"
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_dir, use_fast=True, model_max_length=4096)
tokenizer.pad_token = tokenizer.eos_token
ds = load_dataset("mgoin/ultrachat_2k", split="train_sft").select(range(512))
examples = [tokenizer.apply_chat_template(batch["messages"], tokenize=False) for batch in ds]
examples = tokenizer(examples, padding=True, truncation=True, return_tensors="pt").to("cuda")
quantize_config = BaseQuantizeConfig(
quant_method="fp8",
activation_scheme="static",
ignore_patterns=["re:.*lm_head"],
)
model = AutoFP8ForCausalLM.from_pretrained(
pretrained_model_dir, quantize_config=quantize_config
)
model.quantize(examples)
model.save_quantized(quantized_model_dir)