Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
model-index:
|
| 3 |
+
- name: CodeLlama-7b
|
| 4 |
+
results:
|
| 5 |
+
- task:
|
| 6 |
+
type: code-generation
|
| 7 |
+
dataset:
|
| 8 |
+
name: Humaneval
|
| 9 |
+
type: humaneval
|
| 10 |
+
metrics:
|
| 11 |
+
- type: pass@1 (BASELINE)
|
| 12 |
+
value: 0.3048780487804878
|
| 13 |
+
- type: pass@1 (BASIC)
|
| 14 |
+
value: 0.3170731707317073
|
| 15 |
+
---
|
| 16 |
+
This is a d-Matrix functional reference of the CODELLAMA-7B 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 |
+
git clone https://github.com/bigcode-project/bigcode-evaluation-harness.git
|
| 35 |
+
cd bigcode-evaluation-harness
|
| 36 |
+
pip install .
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from dmx.compressor.modeling import DmxModel
|
| 41 |
+
from bigcode_eval.evaluator import Evaluator
|
| 42 |
+
|
| 43 |
+
pipe = pipeline(
|
| 44 |
+
task="text-generation",
|
| 45 |
+
model="d-matrix/CodeLlama-7b",
|
| 46 |
+
trust_remote_code=True,
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
# Transform the model with DMX
|
| 50 |
+
model = DmxModel.from_torch(pipe.model).to_basic_model() # Using BASIC configuration
|
| 51 |
+
|
| 52 |
+
evaluator = Evaluator(accelerator, model)
|
| 53 |
+
|
| 54 |
+
eval_results = evaluator.evaluate(task) # Assign desired task, i.e. "humaneval"
|
| 55 |
+
```
|