You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FYI, we are seeing some weird results as well. I've created an internal bug to track the issue in our system. One member of our team is going to investigate next week and we'll let you know as soon as we know more.
@callmezhangchenchenokay Sorry for late response. After investigation, we think it is not a bug. The model capacity of pure int4 weight only is not good enough.
A way to enhance the accuracy on int4 is AWQ. This feature is supported on LLaMa, but it is not supported on Baichuan now. We will add it soon. You can try using int8 weight only first.
@byshiue Since baichuan already prevides a pre-quantized Baichuan2-7B-Chat-4bits which is good to use with model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan2-7B-Chat-4bits", device_map="auto", trust_remote_code=True), can we leverage that in TensorRT-LLM?
@byshiue I used int8 weight-only and the results sometimes are good while sometimes are still </s>. Here's the result after deploying to triton, the difference here is only the question mark.
@jdemouth-nvidia I use release/0.5.0 for building, and use 23.10-trtllm-python-py3 NGC docker for serving.
# Build the Baichuan V2 7B model using a single GPU and FP16.
python build.py --model_version v2_7b \
--model_dir baichuan-inc/Baichuan2-7B-Chat \
--dtype float16 \
--use_gemm_plugin float16 \
--use_gpt_attention_plugin float16 \
--output_dir ./tmp/baichuan_v2_7b/trt_engines/fp16/1-gpu/
# Serving
# First: https://github.com/triton-inference-server/tensorrtllm_backend#modify-the-model-configuration
# Second: Launch the Triton container
docker run --rm -it --net host --shm-size=2g --ulimit memlock=-1 --ulimit stack=67108864 --gpus all -v /path/to/tensorrtllm_backend:/tensorrtllm_backend nvcr.io/nvidia/tritonserver:23.10-trtllm-python-py3 bash
cd /tensorrtllm_backend
# --world_size is the number of GPUs you want to use for serving
python3 scripts/launch_triton_server.py --model_repo=/tensorrtllm_backend/triton_model_repo
# Third: Send request
tensorrtllm_backend curl -X POST localhost:8000/v2/models/ensemble/generate -d '{"text_input": "你会做什么?", "max_tokens": 300, "bad_words": "", "stop_words": "</s>"}'
@callmezhangchenchenokay Sorry for late response. After investigation, we think it is not a bug. The model capacity of pure int4 weight only is not good enough.
A way to enhance the accuracy on int4 is AWQ. This feature is supported on LLaMa, but it is not supported on Baichuan now. We will add it soon. You can try using int8 weight only first.
@byshiue Has this been supported now yet? Since the int4 model acc drops rather much and its necessary under few memory-poor situation to run big size llms.
Activity
byshiue commentedon Oct 20, 2023
Can you provide more information and reproduced steps? For example, how do you convert weight, building engine and run the test script?
jdemouth-nvidia commentedon Oct 20, 2023
To be more specific, we will need the following:
build.py,run.py(or the Triton Server launch command).Thanks!
callmezhangchenchenokay commentedon Oct 20, 2023
build.py 和 run.py 都没有动
`python examples/baichuan/build.py --model_version v2_13b --model_dir ./models/Baichuan2-13B-Chat/ --dtype float16 --use_gemm_plugin float16 --use_gpt_attention_plugin float16 --use_weight_only --weight_only_precision int4 --output_dir ./models/tmp/baichuan_v2_13b/trt_engines/int4_weight_only/1-gpu/
python examples/baichuan/run.py --model_version v2_13b --max_output_len=1024 --tokenizer_dir=./models/Baichuan2-13B-Chat/ --engine_dir=./models/tmp/baichuan_v2_13b/trt_engines/int4_weight_only/1-gpu/`
jdemouth-nvidia commentedon Oct 20, 2023
Thanks a lot - we'll investigate and keep you posted.
jdemouth-nvidia commentedon Oct 20, 2023
FYI, we are seeing some weird results as well. I've created an internal bug to track the issue in our system. One member of our team is going to investigate next week and we'll let you know as soon as we know more.
callmezhangchenchenokay commentedon Oct 20, 2023
好哒! 幸苦
tiandiao123 commentedon Oct 20, 2023
better use English over here since other users around the world can understand it.
byshiue commentedon Oct 24, 2023
@callmezhangchenchenokay Sorry for late response. After investigation, we think it is not a bug. The model capacity of pure int4 weight only is not good enough.
A way to enhance the accuracy on int4 is AWQ. This feature is supported on LLaMa, but it is not supported on Baichuan now. We will add it soon. You can try using int8 weight only first.
callmezhangchenchenokay commentedon Oct 24, 2023
Okay! luckily bitter ^_^ !
npuichigo commentedon Oct 30, 2023
@byshiue Since baichuan already prevides a pre-quantized Baichuan2-7B-Chat-4bits which is good to use with
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan2-7B-Chat-4bits", device_map="auto", trust_remote_code=True), can we leverage that in TensorRT-LLM?npuichigo commentedon Oct 30, 2023
@byshiue I used int8 weight-only and the results sometimes are good while sometimes are still
</s>. Here's the result after deploying to triton, the difference here is only the question mark.byshiue commentedon Oct 30, 2023
</s>is end token, which is filled in the output_ids to initialize the buffer.npuichigo commentedon Oct 30, 2023
@byshiue Yes. But many cases stop so early and didn't match the output of huggingface.
For example, for int8 weight-only:
huggingface transformer
tensorrt llm:
jdemouth-nvidia commentedon Oct 30, 2023
Is that with the
mainbranch? If it is, please, give us the command lines to reproduce the issue and we will investigate.npuichigo commentedon Oct 30, 2023
@jdemouth-nvidia I use release/0.5.0 for building, and use 23.10-trtllm-python-py3 NGC docker for serving.
jdemouth-nvidia commentedon Oct 31, 2023
Can you try with the main branch please?
npuichigo commentedon Oct 31, 2023
@jdemouth-nvidia what's the version in NGC docker. maybe I need to build an own one?
77h2l commentedon Nov 14, 2023
@byshiue Has this been supported now yet? Since the int4 model acc drops rather much and its necessary under few memory-poor situation to run big size llms.
byshiue commentedon Nov 14, 2023
Not yet.