Downloads · 30 days
28
0% of all-time downloads
amd/dbrx-instruct-FP8-KV
dbrx-instruct-FP8-KV is a machine learning model from amd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
- Introduction This model was created by applying Quark with calibration samples from Pile dataset. - Quantization Stragegy - Quantized Layers: All linear layers excluding "lmhead" and "router.layer" - Weight: FP8 sym…
Downloads · 30 days
28
0% of all-time downloads
All-time downloads
12.5K
Public
Parameters
132B
266 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors133 GB · 100%
How the weights are stored.
F8_E4M3130B · 99%
From the Hugging Face model README
export MODEL_DIR = [local model checkpoint folder] or databricks/dbrx-instruct
# single GPU
python3 quantize_quark.py \
--model_dir $MODEL_DIR \
--output_dir dbrx-instruct-FP8-KV \
--quant_scheme w_fp8_a_fp8 \
--kv_cache_dtype fp8 \
--num_calib_data 128 \
--model_export quark_safetensors \
--no_weight_matrix_merge \
--custom_mode fp8
# If model size is too large for single GPU, please use multi GPU instead.
python3 quantize_quark.py
--model_dir $MODEL_DIR \
--output_dir dbrx-instruct-FP8-KV\
--quant_scheme w_fp8_a_fp8 \
--kv_cache_dtype fp8 \
--num_calib_data 128 \
--multi_gpu \
--model_export quark_safetensors \
--no_weight_matrix_merge \
--custom_mode fp8
Quark has its own export format and allows FP8 quantized models to be efficiently deployed using the vLLM backend(vLLM-compatible). In the dbrx-instruct model, "transformer.blocks.*.ffn.experts" modules can be divided into experts-num mlps, and if the shape of the weight of w1 in one of the mlps is [dim1, dim2], then the shape of “transformer.blocks.*.ffn.experts.mlp.w1.weight“ in the exported safetensors file is [dim1*experts-num, dim2]. The shapes of "transformer.blocks.*.ffn.experts.mlp.w1.weight_scale" and "transformer.blocks.*.ffn.experts.mlp.w1.input_scale" are [dim1]. Similarly, this also applies to the w2 and v1 of "transformer.blocks.*.ffn.experts.mlp".
Quark currently uses perplexity(PPL) as the evaluation metric for accuracy loss before and after quantization.The specific PPL algorithm can be referenced in the quantize_quark.py. The quantization evaluation results are conducted in pseudo-quantization mode, which may slightly differ from the actual quantized inference accuracy. These results are provided for reference only.
Modifications copyright(c) 2024 Advanced Micro Devices,Inc. All rights reserved.