“sayehs”
commited on
Commit
·
94a9749
1
Parent(s):
6a8a059
modified readme
Browse files
README.md
CHANGED
@@ -1,3 +1,42 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- pytorch
|
6 |
+
- causal-lm
|
7 |
license: apache-2.0
|
8 |
+
datasets:
|
9 |
+
- EleutherAI/pile
|
10 |
---
|
11 |
+
This is a d-Matrix functional reference of the [GPTJ-6B](https://huggingface.co/EleutherAI/gpt-j-6b) model.
|
12 |
+
|
13 |
+
The reference provides the following functional *configurations*:
|
14 |
+
Configuration | Explanation
|
15 |
+
:-- | :--
|
16 |
+
**`BASELINE`** | a reference functionally equivalent to the original model
|
17 |
+
**`BASIC`** | all linear algebraic operands quantized to `BFP16-64`, and all other operations transformed to approximated kernel simulations
|
18 |
+
|
19 |
+
|
20 |
+
### Usage
|
21 |
+
|
22 |
+
Install d-Matrix [ML Tools](https://github.com/d-matrix-ai/dmx-mltools) first.
|
23 |
+
|
24 |
+
```sh
|
25 |
+
pip install dmx-mltools
|
26 |
+
```
|
27 |
+
|
28 |
+
The following is an example model and its evaluation.
|
29 |
+
|
30 |
+
```python
|
31 |
+
from mltools.dmx import pipeline
|
32 |
+
|
33 |
+
pipe = pipeline(
|
34 |
+
task="text-generation",
|
35 |
+
model="d-matrix/gpt-j-6b",
|
36 |
+
dmx_config="BASELINE", # see above for other variants
|
37 |
+
trust_remote_code=True,
|
38 |
+
# device_map="auto", # enabling model parallel on multi-GPU nodes
|
39 |
+
)
|
40 |
+
|
41 |
+
results = pipe.evaluate(metric=["d-matrix/perplexity", "d-matrix/accuracy"], dataset="LAMBADA")
|
42 |
+
```
|