Downloads · 30 days
8
14% of all-time downloads
d-matrix/Llama-3.1-70B
Llama-3.1-70B is a machine learning model from d-matrix. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a d-Matrix functional reference of the Llama-3.1-70B model. The reference provides the following functional configurations: Configuration | Explanation :-- | :-- BASELINE | a reference functionally equivalent…
Downloads · 30 days
8
14% of all-time downloads
All-time downloads
57
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py80.8 KB · 95%
From the Hugging Face model README
This is a d-Matrix functional reference of the Llama-3.1-70B model. The reference provides the following functional configurations:
| Configuration | Explanation |
|---|---|
BASELINE | a reference functionally equivalent to the original model |
BASIC | all linear algebraic operands quantized to MXINT8-64 |
Install d-Matrix Dmx_Compressor first.
pip install dmx_compressor
The following is an example of how to instantiate the model. Note that this repo only contains custom modeling code and still uses weights from the official model repo.
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig
from dmx.compressor import DmxModel
import torch
model_name = "d-matrix/Llama-3.1-70B"
official_model = "meta-llama/Llama-3.1-70B"
config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
official_model,
config=config,
trust_remote_code=True,
device_map="auto",
)
model = DmxModel.from_torch(model)
x = torch.rand(1, 1024)
model(x)