AUGMXNT/inference-benchmarks

4

stars

15

commits

Python

primary language

Dec 12, 2023

updated

README

We will use shisa-7b-v1 (Mistral 7B w/ extended tokenizer) to test inference performance.

Full spreadsheet: https://docs.google.com/spreadsheets/d/19YaxXkMJu7VweJihBMxQfMuz290Q3VxpqeG2DYCdRws/edit?usp=sharing

512 token prompt, 512 tokens generated

All tests run on a Ryzen 5950X workstation w/ an RTX 4090 and RTX 3090 w/ CUDA 12.3.1 ~ 2023-12-10

  • Python 3.11.5
  • HF Transfromers 4.35.2
  • vLLM 0.2.3
  • cTranslate2 3.23.0
  • llama.cpp fe680e3 (1620)
  • ExLlamaV2 0.0.10
SoftwareSettingsAvg Tok/sMax MemSpeed XMax mem %Notes
HF TransformersBaseline (FP32)1.4847677.01.0100.0
HF TransformersBF163.8846211.02.6397.0
HF TransformersBF163.8846211.02.6397.0
torch.no_grad()
HF TransformersBF163.8945495.02.6395.0
torch.inference_mode()
HF TransformersBF164.3247191.02.9399.0
torch.inference_mode()
use_flash_attention_2=True
HF TransformersBF16BetterTransformers doesn't support Mistral
torch.inference_mode()
use_flash_attention_2=True
Optimum BetterTransformer
HF TransformersBF164.346851.02.9198.0
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersBF162.0742623.01.489.0UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization
load_in_8bit=True
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersBF162.0645127.01.495.0UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization
load_in_8bit=True
bnb_8bit_compute_dtype=torch.bfloat16
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP162.1345511.01.4495.0https://github.com/TimDettmers/bitsandbytes/issues/490
load_in_8bit=True
bnb_4bit_compute_dtype=torch.float16
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP162.1145509.01.4395.0
load_in_8bit=True
bnb_4bit_compute_dtype=torch.float16
torch.compile()
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP163.5144101.02.3792.0
load_in_4bit=True
bnb_4bit_compute_dtype=torch.float16
torch.compile()
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
vLLMtensor_parallel_size=155.2819958.037.4442.0vLLM is fast even for batch=1 but you need to batch by SamplerSettings and also you can't batch w/ multiple seeds
vLLMtensor_parallel_size=268.3147843.046.27100.0A copy on each GPU
vLLMtensor_parallel_size=286.8147175.058.899.0
quantization='awq'
vLLMtensor_parallel_size=2NotImplementedError: Pipeline parallelism is not supported yet.
pipeline_parallel_size=2
quantization='awq'
cTranslate255.8616996.037.8436.0requires model conversion: https://opennmt.net/CTranslate2/conversion.html
Missing some of the usual generation parameters, 4090 only
llama.cppfp1640.9317987.027.7238.0convert_shisa.py
4090+3090
llama.cppfp1654.615873.036.9833.04090 only
llama.cppq848.9511541.033.1524.04090+3090
llama.cppq887.859919.059.4921.04090 only
llama.cppq4_k_m53.088271.035.9417.04.63 BPW
4090+3090
llama.cppq4_k_m126.676701.085.7814.04090 only
ExLLamaV2EXLV2 8 BPW92.9413688.062.9629.04090 only
ExLLamaV2EXLV2 4.63 BPW134.410856.091.0623.04090 only
ExLLamaV2GPTQ Q4 GS128 actorder131.5710938.089.1223.04090 only
MLC LLMq0f16
MLC LLMq8f16_1
MLC LLMq4f16_1mlc_chat_cli: symbol lookup error: ... mlc-llm/dist/shisa-7b-v1-q4f16_1/shisa-7b-v1-q4f16_1-cuda.so: undefined symbol: __cudaRegisterFatBinary
MLC LLMautogptq_llama_q4f16_1
gpt-fastmany issues...

Contributors

lhl

15 commits

AUGMXNT/inference-benchmarks

4

stars

15

commits

Python

primary language

Dec 12, 2023

updated

