-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Marlin-quantized models
This change adds support for Marlin-quantized models. Marlin is an FP16xINT4 matmul kernel, which provides good speedups decoding batches of 16-32 tokens. It supports quantized models with symmetric quantization, groupsize -1 or 128, and 4-bit. Tested with: - Llama 2 - Llama 3 - Phi 3
- Loading branch information
Showing
23 changed files
with
788 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
integration-tests/models/__snapshots__/test_flash_llama_marlin/test_flash_llama_marlin.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"details": { | ||
"best_of_sequences": null, | ||
"finish_reason": "length", | ||
"generated_tokens": 10, | ||
"prefill": [ | ||
{ | ||
"id": 1, | ||
"logprob": null, | ||
"text": "<s>" | ||
}, | ||
{ | ||
"id": 4321, | ||
"logprob": -12.390625, | ||
"text": "Test" | ||
}, | ||
{ | ||
"id": 2009, | ||
"logprob": -11.0625, | ||
"text": "request" | ||
} | ||
], | ||
"seed": null, | ||
"tokens": [ | ||
{ | ||
"id": 13, | ||
"logprob": -2.0507812, | ||
"special": false, | ||
"text": "\n" | ||
}, | ||
{ | ||
"id": 13, | ||
"logprob": -2.3007812, | ||
"special": false, | ||
"text": "\n" | ||
}, | ||
{ | ||
"id": 29902, | ||
"logprob": -2.0449219, | ||
"special": false, | ||
"text": "I" | ||
}, | ||
{ | ||
"id": 505, | ||
"logprob": -1.3242188, | ||
"special": false, | ||
"text": " have" | ||
}, | ||
{ | ||
"id": 263, | ||
"logprob": -0.2076416, | ||
"special": false, | ||
"text": " a" | ||
}, | ||
{ | ||
"id": 1243, | ||
"logprob": -2.0273438, | ||
"special": false, | ||
"text": " test" | ||
}, | ||
{ | ||
"id": 2009, | ||
"logprob": -0.6845703, | ||
"special": false, | ||
"text": " request" | ||
}, | ||
{ | ||
"id": 515, | ||
"logprob": -1.1748047, | ||
"special": false, | ||
"text": " from" | ||
}, | ||
{ | ||
"id": 263, | ||
"logprob": -1.0644531, | ||
"special": false, | ||
"text": " a" | ||
}, | ||
{ | ||
"id": 1404, | ||
"logprob": -1.5224609, | ||
"special": false, | ||
"text": " user" | ||
} | ||
], | ||
"top_tokens": null | ||
}, | ||
"generated_text": "\n\nI have a test request from a user" | ||
} |
89 changes: 89 additions & 0 deletions
89
...ests/models/__snapshots__/test_flash_llama_marlin/test_flash_llama_marlin_all_params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"details": { | ||
"best_of_sequences": null, | ||
"finish_reason": "length", | ||
"generated_tokens": 10, | ||
"prefill": [ | ||
{ | ||
"id": 1, | ||
"logprob": null, | ||
"text": "<s>" | ||
}, | ||
{ | ||
"id": 4321, | ||
"logprob": -12.390625, | ||
"text": "Test" | ||
}, | ||
{ | ||
"id": 2009, | ||
"logprob": -11.0625, | ||
"text": "request" | ||
} | ||
], | ||
"seed": 0, | ||
"tokens": [ | ||
{ | ||
"id": 5229, | ||
"logprob": -1.2607422, | ||
"special": false, | ||
"text": " failed" | ||
}, | ||
{ | ||
"id": 29901, | ||
"logprob": 0.0, | ||
"special": false, | ||
"text": ":" | ||
}, | ||
{ | ||
"id": 6527, | ||
"logprob": -0.11450195, | ||
"special": false, | ||
"text": " Could" | ||
}, | ||
{ | ||
"id": 451, | ||
"logprob": 0.0, | ||
"special": false, | ||
"text": " not" | ||
}, | ||
{ | ||
"id": 4511, | ||
"logprob": -0.2286377, | ||
"special": false, | ||
"text": " connect" | ||
}, | ||
{ | ||
"id": 304, | ||
"logprob": 0.0, | ||
"special": false, | ||
"text": " to" | ||
}, | ||
{ | ||
"id": 1923, | ||
"logprob": -1.2568359, | ||
"special": false, | ||
"text": " server" | ||
}, | ||
{ | ||
"id": 13, | ||
"logprob": 0.0, | ||
"special": false, | ||
"text": "\n" | ||
}, | ||
{ | ||
"id": 13, | ||
"logprob": -0.15905762, | ||
"special": false, | ||
"text": "\n" | ||
}, | ||
{ | ||
"id": 29902, | ||
"logprob": -0.21618652, | ||
"special": false, | ||
"text": "I" | ||
} | ||
], | ||
"top_tokens": null | ||
}, | ||
"generated_text": "Test request failed: Could not connect to server\n\nI" | ||
} |
Oops, something went wrong.