Open phazei opened 5 hours ago
I wanted to update, I tried it on llama.cpp like so:
docker run --rm --name llama-server --runtime nvidia --gpus all `
-v "D:\AIModels:/models" `
-p 8000:8000 `
ghcr.io/ggerganov/llama.cpp:server-cuda `
-m /models/MaziyarPanahi/Qwen2.5-7B-Instruct-abliterated-v2-GGUF/Qwen2.5-7B-nstruct-abliterated-v2.Q5_K_M.gguf `
--host 0.0.0.0 `
--port 8000 `
--n-gpu-layers 35 `
-cb `
--parallel 8 `
-c 32768 `
--cache-type-k q8_0 `
--cache-type-v q8_0 `
-fa
And it did run with KV Cache Q8_0 without noticeable degradation.
Seems that this is an issue specific to k-quants (might be i-matrix as well). I can generate reasonable outputs with standard quantization (Q8_0
) checkpoints:
$ python examples/offline_inference.py --model ../Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q8_0.gguf --kv-cache-dtype fp8 --max-tokens 128
/root/miniconda3/lib/python3.12/site-packages/vllm/connections.py:8: RuntimeWarning: Failed to read commit hash:
No module named 'vllm._version'
from vllm.version import __version__ as VLLM_VERSION
INFO 11-18 13:28:31 __init__.py:31] No plugins found.
INFO 11-18 13:28:31 __init__.py:31] No plugins found.
INFO 11-18 13:28:48 config.py:1861] Downcasting torch.float32 to torch.float16.
INFO 11-18 13:28:52 config.py:350] This model supports multiple tasks: {'embedding', 'generate'}. Defaulting to 'generate'.
WARNING 11-18 13:28:52 config.py:428] gguf quantization is not fully optimized yet. The speed can be slower than non-quantized models.
INFO 11-18 13:28:52 config.py:758] Using fp8 data type to store kv cache. It reduces the GPU memory footprint and boosts the performance. Meanwhile, it may cause accuracy drop without a proper scaling factor
WARNING 11-18 13:28:52 arg_utils.py:1065] [DEPRECATED] Block manager v1 has been removed, and setting --use-v2-block-manager to True or False has no effect on vLLM behavior. Please remove --use-v2-block-manager in your engine argument. If your use case is not supported by SelfAttnBlockSpaceManager (i.e. block manager v2), please file an issue with detailed information.
INFO 11-18 13:28:52 llm_engine.py:249] Initializing an LLM engine (vdev) with config: model='../Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q8_0.gguf', speculative_config=None, tokenizer='../Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q8_0.gguf', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, override_neuron_config=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=32768, download_dir=None, load_format=LoadFormat.GGUF, tensor_parallel_size=1, pipeline_parallel_size=1, disable_custom_all_reduce=False, quantization=gguf, enforce_eager=False, kv_cache_dtype=fp8, quantization_param_path=None, device_config=cuda, decoding_config=DecodingConfig(guided_decoding_backend='outlines'), observability_config=ObservabilityConfig(otlp_traces_endpoint=None, collect_model_forward_time=False, collect_model_execute_time=False), seed=0, served_model_name=../Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q8_0.gguf, num_scheduler_steps=1, chunked_prefill_enabled=False multi_step_stream_outputs=True, enable_prefix_caching=False, use_async_output_proc=True, use_cached_outputs=False, mm_processor_kwargs=None, pooler_config=None)
INFO 11-18 13:29:29 __init__.py:31] No plugins found.
INFO 11-18 13:29:29 selector.py:271] Cannot use FlashAttention-2 backend for FP8 KV cache.
WARNING 11-18 13:29:29 selector.py:273] Please use FlashInfer backend with FP8 KV Cache for better performance by setting environment variable VLLM_ATTENTION_BACKEND=FLASHINFER
INFO 11-18 13:29:29 selector.py:144] Using XFormers backend.
INFO 11-18 13:29:30 model_runner.py:1072] Starting to load model ../Qwen2.5-1.5B-Instruct-GGUF/qwen2.5-1.5b-instruct-q8_0.gguf...
/root/miniconda3/lib/python3.12/site-packages/torch/nested/__init__.py:226: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. (Triggered internally at ../aten/src/ATen/NestedTensorImpl.cpp:178.)
return _nested.nested_tensor(
INFO 11-18 13:29:45 model_runner.py:1077] Loading model weights took 1.7820 GB
INFO 11-18 13:29:50 worker.py:232] Memory profiling results: total_gpu_memory=23.65GiB initial_memory_usage=2.25GiB peak_torch_memory=4.25GiB memory_usage_post_profile=2.25GiB non_torch_memory=0.47GiB kv_cache_size=16.57GiB gpu_memory_utilization=0.90
INFO 11-18 13:29:51 gpu_executor.py:113] # GPU blocks: 77556, # CPU blocks: 18724
INFO 11-18 13:29:51 gpu_executor.py:117] Maximum concurrency for 32768 tokens per request: 37.87x
INFO 11-18 13:29:53 model_runner.py:1400] Capturing cudagraphs for decoding. This may lead to unexpected consequences if the model is not static. To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI.
INFO 11-18 13:29:53 model_runner.py:1404] If out-of-memory error occurs during cudagraph capture, consider decreasing `gpu_memory_utilization` or switching to eager mode. You can also reduce the `max_num_seqs` as needed to decrease memory usage.
INFO 11-18 13:30:04 model_runner.py:1518] Graph capturing finished in 10 secs, took 1.55 GiB
Processed prompts: 100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 4/4 [00:00<00:00, 4.56it/s, est. speed input: 25.10 toks/s, output: 584.14 toks/s]
Prompt: 'Hello, my name is', Generated text: " Josh and I'm here to help you understand what is actually going on with your kids. I'm a life coach and former public speaker, and I have a Masters in Psychology. I help parents, educators, and children make changes in their lives for the better, one step at a time. This site will help me to better serve you. I'll be happy to answer any questions or make a call or email you for you're interested. My contact information can be found on the home page. I am dedicated to helping you and your family. Thank you for checking out my site. Josh.\nCould you you use those words to describe"
Prompt: 'The president of the United States is', Generated text: ' the head of state and the head of government for the United States. The president serves as the commander-in-chief of the United States Armed Forces, has the power to appoint federal judges, and conducts foreign policy. The president also has the power to veto bills, and by using the power of the pardon, can issue pardons. The president is also the chief diplomat of the United States, can issue executive orders, has the power to grant reprieves, and has the power to commute sentences. In addition, the president can also offer a bill that proposes a constitutional amendment to Congress, and then the House of Representatives, and the Senate'
Prompt: 'The capital of France is', Generated text: ' Paris, located in the north of the country. The name Paris comes from the Latin form of the Greek name Paris, which means "piece of land" or "piece of land with Troy." The Romans brought the name when they conquered the region.\n\nThe original name of the city was Lutum, and the Romans renamed it after the legendary king of Troy, Paris, who stole Helen, the queen of Sparta, from her husband Menelaus. This name translates to "Troy\'s Place."\n\nIn the 1st century AD, the Romans renamed it to Lutum, which means "little Troy" or "T'
Prompt: 'The future of AI is', Generated text: ' an exciting one, and itβs currently been a rather challenging one for AI developers. With so being a new technology, developers are still working to finding ways to make their AI models more accurate and better. One of the biggest issues is that AI models are often overfitting to their training data, which an expensive and inefficient model. This is a major problem as it requires a large amount of data and computational resources to train, which are limited for many organizations.\nThis is where the standard approach to solve the overfitting problem, which is to train the model for more data, which an expensive and inefficient model. This is a major'
BTW, seems that Q6_K
can also generate reasonable results. Perhaps you need to use a higher-bits quantization to avoid quality degradation when using fp8
kv cache dtype.
Your current environment
The output of `python collect_env.py`
I attempted to run that, but it threw errors. I'm running this in docker on Windows 11Model Input Dumps
No response
π Describe the bug
I've tried both fp8_e5m2 and fp8_e4m3.
The model works perfectly without kv-cache quantization.
When I enable it, the model gets exceptionally bad. With e5m2 it just repeats a word over and over. With e4m3 it gets about half a sentence in, then also repeats over forever.
I can understand perhaps a some loss in precision, but not basically 100%. It's essentially non-functional with the FP8 kv-cache. Without the quantized cache the model is on the level of GPT-3.5.
I had read that there shouldn't be much difference between the two, so I though perhaps it wasn't working right because it's a GGUF or something to do with that.
Here are the init logs:
Before submitting a new issue...