开启inflight-batching, client侧需要使用inflight_batcher_llm_client.py:
python3 inflight_batcher_llm/client/inflight_batcher_llm_client.py --request-output-len 200 --tokenizer-dir ${HF_LLAMA_MODEL}
bad_words: output中不允许出现的词语;
stop_words: output生成到这些词,则停止;
build engine常用参数:
--gpt_attention_plugin float16
--gemm_plugin float16
--context_fmha enable
--kv_cache_type paged:Paged KV Cache?
Best Practices for Tuning the Performance of TensorRT-LLM — tensorrt_llm documentation
max_batch_size, max_seq_len and max_num_tokens
--multiple_profiles: 允许trtllm多次尝试,其自动选取性能最好的;
1. 默认打开:--gpt_attention_plugin:in-place update on KV cache;减少了显存占用,减少了显存copy;
2. 默认打开:--context_fmha:attention计算这里,是否采用fused kernel;短句子,用vanilla;长句子,用FlashAttention和FlashAttention2;

最低0.47元/天 解锁文章
1764

被折叠的 条评论
为什么被折叠?



