Views
No views yet
| Configuration | Explanation |
|---|---|
BASELINE | a reference functionally equivalent to the original model |
BASIC | all linear algebraic operands quantized to MXINT8-64 |
pip install dmx_compressor1git clone https://github.com/EleutherAI/lm-evaluation-harness
2cd lm-evaluation-harness
3pip install -e .1from dmx.compressor.modeling import DmxModel
2import lm_eval
3from lm_eval.models.huggingface import HFLM
4
5lm_eval.api.registry.register_model("hf", HFLM)
6model_args = "pretrained=d-matrix/gpt2-large,trust_remote_code=True"
7
8lm = lm_eval.api.registry.get_model("hf").create_from_arg_string(model_args, {"batch_size": 1})
9
10# Transform the model with DMX
11lm._model = DmxModel.from_torch(lm._model)
12
13eval_results = lm_eval.evaluate(lm, lm_eval.tasks.get_task_dict(["wikitext"])) # Assign desired task, i.e. "wikitext"