LlamaPromptLookupDecoding gives no performance improvement

Aberta
#2,110 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
ai, performance

Direção de pesquisa

Examine os bindings do llama-cpp-python para o parâmetro draft_model e a classe LlamaPromptLookupDecoding. Revise a implementação subjacente do llama.cpp de prompt lookup decoding para entender o ganho de desempenho esperado. Teste com diferentes estruturas de prompt e configurações de modelo para verificar se o recurso está ativo e medir a velocidade de geração de tokens.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I'm automating spelling correction. Currently I'm testing this on a Mistral 7B Instruction Q4_K_M model running in llama.cpp using python bindings, and it works fine. I submit text fragments up to ~2000 characters.

I bumped into the "draft_model" option that does "prompt lookup decoding" (a.k.a. token prediction). Because my output is very similar to my prompt text, I'd assume that activating this would bring me significant performance gain.

But I've been testing this out and I see no performance gain at all, comparing the inference with and without the 'draft_model' option activated. I've tried different values for 'num_pred_tokens', but that doesn't make any difference either.

Using llama.ccp 0.3.16. I'm running on CPU. My prompts consists of an instruction in English and then the text to be corrected in Dutch.

Maybe I'm doing something wrong? Or maybe I don't understand the purpose of this option?

Initialization:

    n_ctx = 4096
    
    llm = Llama(
        model_path=model_path,
        n_ctx=n_ctx,
        n_threads=8,
        temperature=0,
        chat_format=None,
        draft_model=LlamaPromptLookupDecoding(num_pred_tokens=3),
        logits_all=True,
    )

Inference:

    output = llm(
        prompt=prompt_text,
        max_tokens=2048,
        temperature=0,
        echo=True
    )
Linguagem predominante
Python
Estrelas
10.7k
Forks
1.5k
Merge médio
1h 40min
PRs com merge (30d)
5

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de abetlen/llama-cpp-python

Todas as issues de abetlen/llama-cpp-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.