# Inferences optimizations ## The three most important tuning knobs If you already have a model deployed and want to optimize performance without changing its architecture or precision, prioritize: |Tuning knob|Primary metrics| |---|---| |Maximum concurrent sequences|Throughput, TPOT, queue time| |Prefill chunk size / token budget|TTFT, TPOT, ITL| |KV cache capacity|KV cache utilization, preemptions| Exact parameter names and defaults depend on the engine version and backend. Official tuning guides: [vLLM](https://docs.vllm.ai/en/stable/configuration/optimization/?utm_source=chatgpt.com)⁠, [SGLang](https://github.com/sgl-project/sglang/blob/main/docs/docs/advanced_features/hyperparameter_tuning.mdx?utm_source=chatgpt.com)⁠, [TensorRT-LLM](https://nvidia.github.io/TensorRT-LLM/commands/trtllm-serve/run-benchmark-with-trtllm-serve.html?utm_source=chatgpt.com)⁠. Across vLLM, SGLang and TensorRT-LLM, the fundamental tuning concepts are largely the same: ## Core parameters to tune |Concept|vLLM|SGLang|TensorRT-LLM| |---|---|---|---| |Maximum concurrent sequences|max-num-seqs|max-running-requests|max_batch_size| |Token budget per iteration / prefill chunking|max-num-batched-tokens|chunked-prefill-size, max-prefill-tokens|max_num_tokens| |KV cache capacity|gpu-memory-utilization, explicit KV cache sizing|mem-fraction-static|kv_cache_config.free_gpu_memory_fraction| |Maximum sequence length|max-model-len|context-length|max_seq_len| |CUDA graph coverage|cuda-graph-sizes|CUDA graph batch sizes|cuda_graph_config| The parameters are conceptually related but not always semantically identical, especially regarding token budgets and memory allocation. ## Explicit optimization decisions These generally require workload-specific tuning and processing rather than simply adjusting a default parameter. - Quantization: weights and KV cache precision. - Parallelism: Tensor Parallelism, Data Parallelism, Expert Parallelism. - Speculative decoding: draft model, prediction depth and verification strategy. - Disaggregated serving: prefill/decode resource allocation. - Kernel backend selection: hardware- and architecture-specific alternatives.