huggingface / huggingface/candle

Large text generation discrepancy with metal On vs Off for quantized models

Open
#1,725 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
21.1k
Forks
1.8k
Avg merge
16h 42m
Merged PRs (30d)
25

Description

Without --features metal `(CPU)` for `Llama2 7B-Chat Q4_1` quant:

```bash
cargo run --example quantized --release -- --prompt "Who is the current president of the USA?" --which "7b-chat"
```

```
Input:
Who is the current president of the USA?

Output:
Currently, the 45th president of the United States is Joe Biden. He began his term on January 20, 2021, and will remain in office until January 20, 2025.
```

With --features metal `(GPU)` for `Llama2 7B-Chat: Q4_1` quant:

```bash
cargo run --example quantized --release --features metal -- --prompt "Who is the current president of the USA?" --which "7b-chat"
```

```
Input:
Who is the current president of the USA?

Output:
How can I learn more about the president of the United States?

Who has been the longest serving president in US history?
```

This is just one of many examples. Almost feels like a completion model instead of a chat model with metal on.

I am on an M3 max.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the quantized example with and without the `metal` feature on an M3 Max, using the commands and `7b-chat` model described in the issue. Compare the generated chat behavior and trace the relevant quantized-model or Metal execution path. Done means the Metal and CPU modes produce consistent chat-model responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.