bmah-dmx commited on
Commit
52a564c
1 Parent(s): 51b13a7

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +49 -0
README.md ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ model-index:
3
+ - name: bloom-1b1
4
+ results:
5
+ - task:
6
+ type: text-generation
7
+ dataset:
8
+ name: Wikitext
9
+ type: wikitext
10
+ metrics:
11
+ - type: perplexity (BASELINE)
12
+ value: 23.821933436102835
13
+ - type: perplexity (BASIC)
14
+ value: 24.12128599176988
15
+ ---
16
+ This is a d-Matrix functional reference of the BLOOM-1B1 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-1b1",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
+ ```