-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] TurboMind support W8A8 or FP8 KV Cache #1463
Comments
Considering that FP8 has a significant advantage in precision compared to Int8, this means that we are more likely to use it in actual online serving compared to Int8. Refer to the following blog posts: Currently, we are inclined to conduct research on FP8 internally first, and then decide which feature to work on. Do you have any suggestions? |
FP8 KV cache will be a lot more easier. You will need to add some template specialization for type conversion and some code for dispatching the kernels. |
Exactly we plan to reference the implementation of kv cache online Int8. |
Hi all. After internal discussions, we plan to start the development work related to FP8 in May. Please stay tuned. Cheers. |
The following blogs and documents are not directly related to FP8 KV Cache, they are mainly related to FP8 Attention, but also bring us some inspiration. The format used by FriendliAI for implementing FP8 Attention is E4M3. And ColfaxResearch provided an implementation reference for type conversion. https://friendli.ai/blog/weight-activation-quantization-fp8/ |
From https://friendli.ai/blog/quantization-reduce-llm-size/, it can be seen that currently, in terms of speed, SmoothQuant > AWQ > GPTQ and in terms of accuracy, AWQ > GPTQ > SmoothQuant. Among them, AWQ has achieved a good balance and has been efficiently implemented in LMDeploy. GPTQ, as well as AWQ, is W4A16 without any advantages. Our team achieved W8A8 on vLLM in the second half of last year vllm-project/vllm#1508. Due to precision issues, it is difficult for SmoothQuant to be used realistically in online environments. From this perspective, trying FP8 KV Cache on L40 can make it easier to use for online serving. |
I evaluated the KV Cache INT8 in llama2 and llama3 models and get the following results:
Here is my evaluation steps: # start server
lmdeploy serve api_server /workdir/llm_models/Meta-Llama-3-8B --server-name 0.0.0.0 --server-port 23333 --tp 1 --quant-policy 8
# start opencompass evaluation
python run.py configs/eval_internlm_chat_lmdeploy_apiserver.py -w outputs @lvhan028 @lzhangzz Do you have any suggestions? cc: @zhyncs |
OpenCompass team said WiC and WSC can be neglected |
OK, got it. |
Due to the excellent performance improvement and negligible accuracy loss of the Online KV Cache Int8 currently implemented in LMDeploy, we are inclined not to proceed with FP8 KV Cache for now. The ROI is not very high for us. Is there any plan in the community to work on this? Looking forward to your reply. Thanks. @lvhan028 @lzhangzz |
We don't have plan to support FP8 KV cache, as the current INT8 implementation works just fine and it also works on pre We seek to improve the accuracy of current INT8/INT4 implementations by more advanced quantization methods. |
Motivation
We plan to add support for
W8A8
SmoothQuant orFP8 KV Cache
on TurboMind. There is currently no clear decision on which one to prioritize first. We would like to understand how the community judges the priority of these two options and if any advice can be provided. Thanks. @lvhan028 @lzhangzz @grimoire @irexyc cc @ispobockRelated resources
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: