Triton_server部署学习笔记

下载镜像

docker pill http://nvcr.io/nvidia/tritonserver:22.07-py3

docker run --gpus all -itd -p8000:8000 -p8001:8001 -p8002:8002 -v /home/ai-developer/server/docs/examples/model_repository/:/models nvcr.io/nvidia/tritonserver:22.07-py3

docker exec -it a5bc bash

tritonserver --model-repository=/models --strict-model-config=false



非必要config文件

支持的格式有TrnsorRT,TensorFLOW saved-model,ONNX models do not require config.pbtxt when --strict-model-config=false

config中,platfrom可填写Tensorrt_plan,onnxruntime_onnx,pytorch_libtorch

backend tensorrt,onnxruntime,pytorch

dims: [ 3,-1,-1 ] -1代表可变维度

--model-control-model explicit

git clone https://github.com/NVIDIA/DeepLearningExamples.git

cd data/squad/

下载数据集

sh squad_download.sh

模型映射文件地址

cd /models

下载演示模型的地址

https://catalog.ngc.nvidia.com/orgs/nvidia/models/bert_pyt_ckpt_large_qa_squad11_amp

#粘贴wget命令

wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/bert_pyt_ckpt_large_qa_squad11_amp/versions/19.09.0/zip -O bert_pyt_ckpt_large_qa_squad11_amp_19.09.0.zip

转换格式

python3 triton/export_model.py

--input-path triton/model.py

--input-type pyt

--output-path $/models/exported_model.onnx

--output-type onnx

--dataloader triton/dataloader.py

--ignore-unknown-parameters

--onnx-opset 13

${FLAG}

--config-file bert_configs/large.json

--checkpoint /models/bert_large_qa.pt

--precision fp16

--vocab-file /models/vocab.txt

--max-seq-length 34

--predict-file /opt/tritonserver/DeepLearningExamples/PyTorch/LanguageModeling/BERT/data/squad/v1.1/dev-v1.1.json

--batch-size 16

相关推荐
551只玄猫11 分钟前
【基于python的金融分析和风险管理 学习笔记】中阶篇 第6章 分析利率和汇率
笔记·python·学习·金融·学习笔记·汇率·利率
孤独的小丑15 分钟前
OpenClaw学习资源汇编
汇编·学习
ljt272496066122 分钟前
Flutter笔记--加水印
笔记·flutter
show21422 分钟前
Memos 开源笔记的使用
笔记
悠哉悠哉愿意24 分钟前
【单片机学习笔记】第十二届国赛经验复盘
笔记·单片机·嵌入式硬件·学习
zxm851326 分钟前
UV使用及UV与Anaconda的区别
大数据·学习·机器学习·uv
Shining059629 分钟前
AI 编译器系列(五)《拓展 Triton 深度学习编译器——DLCompiler》
人工智能·深度学习·学习·其他·架构·ai编译器·infinitensor
-许平安-30 分钟前
MCP项目笔记四(Transport)
开发语言·c++·笔记·ai·mcp
码农的小菜园31 分钟前
Java线程池学习笔记
java·笔记·学习
C羊驼32 分钟前
C语言学习笔记(十二):动态内存管理
c语言·开发语言·经验分享·笔记·青少年编程