From bc95292eb86bdd71bcd5af1d29efc4961974d8c2 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Thu, 8 Feb 2024 09:22:19 +0000 Subject: [PATCH] Disable cuda graph with speculation (for now) and update the docs. --- docs/source/basic_tutorials/launcher.md | 23 ++++++++++--------- .../models/flash_causal_lm.py | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/source/basic_tutorials/launcher.md b/docs/source/basic_tutorials/launcher.md index ba54f058..ec4bdeb3 100644 --- a/docs/source/basic_tutorials/launcher.md +++ b/docs/source/basic_tutorials/launcher.md @@ -60,9 +60,9 @@ Options: [env: QUANTIZE=] Possible values: - - awq: 4 bit quantization. Requires a specific AWQ quantized model: https://hf.co/models?search=awq. Should replace GPTQ models wherever possible because of the better latency + - awq: 4 bit quantization. Requires a specific GTPQ quantized model: https://hf.co/models?search=awq. Should replace GPTQ models whereever possible because of the better latency - eetq: 8 bit quantization, doesn't require specific model. Should be a drop-in replacement to bitsandbytes with much better performance. Kernels are from https://github.com/NetEase-FuXi/EETQ.git - - gptq: 4 bit quantization. Requires a specific GTPQ quantized model: https://hf.co/models?search=gptq. text-generation-inference will use exllama (faster) kernels wherever possible, and use triton kernel (wider support) when it's not. AWQ has faster kernels + - gptq: 4 bit quantization. Requires a specific GTPQ quantized model: https://hf.co/models?search=gptq. text-generation-inference will use exllama (faster) kernels whereever possible, and use triton kernel (wider support) when it's not. AWQ has faster kernels - bitsandbytes: Bitsandbytes 8bit. Can be applied on any model, will cut the memory requirement in half, but it is known that the model will be much slower to run than the native f16 - bitsandbytes-nf4: Bitsandbytes 4bit. Can be applied on any model, will cut the memory requirement by 4x, but it is known that the model will be much slower to run than the native f16 - bitsandbytes-fp4: Bitsandbytes 4bit. nf4 should be preferred in most cases but maybe this one has better perplexity performance for you model @@ -198,14 +198,23 @@ Options: [default: 20] ``` + ## MAX_BATCH_SIZE ```shell --max-batch-size Enforce a maximum number of requests per batch Specific flag for hardware targets that do not support unpadded inference [env: MAX_BATCH_SIZE=] - ``` + +## ENABLE_CUDA_GRAPHS +```shell + --enable-cuda-graphs + Enable experimental support for cuda graphs + + [env: ENABLE_CUDA_GRAPHS=] +``` + ## HOSTNAME ```shell --hostname @@ -362,14 +371,6 @@ Options: [env: NGROK_EDGE=] -``` -## TOKENIZER_CONFIG_PATH -```shell - --tokenizer-config-path - The path to the tokenizer config file. This path is used to load the tokenizer configuration which may include a `chat_template`. If not provided, the default config will be used from the model hub - - [env: TOKENIZER_CONFIG_PATH=] - ``` ## ENV ```shell diff --git a/server/text_generation_server/models/flash_causal_lm.py b/server/text_generation_server/models/flash_causal_lm.py index 670ee1b5..c7fda516 100644 --- a/server/text_generation_server/models/flash_causal_lm.py +++ b/server/text_generation_server/models/flash_causal_lm.py @@ -869,7 +869,7 @@ class FlashCausalLM(Model): # Try to find an associated cuda graph cuda_graph = self.cuda_graphs.get(padded_bs, None) - if cu_seqlen_prefill is not None or cuda_graph is None: + if cu_seqlen_prefill is not None or cuda_graph is None or batch.speculative_ids is not None: return self.model.forward( input_ids=input_ids, position_ids=position_ids,