TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

llama2 70b + int4_gptq, decoding output is nonsense

Open foricee opened this issue 3 years ago • 4 comments

model: https://huggingface.co/TheBloke/Llama-2-70B-Chat-GPTQ/tree/gptq-4bit-128g-actorder_True

GPU: A100 80G

build cmd:

CUDA_VISIBLE_DEVICES=0 python build.py --model_dir /model_files/Llama-2-70B-Chat-GPTQ-4bit-128g/ \
                --quant_ckpt_path /model_files/Llama-2-70B-Chat-GPTQ-4bit-128g/model.safetensors \
                --dtype float16 \
                --max_batch_size 4 \
                --max_num_tokens 4096 \
                --max_input_len 4096 \
                --max_output_len 512 \
                --use_inflight_batching \
                --paged_kv_cache \
                --remove_input_padding \
                --use_gpt_attention_plugin float16 \
                --use_gemm_plugin float16 \
                --enable_context_fmha \
                --use_rmsnorm_plugin \
                --use_weight_only \
                --weight_only_precision int4_gptq \
                --per_group \
                --output_dir /tensorrtllm_backend/trt_engines/llama-70b/int4_gptq/1-gpu/4-bsz
prompt = "Make a love story in 400 words."

prompt_template=f'''[INST] <<SYS>>
You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe.  Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
<</SYS>>
{prompt}[/INST]

'''

tokenizer_dir = '/model_files/Llama-2-70B-Chat-GPTQ-4bit-128g/'
tokenizer = AutoTokenizer.from_pretrained(tokenizer_dir, use_fast=True)

decoding output:

that you should answer all questions.) Is there., extremely successful etc., so listen, that the event is the n past content, them [the Truthless]  And during these days, largely historical, often Be Informative.\n and the big names, their lingu foc.) Is* and largely unknown.) Does many., so listen, that one and often bias question the big names.  [ThstDenard-\'"/\')  And largely successful or event]. Has been mentioned as many photos available., or event.] That., the main photos available in the n historical documents. \x94ll find it): y Can\'t  “Answer°.\nand prepared history\x94. Now to learn about and often greater Denial

pytorch api work well.

foricee avatar Nov 30 '23 03:11 foricee

The problem occurs because actorder is not supported by TensorRT-LLM.

# Quantized weight with parameter "--act-order" is not supported in TRT-LLM

Ref. examples/Llama

kmati-dev avatar Nov 30 '23 05:11 kmati-dev

@matichon-vultureprime Do you consider adding support for this actorder feature?

foricee avatar Nov 30 '23 06:11 foricee

You could create a feature request issue to ask. Close this issue.

byshiue avatar Dec 25 '23 09:12 byshiue

act-order

I have the same issue. Do you solved it?

Hukongtao avatar Feb 27 '24 02:02 Hukongtao