Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
model-index:
|
3 |
+
- name: bloom-1b7
|
4 |
+
results:
|
5 |
+
- task:
|
6 |
+
type: text-generation
|
7 |
+
dataset:
|
8 |
+
name: Wikitext
|
9 |
+
type: wikitext
|
10 |
+
metrics:
|
11 |
+
- type: perplexity (BASELINE)
|
12 |
+
value: 20.244437417671687
|
13 |
+
- type: perplexity (BASIC)
|
14 |
+
value: 20.986961659350737
|
15 |
+
---
|
16 |
+
This is a d-Matrix functional reference of the BLOOM-1B7 model.
|
17 |
+
The reference provides the following functional *configurations*:
|
18 |
+
Configuration | Explanation
|
19 |
+
:-- | :--
|
20 |
+
**`BASELINE`** | a reference functionally equivalent to the original model
|
21 |
+
**`BASIC`** | all linear algebraic operands quantized to `BFP16-64`, and all other operations transformed to approximated kernel simulations
|
22 |
+
|
23 |
+
|
24 |
+
### Usage
|
25 |
+
|
26 |
+
Install d-Matrix [Dmx_Compressor](https://github.com/d-matrix-ai/dmx-compressor) first.
|
27 |
+
```sh
|
28 |
+
pip install dmx_compressor
|
29 |
+
```
|
30 |
+
|
31 |
+
The following is an example model and its evaluation.
|
32 |
+
|
33 |
+
```sh
|
34 |
+
pip install lm-eval
|
35 |
+
```
|
36 |
+
|
37 |
+
```python
|
38 |
+
from dmx.compressor.modeling import DmxModel
|
39 |
+
import lm_eval
|
40 |
+
|
41 |
+
model_args = f"pretrained="d-matrix/bloom-1b7",trust_remote_code=True"
|
42 |
+
|
43 |
+
lm = lm_eval.api.registry.get_model("hf").create_from_arg_string(model_args, {"batch_size": 1})
|
44 |
+
|
45 |
+
# Transform the model with DMX
|
46 |
+
lm._model = DmxModel.from_torch(lm._model).to_basic_model() # Using BASIC configuration
|
47 |
+
|
48 |
+
eval_results = lm_eval.evaluate(lm, lm_eval.tasks.get_task_dict([task]) # Assign desired task, i.e. "wikitext"
|
49 |
+
```
|