README

We will use shisa-7b-v1 (Mistral 7B w/ extended tokenizer) to test inference performance.

Full spreadsheet: https://docs.google.com/spreadsheets/d/19YaxXkMJu7VweJihBMxQfMuz290Q3VxpqeG2DYCdRws/edit?usp=sharing

512 token prompt, 512 tokens generated

All tests run on a Ryzen 5950X workstation w/ an RTX 4090 and RTX 3090 w/ CUDA 12.3.1 ~ 2023-12-10

  • Python 3.11.5
  • HF Transfromers 4.35.2
  • vLLM 0.2.3
  • cTranslate2 3.23.0
  • llama.cpp fe680e3 (1620)
  • ExLlamaV2 0.0.10
SoftwareSettingsAvg Tok/sMax MemSpeed XMax mem %Notes
HF TransformersBaseline (FP32)1.4847677.01.0100.0
HF TransformersBF163.8846211.02.6397.0
HF TransformersBF163.8846211.02.6397.0
torch.no_grad()
HF TransformersBF163.8945495.02.6395.0
torch.inference_mode()
HF TransformersBF164.3247191.02.9399.0
torch.inference_mode()
use_flash_attention_2=True
HF TransformersBF16BetterTransformers doesn't support Mistral
torch.inference_mode()
use_flash_attention_2=True
Optimum BetterTransformer
HF TransformersBF164.346851.02.9198.0
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersBF162.0742623.01.489.0UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization
load_in_8bit=True
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersBF162.0645127.01.495.0UserWarning: MatMul8bitLt: inputs will be cast from torch.bfloat16 to float16 during quantization
load_in_8bit=True
bnb_8bit_compute_dtype=torch.bfloat16
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP162.1345511.01.4495.0https://github.com/TimDettmers/bitsandbytes/issues/490
load_in_8bit=True
bnb_4bit_compute_dtype=torch.float16
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP162.1145509.01.4395.0
load_in_8bit=True
bnb_4bit_compute_dtype=torch.float16
torch.compile()
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
HF TransformersFP163.5144101.02.3792.0
load_in_4bit=True
bnb_4bit_compute_dtype=torch.float16
torch.compile()
torch.inference_mode()
use_flash_attention_2=True
SDPA flash attention
vLLMtensor_parallel_size=155.2819958.037.4442.0vLLM is fast even for batch=1 but you need to batch by SamplerSettings and also you can't batch w/ multiple seeds
vLLMtensor_parallel_size=268.3147843.046.27100.0A copy on each GPU
vLLMtensor_parallel_size=286.8147175.058.899.0
quantization='awq'
vLLMtensor_parallel_size=2NotImplementedError: Pipeline parallelism is not supported yet.
pipeline_parallel_size=2
quantization='awq'
cTranslate255.8616996.037.8436.0requires model conversion: https://opennmt.net/CTranslate2/conversion.html
Missing some of the usual generation parameters, 4090 only
llama.cppfp1640.9317987.027.7238.0convert_shisa.py
4090+3090
llama.cppfp1654.615873.036.9833.04090 only
llama.cppq848.9511541.033.1524.04090+3090
llama.cppq887.859919.059.4921.04090 only
llama.cppq4_k_m53.088271.035.9417.04.63 BPW
4090+3090
llama.cppq4_k_m126.676701.085.7814.04090 only
ExLLamaV2EXLV2 8 BPW92.9413688.062.9629.04090 only
ExLLamaV2EXLV2 4.63 BPW134.410856.091.0623.04090 only
ExLLamaV2GPTQ Q4 GS128 actorder131.5710938.089.1223.04090 only
MLC LLMq0f16
MLC LLMq8f16_1
MLC LLMq4f16_1mlc_chat_cli: symbol lookup error: ... mlc-llm/dist/shisa-7b-v1-q4f16_1/shisa-7b-v1-q4f16_1-cuda.so: undefined symbol: __cudaRegisterFatBinary
MLC LLMautogptq_llama_q4f16_1
gpt-fastmany issues...

Contributors

lhl

15 commits

Languages

Python

95.0%

Shell

5.0%