TensorRT-LLM Best Practices

原文链接

开启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_sizemax_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; 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值