From 7d2bc40c42630bea26cc44f803814af96a4f42f2 Mon Sep 17 00:00:00 2001 From: OlivierDehaene <23298448+OlivierDehaene@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:11:24 +0100 Subject: [PATCH] update doc --- Dockerfile_amd | 2 +- docs/source/basic_tutorials/launcher.md | 28 ++++++++++++------- .../utils/gptq/exllamav2.py | 3 -- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Dockerfile_amd b/Dockerfile_amd index 377f114c..d2b6f897 100644 --- a/Dockerfile_amd +++ b/Dockerfile_amd @@ -76,7 +76,7 @@ RUN chmod +x ~/mambaforge.sh && \ rm ~/mambaforge.sh # Install PyTorch 2.2 RC compiled against RoCm 5.7, as VLLM can not be compiled with RoCm 5.6. -RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/test/rocm5.7/ +RUN pip install torch --index-url https://download.pytorch.org/whl/test/rocm5.7/ FROM base AS kernel-builder diff --git a/docs/source/basic_tutorials/launcher.md b/docs/source/basic_tutorials/launcher.md index bafe3669..fcaa688f 100644 --- a/docs/source/basic_tutorials/launcher.md +++ b/docs/source/basic_tutorials/launcher.md @@ -60,21 +60,13 @@ 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 -``` -## SPECULATE -```shell - --speculate - The number of input_ids to speculate on If using a medusa model, the heads will be picked up automatically Other wise, it will use n-gram speculation which is relatively free in terms of compute, but the speedup heavily depends on the task - - [env: SPECULATE=] - ``` ## DTYPE ```shell @@ -298,6 +290,22 @@ Options: [env: ROPE_FACTOR=] +``` +## SLIDING_WINDOW +```shell + --sliding-window + Sliding Window will only be used by flash attention optimized models Limit the Paged Attention context window size + + [env: SLIDING_WINDOW=] + +``` +## ATTENTION_SINKS +```shell + --attention-sinks + If `sliding_window` is set, always keep the first `attention_sinks` tokens in the context See: [Efficient Streaming Language Models with Attention Sinks](https://arxiv.org/abs/2309.17453) + + [env: ATTENTION_SINKS=] + ``` ## JSON_OUTPUT ```shell diff --git a/server/text_generation_server/utils/gptq/exllamav2.py b/server/text_generation_server/utils/gptq/exllamav2.py index a2b6e2b9..80836a95 100644 --- a/server/text_generation_server/utils/gptq/exllamav2.py +++ b/server/text_generation_server/utils/gptq/exllamav2.py @@ -2,7 +2,6 @@ import torch import torch.nn as nn -import math from loguru import logger @@ -21,7 +20,6 @@ def ext_gemm_half_q_half(x, q_handle, q4_width, force_cuda): output_shape = x.shape[:-1] + (q4_width,) x = x.view(-1, x.shape[-1]) output = torch.empty((x.shape[0], q4_width), dtype=torch.half, device=x.device) - logger.info("calling gemm_half_q_half") gemm_half_q_half(x, q_handle, output, force_cuda) return output.view(output_shape) @@ -191,7 +189,6 @@ class QuantLinear(nn.Module): self.q_handle = ext_make_q_matrix(self.q_tensors, temp_dq) def forward(self, x, force_cuda=False): - logger.info("calling ext_gemm_half_q_half") output = ext_gemm_half_q_half(x, self.q_handle, self.outfeatures, force_cuda) if self.bias is not None: