{"id":85083,"date":"2026-07-27T00:16:50","date_gmt":"2026-07-26T16:16:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/85083.html"},"modified":"2026-07-27T00:16:50","modified_gmt":"2026-07-26T16:16:50","slug":"llama-3-2v-11b-cot%e9%83%a8%e7%bd%b2%e6%95%99%e7%a8%8b%ef%bc%9anvidia-triton%e6%8e%a8%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%b0%81%e8%a3%85%e4%b8%8e%e6%80%a7%e8%83%bd%e5%8e%8b%e6%b5%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/85083.html","title":{"rendered":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b"},"content":{"rendered":"<h2>Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b&#xff1a;NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b<\/h2>\n<p>\u60f3\u8bd5\u8bd5\u90a3\u4e2a\u80fd\u770b\u61c2\u56fe\u7247&#xff0c;\u8fd8\u80fd\u50cf\u4eba\u4e00\u6837\u4e00\u6b65\u6b65\u63a8\u7406\u7684AI\u6a21\u578b\u5417&#xff1f;Llama-3.2V-11B-cot\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e0d\u4ec5\u80fd\u7406\u89e3\u56fe\u7247\u5185\u5bb9&#xff0c;\u8fd8\u80fd\u628a\u601d\u8003\u8fc7\u7a0b\u62c6\u89e3\u6210\u201c\u603b\u7ed3\u2192\u63cf\u8ff0\u2192\u63a8\u7406\u2192\u7ed3\u8bba\u201d\u56db\u4e2a\u6b65\u9aa4&#xff0c;\u8ba9AI\u7684\u201c\u8111\u56de\u8def\u201d\u6e05\u6670\u53ef\u89c1\u3002<\/p>\n<p>\u4e0d\u8fc7&#xff0c;\u76f4\u63a5\u8fd0\u884cPython\u811a\u672c\u867d\u7136\u7b80\u5355&#xff0c;\u4f46\u60f3\u5728\u751f\u4ea7\u73af\u5883\u91cc\u7a33\u5b9a\u3001\u9ad8\u6548\u5730\u7528\u5b83&#xff0c;\u5c31\u5f97\u6362\u4e2a\u601d\u8def\u4e86\u3002\u4eca\u5929&#xff0c;\u6211\u5c31\u5e26\u4f60\u8d70\u4e00\u904d\u5de5\u4e1a\u7ea7\u7684\u90e8\u7f72\u6d41\u7a0b&#xff1a;\u628aLlama-3.2V-11B-cot\u5c01\u88c5\u8fdbNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668&#xff0c;\u518d\u7ed9\u5b83\u505a\u4e00\u6b21\u5168\u9762\u7684\u6027\u80fd\u201c\u4f53\u68c0\u201d\u3002\u65e0\u8bba\u4f60\u662f\u60f3\u642d\u5efa\u4e00\u4e2a\u9ad8\u53ef\u7528\u7684AI\u670d\u52a1&#xff0c;\u8fd8\u662f\u5355\u7eaf\u597d\u5947\u8fd9\u4e2a\u6a21\u578b\u7684\u6781\u9650\u5728\u54ea\u91cc&#xff0c;\u8fd9\u7bc7\u6559\u7a0b\u90fd\u80fd\u7ed9\u4f60\u7b54\u6848\u3002<\/p>\n<h3>1. \u4e3a\u4ec0\u4e48\u9009\u62e9Triton\u63a8\u7406\u670d\u52a1\u5668&#xff1f;<\/h3>\n<p>\u5728\u804a\u5177\u4f53\u64cd\u4f5c\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u641e\u6e05\u695a\u4e00\u4e2a\u95ee\u9898&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u7528\u7b80\u5355\u7684python app.py&#xff0c;\u800c\u8981\u6298\u817eTriton&#xff1f;<\/p>\n<p>\u60f3\u8c61\u4e00\u4e0b&#xff0c;\u4f60\u5f00\u53d1\u4e86\u4e00\u4e2a\u5f88\u68d2\u7684\u56fe\u7247\u5206\u6790\u5e94\u7528\u3002\u4e00\u5f00\u59cb\u7528\u6237\u4e0d\u591a&#xff0c;\u4e00\u4e2aPython\u8fdb\u7a0b\u8fd8\u80fd\u5e94\u4ed8\u3002\u4f46\u968f\u7740\u7528\u6237\u91cf\u66b4\u6da8&#xff0c;\u95ee\u9898\u5c31\u6765\u4e86&#xff1a;\u8bf7\u6c42\u6392\u961f\u3001\u54cd\u5e94\u53d8\u6162\u3001\u5185\u5b58\u6ea2\u51fa&#xff0c;\u751a\u81f3\u6574\u4e2a\u670d\u52a1\u6302\u6389\u3002\u8fd9\u65f6\u5019&#xff0c;\u4f60\u5c31\u9700\u8981\u4e00\u4e2a\u66f4\u4e13\u4e1a\u7684\u201c\u670d\u52a1\u5458\u201d\u3002<\/p>\n<p>NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c31\u662f\u8fd9\u4e2a\u4e13\u4e1a\u7684\u201c\u670d\u52a1\u5458\u201d\u3002\u5b83\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e&#xff1a;<\/p>\n<ul>\n<li>\u9ad8\u5e76\u53d1\u4e0e\u9ad8\u6027\u80fd&#xff1a;\u5b83\u80fd\u540c\u65f6\u5904\u7406\u6210\u767e\u4e0a\u5343\u4e2a\u8bf7\u6c42&#xff0c;\u81ea\u52a8\u628a\u4efb\u52a1\u5206\u914d\u7ed9\u591a\u4e2aGPU&#xff0c;\u628a\u786c\u4ef6\u6027\u80fd\u69a8\u5e72\u3002<\/li>\n<li>\u6a21\u578b\u7248\u672c\u7ba1\u7406&#xff1a;\u4f60\u53ef\u4ee5\u540c\u65f6\u90e8\u7f72\u6a21\u578b\u7684\u591a\u4e2a\u7248\u672c&#xff08;\u6bd4\u5982v1.0\u548cv1.1&#xff09;&#xff0c;\u8f7b\u677e\u8fdb\u884cA\/B\u6d4b\u8bd5\u6216\u7070\u5ea6\u53d1\u5e03&#xff0c;\u5ba2\u6237\u7aef\u53ef\u4ee5\u6307\u5b9a\u4f7f\u7528\u54ea\u4e2a\u7248\u672c\u3002<\/li>\n<li>\u6807\u51c6\u5316\u63a5\u53e3&#xff1a;\u5b83\u63d0\u4f9b\u7edf\u4e00\u7684HTTP\/gRPC\u63a5\u53e3\u3002\u65e0\u8bba\u540e\u7aef\u662fPyTorch\u3001TensorFlow\u8fd8\u662fONNX\u6a21\u578b&#xff0c;\u5ba2\u6237\u7aef\u90fd\u7528\u540c\u4e00\u79cd\u65b9\u5f0f\u8c03\u7528&#xff0c;\u5927\u5927\u964d\u4f4e\u4e86\u96c6\u6210\u590d\u6742\u5ea6\u3002<\/li>\n<li>\u751f\u4ea7\u7ea7\u7279\u6027&#xff1a;\u652f\u6301\u52a8\u6001\u6279\u5904\u7406&#xff08;\u628a\u591a\u4e2a\u5c0f\u8bf7\u6c42\u5408\u5e76\u6210\u4e00\u4e2a\u5927\u6279\u6b21\u5904\u7406&#xff0c;\u63d0\u5347\u6548\u7387&#xff09;\u3001\u6a21\u578b\u9884\u70ed\u3001\u5065\u5eb7\u68c0\u67e5\u3001\u6027\u80fd\u76d1\u63a7\u7b49&#xff0c;\u8fd9\u4e9b\u90fd\u662f\u751f\u4ea7\u73af\u5883\u4e0d\u53ef\u6216\u7f3a\u7684\u3002<\/li>\n<\/ul>\n<p>\u7b80\u5355\u8bf4&#xff0c;python app.py\u9002\u5408\u5f00\u53d1\u548c\u5feb\u901f\u9a8c\u8bc1&#xff0c;\u800cTriton\u662f\u4e3a7&#215;24\u5c0f\u65f6\u7a33\u5b9a\u8fd0\u884c\u3001\u670d\u52a1\u5927\u91cf\u7528\u6237\u800c\u751f\u7684\u3002\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u5c31\u4e00\u6b65\u6b65\u628a\u5b83\u201c\u8bf7\u201d\u8fdb\u6765\u3002<\/p>\n<h3>2. \u73af\u5883\u51c6\u5907\u4e0e\u6a21\u578b\u8f6c\u6362<\/h3>\n<p>\u5de5\u6b32\u5584\u5176\u4e8b&#xff0c;\u5fc5\u5148\u5229\u5176\u5668\u3002\u90e8\u7f72\u7684\u7b2c\u4e00\u6b65\u662f\u51c6\u5907\u597d\u6218\u573a\u3002<\/p>\n<h4>2.1 \u57fa\u7840\u73af\u5883\u68c0\u67e5<\/h4>\n<p>\u786e\u4fdd\u4f60\u7684\u673a\u5668\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6&#xff0c;\u8fd9\u662f\u540e\u7eed\u6240\u6709\u6b65\u9aa4\u7684\u57fa\u7840&#xff1a;<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7edf: Ubuntu 20.04\u621622.04&#xff08;\u5176\u4ed6Linux\u53d1\u884c\u7248\u53ef\u80fd\u9700\u8c03\u6574\u90e8\u5206\u547d\u4ee4&#xff09;\u3002<\/li>\n<li>GPU: \u81f3\u5c11\u4e00\u5f20NVIDIA GPU&#xff08;\u5982V100, A100, RTX 3090\u7b49&#xff09;&#xff0c;\u663e\u5b58\u5efa\u8bae16GB\u4ee5\u4e0a\u3002Llama-3.2V-11B-cot\u6a21\u578b\u672c\u8eab\u4e0d\u5c0f&#xff0c;\u52a0\u4e0aTriton\u548c\u6279\u5904\u7406\u5f00\u9500&#xff0c;\u663e\u5b58\u591a\u591a\u76ca\u5584\u3002<\/li>\n<li>\u9a71\u52a8\u4e0eCUDA: \u5b89\u88c5\u6700\u65b0\u7684NVIDIA\u9a71\u52a8\u548cCUDA Toolkit&#xff08;&gt;&#061;11.8&#xff09;\u3002\u53ef\u4ee5\u901a\u8fc7nvidia-smi\u547d\u4ee4\u6765\u9a8c\u8bc1\u3002<\/li>\n<li>Docker: Triton\u6700\u65b9\u4fbf\u7684\u90e8\u7f72\u65b9\u5f0f\u662f\u901a\u8fc7Docker\u3002\u786e\u4fdd\u5df2\u5b89\u88c5Docker\u548cNVIDIA Container Toolkit&#xff08;\u8ba9Docker\u5bb9\u5668\u80fd\u4f7f\u7528GPU&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2.2 \u83b7\u53d6\u6a21\u578b\u6587\u4ef6<\/h4>\n<p>\u9996\u5148&#xff0c;\u4f60\u9700\u8981\u62e5\u6709\u539f\u59cb\u7684Llama-3.2V-11B-cot\u6a21\u578b\u3002\u5b83\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u5173\u952e\u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>pytorch_model.bin \u6216 model.safetensors: \u6a21\u578b\u6743\u91cd\u6587\u4ef6\u3002<\/li>\n<li>config.json: \u6a21\u578b\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5b9a\u4e49\u4e86\u7f51\u7edc\u7ed3\u6784\u3001\u53c2\u6570\u7b49\u3002<\/li>\n<li>tokenizer.json \u6216\u76f8\u5173\u6587\u4ef6: \u5206\u8bcd\u5668\u6587\u4ef6&#xff0c;\u7528\u4e8e\u6587\u672c\u5904\u7406\u3002<\/li>\n<li>vision_tower\u76f8\u5173\u6587\u4ef6: \u89c6\u89c9\u7f16\u7801\u5668\u90e8\u5206\u3002<\/li>\n<\/ul>\n<p>\u5047\u8bbe\u4f60\u7684\u6a21\u578b\u6587\u4ef6\u5b58\u653e\u5728 \/home\/user\/llama-3.2v-11b-cot\/ \u76ee\u5f55\u4e0b\u3002\u6211\u4eec\u7684\u76ee\u6807\u662f\u5c06\u8fd9\u4e00\u5957\u6587\u4ef6&#xff0c;\u8f6c\u6362\u6210Triton\u80fd\u591f\u8bc6\u522b\u548c\u670d\u52a1\u7684\u683c\u5f0f\u3002<\/p>\n<h4>2.3 \u8f6c\u6362\u4e3aONNX\u683c\u5f0f&#xff08;\u53ef\u9009\u4f46\u63a8\u8350&#xff09;<\/h4>\n<p>Triton\u539f\u751f\u652f\u6301\u591a\u79cd\u540e\u7aef&#xff0c;\u5982PyTorch\u3001TensorRT\u548cONNX\u3002\u5176\u4e2d&#xff0c;ONNX\u683c\u5f0f\u5177\u6709\u5f88\u597d\u7684\u901a\u7528\u6027\u548c\u4f18\u5316\u6f5c\u529b\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528optimum\u548connxruntime\u5e93\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u5b89\u88c5\u5fc5\u8981\u7684\u5e93&#xff1a;<\/p>\n<p>pip install optimum[exporters] onnxruntime-gpu<\/p>\n<p>\u7136\u540e&#xff0c;\u7f16\u5199\u4e00\u4e2a\u8f6c\u6362\u811a\u672c export_to_onnx.py&#xff1a;<\/p>\n<p>from optimum.onnxruntime import ORTModelForVision2Seq<br \/>\nfrom transformers import AutoProcessor<\/p>\n<p># \u5b9a\u4e49\u6a21\u578b\u8def\u5f84<br \/>\nmodel_id &#061; &#034;\/home\/user\/llama-3.2v-11b-cot&#034;<br \/>\nonnx_path &#061; &#034;.\/llama-3.2v-11b-cot-onnx&#034;<\/p>\n<p># \u5bfc\u51fa\u4e3aONNX\u683c\u5f0f<br \/>\nmodel &#061; ORTModelForVision2Seq.from_pretrained(model_id, export&#061;True)<br \/>\nprocessor &#061; AutoProcessor.from_pretrained(model_id)<\/p>\n<p># \u4fdd\u5b58ONNX\u6a21\u578b\u548c\u5904\u7406\u5668<br \/>\nmodel.save_pretrained(onnx_path)<br \/>\nprocessor.save_pretrained(onnx_path)<br \/>\nprint(f&#034;\u6a21\u578b\u5df2\u6210\u529f\u5bfc\u51fa\u81f3: {onnx_path}&#034;)<\/p>\n<p>\u8fd0\u884c\u8fd9\u4e2a\u811a\u672c&#xff0c;\u4f60\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u5f97\u5230 llama-3.2v-11b-cot-onnx \u6587\u4ef6\u5939&#xff0c;\u91cc\u9762\u5305\u542b\u4e86ONNX\u683c\u5f0f\u7684\u6a21\u578b\u6587\u4ef6\u3002\u8fd9\u4e00\u6b65\u5c06\u6a21\u578b\u7684\u8ba1\u7b97\u56fe\u56fa\u5b9a\u4e0b\u6765&#xff0c;\u6709\u5229\u4e8e\u540e\u7eed\u7684\u56fe\u4f18\u5316\u548c\u52a0\u901f\u3002<\/p>\n<h3>3. \u6784\u5efaTriton\u6a21\u578b\u4ed3\u5e93<\/h3>\n<p>Triton\u901a\u8fc7\u4e00\u4e2a\u6e05\u6670\u7684\u76ee\u5f55\u7ed3\u6784\u6765\u7ba1\u7406\u6a21\u578b&#xff0c;\u8fd9\u4e2a\u7ed3\u6784\u53eb\u505a\u201c\u6a21\u578b\u4ed3\u5e93\u201d\u3002\u6211\u4eec\u6765\u4e3aLlama-3.2V-11B-cot\u521b\u5efa\u5b83\u7684\u201c\u5bb6\u201d\u3002<\/p>\n<h4>3.1 \u521b\u5efa\u4ed3\u5e93\u7ed3\u6784<\/h4>\n<p>\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55&#xff0c;\u4f8b\u5982 triton_model_repository&#xff0c;\u5e76\u5728\u5176\u4e2d\u4e3a\u6211\u4eec\u7684\u6a21\u578b\u5efa\u7acb\u5b50\u76ee\u5f55&#xff1a;<\/p>\n<p>mkdir -p triton_model_repository\/llama_3_2v_11b_cot\/1<\/p>\n<p>\u8fd9\u91cc\u7684\u7ed3\u6784\u542b\u4e49\u662f&#xff1a;<\/p>\n<ul>\n<li>triton_model_repository: \u6a21\u578b\u4ed3\u5e93\u6839\u76ee\u5f55\u3002<\/li>\n<li>llama_3_2v_11b_cot: \u6a21\u578b\u540d\u79f0\u3002Triton\u901a\u8fc7\u8fd9\u4e2a\u540d\u79f0\u6765\u8bbf\u95ee\u6a21\u578b\u3002<\/li>\n<li>1: \u6a21\u578b\u7248\u672c\u53f7\u3002Triton\u652f\u6301\u591a\u7248\u672c&#xff0c;\u6570\u5b57\u8d8a\u5927\u901a\u5e38\u4ee3\u8868\u7248\u672c\u8d8a\u65b0\u3002\u4f60\u53ef\u4ee5\u5728\u8fd9\u91cc\u653e\u7f6e\u7248\u672c1\u7684\u6a21\u578b\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h4>3.2 \u51c6\u5907\u6a21\u578b\u6587\u4ef6\u4e0e\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p>\u73b0\u5728&#xff0c;\u5c06\u8f6c\u6362\u597d\u7684ONNX\u6a21\u578b\u6587\u4ef6&#xff08;\u6216\u539f\u59cbPyTorch\u6a21\u578b\u6587\u4ef6&#xff09;\u590d\u5236\u5230\u7248\u672c\u76ee\u5f55 1 \u4e2d&#xff1a;<\/p>\n<p># \u5982\u679c\u4f60\u4f7f\u7528ONNX\u683c\u5f0f<br \/>\ncp -r .\/llama-3.2v-11b-cot-onnx\/* triton_model_repository\/llama_3_2v_11b_cot\/1\/<\/p>\n<p># \u5982\u679c\u4f60\u76f4\u63a5\u4f7f\u7528\u539f\u59cbPyTorch\u683c\u5f0f&#xff0c;\u786e\u4fdd\u81f3\u5c11\u5305\u542bpytorch_model.bin\u548cconfig.json<br \/>\n# cp \/home\/user\/llama-3.2v-11b-cot\/* triton_model_repository\/llama_3_2v_11b_cot\/1\/<\/p>\n<p>\u63a5\u4e0b\u6765&#xff0c;\u521b\u5efaTriton\u6a21\u578b\u7684\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6 config.pbtxt&#xff0c;\u653e\u5728 llama_3_2v_11b_cot \u76ee\u5f55\u4e0b&#xff08;\u6ce8\u610f&#xff1a;\u4e0d\u662f\u7248\u672c\u76ee\u5f551\u91cc\u9762&#xff09;\u3002<\/p>\n<p>name: &#034;llama_3_2v_11b_cot&#034;<br \/>\nplatform: &#034;onnxruntime_onnx&#034; # \u5982\u679c\u4f7f\u7528ONNX\u683c\u5f0f\u3002\u82e5\u7528PyTorch&#xff0c;\u5219\u6539\u4e3a &#034;pytorch_libtorch&#034;<br \/>\nmax_batch_size: 4 # \u6700\u5927\u6279\u5904\u7406\u5927\u5c0f&#xff0c;\u6839\u636e\u4f60\u7684GPU\u663e\u5b58\u8c03\u6574\u3002\u5982\u679c\u6a21\u578b\u4e0d\u652f\u6301\u6279\u5904\u7406&#xff0c;\u8bbe\u4e3a0\u3002<\/p>\n<p>input [<br \/>\n  {<br \/>\n    name: &#034;pixel_values&#034;<br \/>\n    data_type: TYPE_FP32<br \/>\n    dims: [3, 336, 336] # \u8f93\u5165\u56fe\u7247\u7684\u5c3a\u5bf8 [\u901a\u9053, \u9ad8, \u5bbd]<br \/>\n  },<br \/>\n  {<br \/>\n    name: &#034;input_ids&#034;<br \/>\n    data_type: TYPE_INT64<br \/>\n    dims: [-1] # -1 \u8868\u793a\u53ef\u53d8\u957f\u5ea6\u7ef4\u5ea6<br \/>\n  },<br \/>\n  {<br \/>\n    name: &#034;attention_mask&#034;<br \/>\n    data_type: TYPE_INT64<br \/>\n    dims: [-1]<br \/>\n  }<br \/>\n]<\/p>\n<p>output [<br \/>\n  {<br \/>\n    name: &#034;output_0&#034; # ONNX\u5bfc\u51fa\u65f6\u7684\u8f93\u51fa\u540d\u79f0&#xff0c;\u53ef\u80fd\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u6574<br \/>\n    data_type: TYPE_FP32<br \/>\n    dims: [-1, -1] # \u8f93\u51falogits\u7684\u7ef4\u5ea6 [\u6279\u6b21, \u5e8f\u5217\u957f\u5ea6, \u8bcd\u8868\u5927\u5c0f]&#xff0c;\u540e\u4e24\u7ef4\u53ef\u53d8<br \/>\n  }<br \/>\n]<\/p>\n<p>instance_group [<br \/>\n  {<br \/>\n    count: 1 # \u6bcf\u4e2aGPU\u4e0a\u8fd0\u884c\u51e0\u4e2a\u6a21\u578b\u5b9e\u4f8b<br \/>\n    kind: KIND_GPU<br \/>\n    gpus: [0] # \u4f7f\u7528\u54ea\u51e0\u5f20GPU&#xff0c;\u4f8b\u5982[0,1]\u8868\u793a\u4f7f\u7528GPU0\u548cGPU1<br \/>\n  }<br \/>\n]<\/p>\n<p>dynamic_batching {<br \/>\n  preferred_batch_size: [1, 2, 4]<br \/>\n  max_queue_delay_microseconds: 500000 # \u8bf7\u6c42\u5728\u961f\u5217\u4e2d\u7b49\u5f85\u6279\u5904\u7406\u7684\u6700\u5927\u65f6\u95f4&#xff08;\u5fae\u79d2&#xff09;<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u6587\u4ef6\u544a\u8bc9Triton&#xff1a;<\/p>\n<ul>\n<li>\u6a21\u578b\u53eb\u4ec0\u4e48\u540d\u5b57&#xff0c;\u7528\u4ec0\u4e48\u540e\u7aef\u5f15\u64ce\u3002<\/li>\n<li>\u8f93\u5165\u8f93\u51fa\u662f\u4ec0\u4e48&#xff1a;\u89c6\u89c9\u6a21\u578b\u9700\u8981\u56fe\u50cf\u50cf\u7d20\u503cpixel_values\u548c\u6587\u672c\u7684input_ids\u3001attention_mask\u3002<\/li>\n<li>\u5982\u4f55\u90e8\u7f72&#xff1a;\u5728GPU 0\u4e0a\u542f\u52a81\u4e2a\u5b9e\u4f8b\u3002<\/li>\n<li>\u5982\u4f55\u4f18\u5316&#xff1a;\u542f\u7528\u52a8\u6001\u6279\u5904\u7406&#xff0c;\u5c1d\u8bd5\u5c061\u30012\u62164\u4e2a\u8bf7\u6c42\u5408\u5e76\u5904\u7406&#xff0c;\u6700\u591a\u7b49\u5f85500\u6beb\u79d2\u6765\u51d1\u6279\u3002<\/li>\n<\/ul>\n<h4>3.3 \u521b\u5efa\u9884\u5904\u7406\u4e0e\u540e\u5904\u7406\u811a\u672c&#xff08;\u5173\u952e&#xff09;<\/h4>\n<p>\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u7684\u63a8\u7406\u6d41\u7a0b\u6bd4\u7eaf\u6587\u672c\u6a21\u578b\u590d\u6742\u3002\u5b83\u9700\u8981&#xff1a;<\/p>\n<li>\u9884\u5904\u7406&#xff1a;\u5c06\u7528\u6237\u4e0a\u4f20\u7684\u56fe\u7247\u548c\u95ee\u9898\u6587\u672c&#xff0c;\u8f6c\u6362\u6210\u6a21\u578b\u9700\u8981\u7684\u6570\u5b57\u5f20\u91cf&#xff08;pixel_values, input_ids&#xff09;\u3002<\/li>\n<li>\u6838\u5fc3\u63a8\u7406&#xff1a;Triton\u8c03\u7528\u6a21\u578b\u8fdb\u884c\u8ba1\u7b97\u3002<\/li>\n<li>\u540e\u5904\u7406&#xff1a;\u5c06\u6a21\u578b\u8f93\u51fa\u7684\u6570\u5b57\u5f20\u91cf&#xff0c;\u8f6c\u6362\u56de\u4eba\u7c7b\u53ef\u8bfb\u7684\u6587\u672c\u7b54\u6848\u3002<\/li>\n<p>Triton\u901a\u8fc7\u201c\u96c6\u6210\u6a21\u578b\u201d\u529f\u80fd\u6765\u4e32\u8054\u8fd9\u4e9b\u6b65\u9aa4\u3002\u6211\u4eec\u9700\u8981\u4e3a\u9884\u5904\u7406\u548c\u540e\u5904\u7406\u5206\u522b\u7f16\u5199Python\u811a\u672c\u3002<\/p>\n<p>\u5728\u6a21\u578b\u76ee\u5f55\u4e0b\u521b\u5efa ensemble_model \u5b50\u76ee\u5f55\u548c\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>mkdir -p triton_model_repository\/llama_3_2v_11b_cot_ensemble\/1<\/p>\n<p>\u521b\u5efa\u96c6\u6210\u6a21\u578b\u7684\u914d\u7f6e\u6587\u4ef6 triton_model_repository\/llama_3_2v_11b_cot_ensemble\/config.pbtxt:<\/p>\n<p>name: &#034;llama_3_2v_11b_cot_ensemble&#034;<br \/>\nplatform: &#034;ensemble&#034;<br \/>\nmax_batch_size: 4<\/p>\n<p>input [<br \/>\n  {<br \/>\n    name: &#034;IMAGE&#034;<br \/>\n    data_type: TYPE_UINT8<br \/>\n    dims: [-1, -1, 3] # \u539f\u59cb\u56fe\u50cf&#xff0c;\u9ad8\u3001\u5bbd\u53ef\u53d8&#xff0c;3\u901a\u9053<br \/>\n  },<br \/>\n  {<br \/>\n    name: &#034;QUESTION&#034;<br \/>\n    data_type: TYPE_STRING<br \/>\n    dims: [ -1 ]<br \/>\n  }<br \/>\n]<\/p>\n<p>output [<br \/>\n  {<br \/>\n    name: &#034;ANSWER&#034;<br \/>\n    data_type: TYPE_STRING<br \/>\n    dims: [ -1 ]<br \/>\n  }<br \/>\n]<\/p>\n<p>ensemble_scheduling {<br \/>\n  step [<br \/>\n    {<br \/>\n      model_name: &#034;llama_3_2v_11b_cot_preprocess&#034;<br \/>\n      model_version: -1 # -1 \u8868\u793a\u4f7f\u7528\u6700\u65b0\u7248\u672c<br \/>\n      input_map {<br \/>\n        key: &#034;image&#034;<br \/>\n        value: &#034;IMAGE&#034;<br \/>\n      }<br \/>\n      input_map {<br \/>\n        key: &#034;question&#034;<br \/>\n        value: &#034;QUESTION&#034;<br \/>\n      }<br \/>\n      output_map {<br \/>\n        key: &#034;pixel_values&#034;<br \/>\n        value: &#034;preprocessed_image&#034;<br \/>\n      }<br \/>\n      output_map {<br \/>\n        key: &#034;input_ids&#034;<br \/>\n        value: &#034;tokenized_text&#034;<br \/>\n      }<br \/>\n      output_map {<br \/>\n        key: &#034;attention_mask&#034;<br \/>\n        value: &#034;attention_mask&#034;<br \/>\n      }<br \/>\n    },<br \/>\n    {<br \/>\n      model_name: &#034;llama_3_2v_11b_cot&#034;<br \/>\n      model_version: -1<br \/>\n      input_map {<br \/>\n        key: &#034;pixel_values&#034;<br \/>\n        value: &#034;preprocessed_image&#034;<br \/>\n      }<br \/>\n      input_map {<br \/>\n        key: &#034;input_ids&#034;<br \/>\n        value: &#034;tokenized_text&#034;<br \/>\n      }<br \/>\n      input_map {<br \/>\n        key: &#034;attention_mask&#034;<br \/>\n        value: &#034;attention_mask&#034;<br \/>\n      }<br \/>\n      output_map {<br \/>\n        key: &#034;output_0&#034;<br \/>\n        value: &#034;model_logits&#034;<br \/>\n      }<br \/>\n    },<br \/>\n    {<br \/>\n      model_name: &#034;llama_3_2v_11b_cot_postprocess&#034;<br \/>\n      model_version: -1<br \/>\n      input_map {<br \/>\n        key: &#034;logits&#034;<br \/>\n        value: &#034;model_logits&#034;<br \/>\n      }<br \/>\n      output_map {<br \/>\n        key: &#034;answer&#034;<br \/>\n        value: &#034;ANSWER&#034;<br \/>\n      }<br \/>\n    }<br \/>\n  ]<br \/>\n}<\/p>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5de5\u4f5c\u6d41\u6c34\u7ebf&#xff1a;\u9884\u5904\u7406\u6a21\u578b -&gt; \u6838\u5fc3\u6a21\u578b -&gt; \u540e\u5904\u7406\u6a21\u578b\u3002\u63a5\u4e0b\u6765&#xff0c;\u6211\u4eec\u9700\u8981\u5b9e\u73b0\u9884\u5904\u7406\u548c\u540e\u5904\u7406\u8fd9\u4e24\u4e2a\u6a21\u578b\u3002<\/p>\n<p>\u521b\u5efa\u9884\u5904\u7406\u6a21\u578b&#xff1a; \u5728\u4ed3\u5e93\u4e2d\u521b\u5efa triton_model_repository\/llama_3_2v_11b_cot_preprocess\/1\/ \u76ee\u5f55&#xff0c;\u5e76\u521b\u5efa model.py&#xff1a;<\/p>\n<p># triton_model_repository\/llama_3_2v_11b_cot_preprocess\/1\/model.py<br \/>\nimport triton_python_backend_utils as pb_utils<br \/>\nimport numpy as np<br \/>\nfrom PIL import Image<br \/>\nimport io<br \/>\nimport torch<br \/>\nfrom transformers import AutoProcessor<br \/>\nimport json<\/p>\n<p>class TritonPythonModel:<br \/>\n    def initialize(self, args):<br \/>\n        # \u521d\u59cb\u5316\u5904\u7406\u5668&#xff0c;\u8fd9\u91cc\u9700\u8981\u52a0\u8f7d\u4f60\u6a21\u578b\u5bf9\u5e94\u7684processor<br \/>\n        self.processor &#061; AutoProcessor.from_pretrained(&#034;\/home\/user\/llama-3.2v-11b-cot&#034;)<br \/>\n        print(&#034;Preprocess model initialized.&#034;)<\/p>\n<p>    def execute(self, requests):<br \/>\n        responses &#061; []<br \/>\n        for request in requests:<br \/>\n            # 1. \u83b7\u53d6\u539f\u59cb\u8f93\u5165<br \/>\n            image_input &#061; pb_utils.get_input_tensor_by_name(request, &#034;IMAGE&#034;)<br \/>\n            question_input &#061; pb_utils.get_input_tensor_by_name(request, &#034;QUESTION&#034;)<\/p>\n<p>            # \u539f\u59cb\u56fe\u50cf\u6570\u636e (numpy array, dtype&#061;uint8)<br \/>\n            image_np &#061; image_input.as_numpy()[0] # \u5047\u8bbe\u6279\u6b21\u5927\u5c0f\u4e3a1<br \/>\n            question_text &#061; question_input.as_numpy()[0].decode(&#039;utf-8&#039;)<\/p>\n<p>            # 2. \u56fe\u50cf\u9884\u5904\u7406&#xff1a;\u8c03\u6574\u5927\u5c0f\u3001\u5f52\u4e00\u5316\u7b49<br \/>\n            image_pil &#061; Image.fromarray(image_np)<br \/>\n            # \u4f7f\u7528\u5904\u7406\u5668\u7684\u56fe\u50cf\u5904\u7406\u529f\u80fd<br \/>\n            image_tensor &#061; self.processor.image_processor(image_pil, return_tensors&#061;&#034;pt&#034;)[&#039;pixel_values&#039;]<\/p>\n<p>            # 3. \u6587\u672c\u9884\u5904\u7406&#xff1a;\u5206\u8bcd<br \/>\n            text_encoding &#061; self.processor.tokenizer(question_text, return_tensors&#061;&#034;pt&#034;, padding&#061;True, truncation&#061;True)<\/p>\n<p>            # 4. \u6784\u5efa\u8f93\u51fa\u5f20\u91cf<br \/>\n            out_pixel_values &#061; pb_utils.Tensor(&#034;pixel_values&#034;, image_tensor.numpy().astype(np.float32))<br \/>\n            out_input_ids &#061; pb_utils.Tensor(&#034;input_ids&#034;, text_encoding[&#039;input_ids&#039;].numpy().astype(np.int64))<br \/>\n            out_attention_mask &#061; pb_utils.Tensor(&#034;attention_mask&#034;, text_encoding[&#039;attention_mask&#039;].numpy().astype(np.int64))<\/p>\n<p>            # 5. \u5c01\u88c5\u54cd\u5e94<br \/>\n            inference_response &#061; pb_utils.InferenceResponse(output_tensors&#061;[out_pixel_values, out_input_ids, out_attention_mask])<br \/>\n            responses.append(inference_response)<br \/>\n        return responses<\/p>\n<p>    def finalize(self):<br \/>\n        print(&#034;Cleaning up preprocess model.&#034;)<\/p>\n<p>\u522b\u5fd8\u4e86\u521b\u5efa\u5bf9\u5e94\u7684 config.pbtxt \u6765\u5b9a\u4e49\u8fd9\u4e2a\u9884\u5904\u7406\u6a21\u578b\u7684\u8f93\u5165\u8f93\u51fa\u3002<\/p>\n<p>\u521b\u5efa\u540e\u5904\u7406\u6a21\u578b&#xff1a; \u7c7b\u4f3c\u5730&#xff0c;\u521b\u5efa triton_model_repository\/llama_3_2v_11b_cot_postprocess\/1\/model.py&#xff0c;\u8d1f\u8d23\u5c06\u6a21\u578b\u8f93\u51fa\u7684logits\u89e3\u7801\u6210\u6587\u672c\u3002<\/p>\n<p># triton_model_repository\/llama_3_2v_11b_cot_postprocess\/1\/model.py<br \/>\nimport triton_python_backend_utils as pb_utils<br \/>\nimport numpy as np<br \/>\nimport torch<br \/>\nfrom transformers import AutoProcessor<\/p>\n<p>class TritonPythonModel:<br \/>\n    def initialize(self, args):<br \/>\n        self.processor &#061; AutoProcessor.from_pretrained(&#034;\/home\/user\/llama-3.2v-11b-cot&#034;)<br \/>\n        self.tokenizer &#061; self.processor.tokenizer<br \/>\n        print(&#034;Postprocess model initialized.&#034;)<\/p>\n<p>    def execute(self, requests):<br \/>\n        responses &#061; []<br \/>\n        for request in requests:<br \/>\n            # \u83b7\u53d6\u6a21\u578b\u8f93\u51fa\u7684logits<br \/>\n            logits_input &#061; pb_utils.get_input_tensor_by_name(request, &#034;logits&#034;)<br \/>\n            logits_np &#061; logits_input.as_numpy() # [batch_size, seq_len, vocab_size]<\/p>\n<p>            # \u5c06numpy\u8f6c\u6362\u56detorch tensor\u4ee5\u4fbf\u4f7f\u7528transformers\u89e3\u7801<br \/>\n            logits_tensor &#061; torch.from_numpy(logits_np)<\/p>\n<p>            # \u4f7f\u7528\u8d2a\u5a6a\u89e3\u7801&#xff08;\u6216beam search\u7b49\u66f4\u590d\u6742\u7684\u89e3\u7801\u7b56\u7565&#xff09;<br \/>\n            predicted_token_ids &#061; torch.argmax(logits_tensor, dim&#061;-1)<\/p>\n<p>            # \u5c06token ids\u89e3\u7801\u4e3a\u6587\u672c<br \/>\n            # \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u9700\u8981\u6839\u636e\u4f60\u7684\u6a21\u578b\u8f93\u51fa\u7ed3\u6784\u8fdb\u884c\u8c03\u6574&#xff0c;\u53ef\u80fd\u53ea\u9700\u8981\u89e3\u7801\u6700\u540e\u4e00\u6bb5<br \/>\n            generated_text &#061; self.tokenizer.batch_decode(predicted_token_ids, skip_special_tokens&#061;True)<\/p>\n<p>            # \u6784\u5efa\u8f93\u51fa\u5f20\u91cf<br \/>\n            out_answer &#061; pb_utils.Tensor(&#034;answer&#034;, np.array(generated_text, dtype&#061;object))<\/p>\n<p>            inference_response &#061; pb_utils.InferenceResponse(output_tensors&#061;[out_answer])<br \/>\n            responses.append(inference_response)<br \/>\n        return responses<\/p>\n<p>    def finalize(self):<br \/>\n        print(&#034;Cleaning up postprocess model.&#034;)<\/p>\n<p>\u540c\u6837&#xff0c;\u9700\u8981\u4e3a\u540e\u5904\u7406\u6a21\u578b\u521b\u5efa config.pbtxt\u3002<\/p>\n<p>\u81f3\u6b64&#xff0c;\u4e00\u4e2a\u5b8c\u6574\u7684Triton\u6a21\u578b\u4ed3\u5e93\u5c31\u51c6\u5907\u597d\u4e86\u3002\u5b83\u5305\u542b\u4e86\u6838\u5fc3\u63a8\u7406\u6a21\u578b\u3001\u9884\u5904\u7406\u548c\u540e\u5904\u7406\u903b\u8f91&#xff0c;\u5bf9\u5916\u63d0\u4f9b\u4e00\u4e2a\u63a5\u6536\u56fe\u7247\u548c\u95ee\u9898\u3001\u8fd4\u56de\u6587\u672c\u7b54\u6848\u7684\u7b80\u6d01\u63a5\u53e3\u3002<\/p>\n<h3>4. \u542f\u52a8Triton\u670d\u52a1\u5668\u5e76\u8fdb\u884c\u6d4b\u8bd5<\/h3>\n<p>\u4ed3\u5e93\u5efa\u597d\u4e86&#xff0c;\u8ba9\u6211\u4eec\u542f\u52a8\u670d\u52a1\u5668\u5e76\u770b\u770b\u6548\u679c\u3002<\/p>\n<h4>4.1 \u4f7f\u7528Docker\u542f\u52a8Triton<\/h4>\n<p>\u8fd9\u662f\u6700\u63a8\u8350\u7684\u65b9\u5f0f&#xff0c;\u80fd\u907f\u514d\u590d\u6742\u7684\u4f9d\u8d56\u95ee\u9898\u3002<\/p>\n<p># \u62c9\u53d6Triton Server\u7684Docker\u955c\u50cf&#xff08;\u9009\u62e9\u4e0e\u4f60CUDA\u7248\u672c\u5339\u914d\u7684tag&#xff09;<br \/>\ndocker pull nvcr.io\/nvidia\/tritonserver:23.10-py3<\/p>\n<p># \u8fd0\u884c\u5bb9\u5668&#xff0c;\u6302\u8f7d\u6a21\u578b\u4ed3\u5e93<br \/>\ndocker run &#8211;gpus&#061;all &#8211;rm -p 8000:8000 -p 8001:8001 -p 8002:8002 \\\\<br \/>\n  -v \/path\/to\/your\/triton_model_repository:\/models \\\\<br \/>\n  nvcr.io\/nvidia\/tritonserver:23.10-py3 \\\\<br \/>\n  tritonserver &#8211;model-repository&#061;\/models<\/p>\n<p>\u547d\u4ee4\u89e3\u91ca&#xff1a;<\/p>\n<ul>\n<li>&#8211;gpus&#061;all: \u5c06\u4e3b\u673a\u6240\u6709GPU\u900f\u4f20\u7ed9\u5bb9\u5668\u3002<\/li>\n<li>-p 8000:8000: \u6620\u5c04\u7aef\u53e3\u30028000\u662fHTTP\u7aef\u53e3&#xff0c;8001\u662fgRPC\u7aef\u53e3&#xff0c;8002\u662f\u6027\u80fd\u76d1\u63a7\u7aef\u53e3\u3002<\/li>\n<li>-v &#8230;: \u5c06\u4f60\u672c\u5730\u7684\u6a21\u578b\u4ed3\u5e93\u76ee\u5f55\u6302\u8f7d\u5230\u5bb9\u5668\u7684\/models\u8def\u5f84\u3002<\/li>\n<li>tritonserver &#8211;model-repository&#061;\/models: \u542f\u52a8Triton\u670d\u52a1\u5668\u5e76\u6307\u5b9a\u6a21\u578b\u4ed3\u5e93\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229&#xff0c;\u4f60\u4f1a\u5728\u65e5\u5fd7\u4e2d\u770b\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u8f93\u51fa&#xff0c;\u8868\u660e\u6a21\u578b\u52a0\u8f7d\u6210\u529f&#xff1a;<\/p>\n<p>&#8230;<br \/>\nI1230 10:00:00.000000 1 model_repository_manager.cc:1344] successfully loaded &#039;llama_3_2v_11b_cot&#039; version 1<br \/>\nI1230 10:00:00.000001 1 model_repository_manager.cc:1344] successfully loaded &#039;llama_3_2v_11b_cot_ensemble&#039; version 1<br \/>\n&#8230;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8211;&#043;<br \/>\n| Model                | Version | Status |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8211;&#043;<br \/>\n| llama_3_2v_11b_cot  | 1       | READY  |<br \/>\n| llama_3_2v_11b_cot_ensemble | 1       | READY  |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8211;&#043;<br \/>\n&#8230;<\/p>\n<h4>4.2 \u53d1\u9001\u8bf7\u6c42\u6d4b\u8bd5\u670d\u52a1<\/h4>\n<p>\u670d\u52a1\u5668\u8dd1\u8d77\u6765\u4e86&#xff0c;\u6211\u4eec\u5199\u4e2a\u7b80\u5355\u7684Python\u5ba2\u6237\u7aef\u6765\u6d4b\u8bd5\u4e00\u4e0b\u3002\u8fd9\u4e2a\u5ba2\u6237\u7aef\u4f1a\u53d1\u9001\u4e00\u5f20\u56fe\u7247\u548c\u4e00\u4e2a\u95ee\u9898\u7ed9\u6211\u4eec\u7684\u96c6\u6210\u6a21\u578b\u3002<\/p>\n<p># test_client.py<br \/>\nimport requests<br \/>\nimport json<br \/>\nimport base64<br \/>\nfrom PIL import Image<br \/>\nimport io<\/p>\n<p># Triton\u670d\u52a1\u5668\u5730\u5740<br \/>\nurl &#061; &#034;http:\/\/localhost:8000\/v2\/models\/llama_3_2v_11b_cot_ensemble\/infer&#034;<\/p>\n<p># 1. \u51c6\u5907\u56fe\u7247\u548c\u95ee\u9898<br \/>\nimage_path &#061; &#034;test_image.jpg&#034; # \u66ff\u6362\u6210\u4f60\u7684\u6d4b\u8bd5\u56fe\u7247\u8def\u5f84<br \/>\nquestion &#061; &#034;What is in this image? Please think step by step.&#034;<\/p>\n<p># \u8bfb\u53d6\u5e76\u7f16\u7801\u56fe\u7247<br \/>\nwith open(image_path, &#034;rb&#034;) as f:<br \/>\n    image_bytes &#061; f.read()<br \/>\nimage_b64 &#061; base64.b64encode(image_bytes).decode(&#039;utf-8&#039;)<\/p>\n<p># 2. \u6784\u5efa\u8bf7\u6c42\u4f53&#xff08;\u9075\u5faaTriton\u7684\u63a8\u7406\u534f\u8bae&#xff09;<br \/>\n# \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u6211\u4eec\u76f4\u63a5\u53d1\u9001\u539f\u59cb\u5b57\u8282&#xff0c;\u4e5f\u53ef\u4ee5\u53d1\u9001base64\u7f16\u7801\u7684\u5b57\u7b26\u4e32&#xff0c;\u9700\u8981\u5728\u9884\u5904\u7406\u6a21\u578b\u4e2d\u76f8\u5e94\u89e3\u6790\u3002<br \/>\nwith open(image_path, &#034;rb&#034;) as f:<br \/>\n    image_data &#061; f.read()<\/p>\n<p># \u6784\u5efa\u7b26\u5408Triton\u8f93\u5165\u683c\u5f0f\u7684\u8bf7\u6c42<br \/>\n# \u5bf9\u4e8e\u4e8c\u8fdb\u5236\u56fe\u50cf&#xff0c;\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u53d1\u9001bytes<br \/>\npayload &#061; {<br \/>\n    &#034;inputs&#034;: [<br \/>\n        {<br \/>\n            &#034;name&#034;: &#034;IMAGE&#034;,<br \/>\n            &#034;shape&#034;: [1], # \u6279\u6b21\u5927\u5c0f\u4e3a1<br \/>\n            &#034;datatype&#034;: &#034;BYTES&#034;,<br \/>\n            &#034;data&#034;: [image_data] # \u6ce8\u610f&#xff1a;\u8fd9\u91cc\u9700\u8981\u662f\u5217\u8868&#xff0c;\u5373\u4f7f\u53ea\u6709\u4e00\u4e2a\u5143\u7d20<br \/>\n        },<br \/>\n        {<br \/>\n            &#034;name&#034;: &#034;QUESTION&#034;,<br \/>\n            &#034;shape&#034;: [1],<br \/>\n            &#034;datatype&#034;: &#034;BYTES&#034;,<br \/>\n            &#034;data&#034;: [question.encode(&#039;utf-8&#039;)]<br \/>\n        }<br \/>\n    ],<br \/>\n    &#034;outputs&#034;: [{&#034;name&#034;: &#034;ANSWER&#034;}]<br \/>\n}<\/p>\n<p># 3. \u53d1\u9001\u8bf7\u6c42<br \/>\nheaders &#061; {&#034;Content-Type&#034;: &#034;application\/json&#034;}<br \/>\nresponse &#061; requests.post(url, data&#061;json.dumps(payload), headers&#061;headers)<\/p>\n<p># 4. \u89e3\u6790\u54cd\u5e94<br \/>\nif response.status_code &#061;&#061; 200:<br \/>\n    result &#061; response.json()<br \/>\n    answer_bytes &#061; result[&#039;outputs&#039;][0][&#039;data&#039;][0]<br \/>\n    answer &#061; answer_bytes.decode(&#039;utf-8&#039;)<br \/>\n    print(&#034;\u95ee\u9898:&#034;, question)<br \/>\n    print(&#034;\u6a21\u578b\u56de\u7b54:&#034;, answer)<br \/>\nelse:<br \/>\n    print(&#034;\u8bf7\u6c42\u5931\u8d25:&#034;, response.status_code, response.text)<\/p>\n<p>\u8fd0\u884c\u8fd9\u4e2a\u5ba2\u6237\u7aef\u811a\u672c&#xff0c;\u5982\u679c\u914d\u7f6e\u6b63\u786e&#xff0c;\u4f60\u5c06\u6536\u5230\u6a21\u578b\u6309\u7167SUMMARY\u2192CAPTION\u2192REASONING\u2192CONCLUSION\u683c\u5f0f\u751f\u6210\u7684\u63a8\u7406\u7b54\u6848\u3002<\/p>\n<h3>5. \u6027\u80fd\u538b\u6d4b\u4e0e\u4f18\u5316\u5efa\u8bae<\/h3>\n<p>\u670d\u52a1\u80fd\u8dd1\u901a\u53ea\u662f\u7b2c\u4e00\u6b65&#xff0c;\u6211\u4eec\u8fd8\u5f97\u77e5\u9053\u5b83\u80fd\u8dd1\u591a\u5feb\u3001\u80fd\u625b\u4f4f\u591a\u5927\u538b\u529b\u3002\u8fd9\u5c31\u662f\u6027\u80fd\u538b\u6d4b\u7684\u76ee\u7684\u3002<\/p>\n<h4>5.1 \u4f7f\u7528Perf Analyzer\u8fdb\u884c\u538b\u6d4b<\/h4>\n<p>NVIDIA Triton\u81ea\u5e26\u4e00\u4e2a\u5f3a\u5927\u7684\u6027\u80fd\u5206\u6790\u5de5\u5177 perf_analyzer\u3002\u6211\u4eec\u53ef\u4ee5\u7528\u5b83\u6765\u6a21\u62df\u5927\u91cf\u5e76\u53d1\u8bf7\u6c42&#xff0c;\u6d4b\u8bd5\u670d\u52a1\u7684\u541e\u5410\u91cf\u3001\u5ef6\u8fdf\u7b49\u5173\u952e\u6307\u6807\u3002<\/p>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u4f60\u7684\u6d4b\u8bd5\u56fe\u7247 test_image.jpg \u548c\u95ee\u9898\u6587\u672c test_question.txt \u5df2\u7ecf\u51c6\u5907\u597d\u3002\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p># \u8fdb\u5165Triton\u5bb9\u5668\u5185\u90e8\u6267\u884c&#xff0c;\u6216\u8005\u672c\u5730\u5b89\u88c5perf_analyzer<br \/>\ndocker exec -it &lt;\u4f60\u7684\u5bb9\u5668ID&gt; \/bin\/bash<\/p>\n<p># \u5728\u5bb9\u5668\u5185\u8fd0\u884cperf_analyzer<br \/>\nperf_analyzer -m llama_3_2v_11b_cot_ensemble \\\\<br \/>\n  -u localhost:8000 \\\\<br \/>\n  &#8211;input-data \/path\/to\/test_data.json \\\\<br \/>\n  &#8211;concurrency-range 1:8:2 \\\\ # \u6d4b\u8bd5\u5e76\u53d1\u6570\u4ece1\u52308&#xff0c;\u6b65\u957f\u4e3a2<br \/>\n  &#8211;measurement-mode count_windows \\\\<br \/>\n  &#8211;measurement-request-count 100<\/p>\n<p># \u6216\u8005&#xff0c;\u66f4\u7b80\u5355\u5730&#xff0c;\u4f7f\u7528\u5185\u7f6e\u7684\u968f\u673a\u6570\u636e\u5feb\u901f\u6d4b\u8bd5<br \/>\nperf_analyzer -m llama_3_2v_11b_cot_ensemble \\\\<br \/>\n  -u localhost:8000 \\\\<br \/>\n  &#8211;shape IMAGE:1,3,336,336 \\\\ # \u6307\u5b9a\u8f93\u5165\u5f62\u72b6&#xff0c;\u5bf9\u4e8eBYTES\u7c7b\u578b\u53ef\u80fd\u4e0d\u9002\u7528&#xff0c;\u9700\u8981\u51c6\u5907\u771f\u5b9e\u6570\u636e\u6587\u4ef6<br \/>\n  &#8211;shape QUESTION:1 \\\\<br \/>\n  &#8211;concurrency-range 1:4<\/p>\n<p>\u4e3a\u4e86\u8fdb\u884c\u6709\u610f\u4e49\u7684\u6d4b\u8bd5&#xff0c;\u4f60\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u771f\u5b9e\u8f93\u5165\u6570\u636e\u7684JSON\u6587\u4ef6 test_data.json&#xff1a;<\/p>\n<p>{<br \/>\n  &#034;data&#034;: [<br \/>\n    {<br \/>\n      &#034;IMAGE&#034;: {&#034;b64&#034;: &#034;\/9j\/4AAQSkZJRgABAQAAAQABAAD\/2wBDAA&#8230;&#034;}, \/\/ \u4f60\u7684\u6d4b\u8bd5\u56fe\u7247\u7684base64<br \/>\n      &#034;QUESTION&#034;: &#034;What is in this image?&#034;<br \/>\n    },<br \/>\n    \/\/ &#8230; \u53ef\u4ee5\u6709\u591a\u7ec4\u6d4b\u8bd5\u6570\u636e<br \/>\n  ]<br \/>\n}<\/p>\n<p>perf_analyzer \u4f1a\u8f93\u51fa\u8be6\u7ec6\u7684\u62a5\u544a&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u541e\u5410\u91cf (Inferences\/Second)&#xff1a;\u6bcf\u79d2\u80fd\u5904\u7406\u591a\u5c11\u4e2a\u8bf7\u6c42\u3002\u8fd9\u662f\u8861\u91cf\u670d\u52a1\u80fd\u529b\u7684\u5173\u952e\u6307\u6807\u3002<\/li>\n<li>\u5ef6\u8fdf (Latency)&#xff1a;\u5305\u62ec\u5e73\u5747\u5ef6\u8fdf\u3001\u5206\u4f4d\u5ef6\u8fdf&#xff08;\u5982P99&#xff0c;\u537399%\u7684\u8bf7\u6c42\u5728\u6b64\u65f6\u95f4\u5185\u5b8c\u6210&#xff09;\u3002\u8fd9\u53cd\u6620\u4e86\u7528\u6237\u7684\u7b49\u5f85\u65f6\u95f4\u3002<\/li>\n<li>GPU\u5229\u7528\u7387&#xff1a;\u6a21\u578b\u63a8\u7406\u65f6GPU\u7684\u8ba1\u7b97\u548c\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<h4>5.2 \u89e3\u8bfb\u7ed3\u679c\u4e0e\u4f18\u5316\u65b9\u5411<\/h4>\n<p>\u5047\u8bbe\u4f60\u5f97\u5230\u4e86\u4e00\u4efd\u7c7b\u4f3c\u4e0b\u9762\u7684\u7b80\u5316\u62a5\u544a&#xff1a;<\/p>\n<p>*** Measurement Results ***<br \/>\n  Concurrency: 4<br \/>\n  Throughput: 12.5 infer\/sec<br \/>\n  Avg Latency: 312.5 ms<br \/>\n  P99 Latency: 520 ms<br \/>\n  GPU Utilization: 85%<\/p>\n<p>\u5982\u4f55\u89e3\u8bfb&#xff1f;<\/p>\n<ul>\n<li>\u541e\u5410\u91cf 12.5 infer\/sec&#xff1a;\u5728\u5e76\u53d1\u4e3a4\u65f6&#xff0c;\u6bcf\u79d2\u80fd\u5904\u7406\u7ea612.5\u4e2a\u8bf7\u6c42\u3002\u5bf9\u4e8e11B\u53c2\u6570\u7684\u89c6\u89c9\u6a21\u578b&#xff0c;\u8fd9\u4e2a\u6570\u5b57\u662f\u5408\u7406\u7684\u8d77\u70b9\u3002<\/li>\n<li>\u5e73\u5747\u5ef6\u8fdf 312.5ms&#xff1a;\u6bcf\u4e2a\u8bf7\u6c42\u5e73\u5747\u9700\u8981\u7ea60.3\u79d2\u3002\u5bf9\u4e8e\u9700\u8981\u9010\u6b65\u63a8\u7406\u7684\u590d\u6742\u4efb\u52a1&#xff0c;\u8fd9\u4e2a\u5ef6\u8fdf\u53ef\u4ee5\u63a5\u53d7\u3002<\/li>\n<li>P99\u5ef6\u8fdf 520ms&#xff1a;99%\u7684\u8bf7\u6c42\u5728520\u6beb\u79d2\u5185\u5b8c\u6210&#xff0c;\u8bf4\u660e\u670d\u52a1\u54cd\u5e94\u6bd4\u8f83\u7a33\u5b9a&#xff0c;\u6ca1\u6709\u592a\u591a\u6781\u7aef\u6162\u7684\u8bf7\u6c42\u3002<\/li>\n<li>GPU\u5229\u7528\u7387 85%&#xff1a;GPU\u5f88\u5fd9&#xff0c;\u4f46\u8fd8\u6ca1\u5230100%&#xff0c;\u53ef\u80fd\u8fd8\u6709\u4f18\u5316\u7a7a\u95f4\u3002<\/li>\n<\/ul>\n<p>\u5e38\u89c1\u7684\u4f18\u5316\u65b9\u5411&#xff1a;<\/p>\n<li>\n<p>\u8c03\u6574\u6279\u5904\u7406\u5927\u5c0f (max_batch_size)&#xff1a; \u8fd9\u662f\u63d0\u5347\u541e\u5410\u91cf\u6700\u6709\u6548\u7684\u624b\u6bb5\u3002\u5728 config.pbtxt \u4e2d\u589e\u5927 max_batch_size&#xff08;\u6bd4\u5982\u4ece4\u6539\u4e3a8&#xff09;&#xff0c;\u5e76\u8c03\u6574 dynamic_batching \u4e2d\u7684 preferred_batch_size\u3002\u6ce8\u610f&#xff1a;\u8fd9\u4f1a\u5bfc\u81f4\u5355\u4e2a\u8bf7\u6c42\u5ef6\u8fdf\u589e\u52a0&#xff08;\u56e0\u4e3a\u8981\u7b49\u51d1\u6279&#xff09;&#xff0c;\u4f46\u603b\u4f53\u541e\u5410\u91cf\u4f1a\u4e0a\u5347\u3002\u4f60\u9700\u8981\u6839\u636e\u4e1a\u52a1\u573a\u666f\u6743\u8861&#xff08;\u91cd\u541e\u5410\u8fd8\u662f\u91cd\u5ef6\u8fdf&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u66f4\u5feb\u7684\u6a21\u578b\u683c\u5f0f&#xff1a;<\/p>\n<ul>\n<li>TensorRT&#xff1a;\u5982\u679c\u6a21\u578b\u652f\u6301&#xff0c;\u5c06ONNX\u6a21\u578b\u8fdb\u4e00\u6b65\u8f6c\u6362\u4e3aTensorRT\u5f15\u64ce&#xff0c;\u53ef\u4ee5\u83b7\u5f97\u663e\u8457\u7684\u6027\u80fd\u63d0\u5347\u3002NVIDIA\u63d0\u4f9b\u4e86trtexec\u5de5\u5177\u548cPython API\u6765\u5b8c\u6210\u8f6c\u6362\u3002<\/li>\n<li>FP16\/INT8\u91cf\u5316&#xff1a;\u5c06\u6a21\u578b\u6743\u91cd\u4eceFP32\u8f6c\u6362\u4e3aFP16\u751a\u81f3INT8&#xff0c;\u53ef\u4ee5\u5927\u5e45\u51cf\u5c11\u663e\u5b58\u5360\u7528\u548c\u8ba1\u7b97\u91cf&#xff0c;\u63d0\u5347\u901f\u5ea6&#xff0c;\u4f46\u53ef\u80fd\u4f1a\u8f7b\u5fae\u635f\u5931\u7cbe\u5ea6\u3002Triton\u652f\u6301\u52a0\u8f7d\u91cf\u5316\u540e\u7684\u6a21\u578b\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4f18\u5316\u9884\u5904\u7406\/\u540e\u5904\u7406&#xff1a;<\/p>\n<ul>\n<li>\u786e\u4fdd\u4f60\u7684\u9884\u5904\u7406\u548c\u540e\u5904\u7406Python\u811a\u672c\u662f\u9ad8\u6548\u7684\u3002\u907f\u514d\u5728\u5faa\u73af\u4e2d\u8fdb\u884c\u4e0d\u5fc5\u8981\u7684\u8ba1\u7b97\u3002<\/li>\n<li>\u8003\u8651\u4f7f\u7528C&#043;&#043;\u5b9e\u73b0\u9884\u5904\u7406\/\u540e\u5904\u7406&#xff08;Triton\u652f\u6301&#xff09;&#xff0c;\u901f\u5ea6\u4f1a\u6bd4Python\u5feb\u5f88\u591a\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u589e\u52a0\u6a21\u578b\u5b9e\u4f8b (instance_group)&#xff1a; \u5728 config.pbtxt \u7684 instance_group \u4e2d&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e count: 2 \u751a\u81f3\u66f4\u591a\u3002\u8fd9\u4f1a\u5728\u540c\u4e00\u4e2aGPU\u4e0a\u521b\u5efa\u6a21\u578b\u7684\u591a\u4e2a\u526f\u672c&#xff0c;\u5141\u8bb8Triton\u5728\u5b83\u4eec\u4e4b\u95f4\u5e76\u884c\u5904\u7406\u8bf7\u6c42&#xff0c;\u5c24\u5176\u6709\u5229\u4e8e\u5904\u7406\u5927\u91cf\u77ed\u65f6\u8bf7\u6c42\u3002\u4f46\u8fd9\u4f1a\u6210\u500d\u589e\u52a0\u663e\u5b58\u6d88\u8017\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u591aGPU&#xff1a; \u5982\u679c\u4f60\u6709\u591a\u4e2aGPU&#xff0c;\u53ef\u4ee5\u5728 instance_group \u7684 gpus \u5217\u8868\u4e2d\u6307\u5b9a [0,1]&#xff0c;\u5e76\u5c06 count \u8bbe\u7f6e\u4e3a\u6bcf\u4e2aGPU\u4e0a\u7684\u5b9e\u4f8b\u6570\u3002Triton\u4f1a\u81ea\u52a8\u5728GPU\u95f4\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n<\/li>\n<p>\u4f18\u5316\u662f\u4e00\u4e2a\u8fed\u4ee3\u8fc7\u7a0b&#xff1a;\u4fee\u6539\u914d\u7f6e -&gt; \u538b\u6d4b -&gt; \u5206\u6790\u7ed3\u679c -&gt; \u518d\u4fee\u6539\u3002\u76ee\u6807\u662f\u627e\u5230\u6ee1\u8db3\u4f60\u4e1a\u52a1\u9700\u6c42&#xff08;\u5982&#xff1a;\u5e73\u5747\u5ef6\u8fdf&lt;500ms&#xff0c;\u541e\u5410\u91cf&gt;20 infer\/sec&#xff09;\u4e0b\u7684\u6700\u4f18\u914d\u7f6e\u3002<\/p>\n<h3>6. \u603b\u7ed3<\/h3>\n<p>\u8d70\u5b8c\u8fd9\u4e00\u6574\u5957\u6d41\u7a0b&#xff0c;\u4f60\u5df2\u7ecf\u4e0d\u662f\u4ec5\u4ec5\u5728\u201c\u8fd0\u884c\u201d\u4e00\u4e2aAI\u6a21\u578b&#xff0c;\u800c\u662f\u5728\u201c\u90e8\u7f72\u201d\u4e00\u4e2a\u751f\u4ea7\u7ea7\u7684AI\u63a8\u7406\u670d\u52a1\u3002\u6211\u4eec\u6765\u56de\u987e\u4e00\u4e0b\u5173\u952e\u6b65\u9aa4\u548c\u6536\u83b7&#xff1a;<\/p>\n<li>\u4ece\u811a\u672c\u5230\u670d\u52a1&#xff1a;\u6211\u4eec\u8d85\u8d8a\u4e86\u7b80\u5355\u7684 python app.py&#xff0c;\u901a\u8fc7NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668&#xff0c;\u4e3aLlama-3.2V-11B-cot\u6784\u5efa\u4e86\u4e00\u4e2a\u5177\u5907\u9ad8\u5e76\u53d1\u3001\u52a8\u6001\u6279\u5904\u7406\u3001\u6a21\u578b\u7248\u672c\u7ba1\u7406\u7b49\u751f\u4ea7\u7279\u6027\u7684\u670d\u52a1\u73af\u5883\u3002<\/li>\n<li>\u7406\u89e3\u6d41\u6c34\u7ebf&#xff1a;\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u7684\u90e8\u7f72\u9700\u8981\u9884\u5904\u7406\u3001\u63a8\u7406\u3001\u540e\u5904\u7406\u4e09\u4e2a\u6b65\u9aa4\u3002\u6211\u4eec\u5229\u7528Triton\u7684\u96c6\u6210\u6a21\u578b\u529f\u80fd&#xff0c;\u5c06\u5b83\u4eec\u5c01\u88c5\u6210\u4e00\u4e2a\u5bf9\u7528\u6237\u53cb\u597d\u7684\u5355\u4e00\u63a5\u53e3&#xff08;\u8f93\u5165\u56fe\u7247\u548c\u95ee\u9898&#xff0c;\u8f93\u51fa\u7b54\u6848&#xff09;\u3002<\/li>\n<li>\u6027\u80fd\u6478\u5e95\u4e0e\u8c03\u4f18&#xff1a;\u4f7f\u7528 perf_analyzer \u5de5\u5177\u5bf9\u90e8\u7f72\u597d\u7684\u670d\u52a1\u8fdb\u884c\u538b\u529b\u6d4b\u8bd5&#xff0c;\u5f97\u5230\u4e86\u541e\u5410\u91cf\u3001\u5ef6\u8fdf\u7b49\u5173\u952e\u6307\u6807\u3002\u57fa\u4e8e\u8fd9\u4e9b\u6570\u636e&#xff0c;\u6211\u4eec\u63a2\u8ba8\u4e86\u901a\u8fc7\u8c03\u6574\u6279\u5904\u7406\u5927\u5c0f\u3001\u8f6c\u6362\u6a21\u578b\u683c\u5f0f\u3001\u589e\u52a0\u5b9e\u4f8b\u7b49\u65b9\u6cd5\u6765\u4f18\u5316\u6027\u80fd\u7684\u9014\u5f84\u3002<\/li>\n<p>\u90e8\u7f72\u8fd9\u6837\u4e00\u4e2a\u590d\u6742\u7684\u6a21\u578b\u786e\u5b9e\u6bd4\u8dd1\u901a\u4e00\u4e2aDemo\u8981\u7e41\u7410&#xff0c;\u4f46\u8fd9\u4efd\u6295\u5165\u662f\u503c\u5f97\u7684\u3002\u5b83\u610f\u5473\u7740\u4f60\u7684AI\u80fd\u529b\u4ece\u201c\u73a9\u5177\u201d\u9636\u6bb5\u8fc8\u5411\u4e86\u201c\u5de5\u5177\u201d\u9636\u6bb5&#xff0c;\u53ef\u4ee5\u66f4\u7a33\u5b9a\u3001\u66f4\u9ad8\u6548\u5730\u670d\u52a1\u4e8e\u771f\u5b9e\u7684\u5e94\u7528\u548c\u7528\u6237\u3002\u4e0b\u6b21\u5f53\u4f60\u9700\u8981\u5904\u7406\u6d77\u91cf\u7684\u56fe\u7247\u7406\u89e3\u4efb\u52a1\u65f6&#xff0c;\u8fd9\u4e2a\u57fa\u4e8eTriton\u7684\u670d\u52a1\u5c06\u4f1a\u6210\u4e3a\u4f60\u53ef\u9760\u7684\u57fa\u77f3\u3002<\/p>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b&#xff1a;NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b<br \/>\n\u60f3\u8bd5\u8bd5\u90a3\u4e2a\u80fd\u770b\u61c2\u56fe\u7247&#xff0c;\u8fd8\u80fd\u50cf\u4eba\u4e00\u6837\u4e00\u6b65\u6b65\u63a8\u7406\u7684AI\u6a21\u578b\u5417&#xff1f;Llama-3.2V-11B-cot\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e0d\u4ec5\u80fd\u7406\u89e3\u56fe\u7247\u5185\u5bb9&#xff0c;\u8fd8\u80fd\u628a\u601d\u8003\u8fc7\u7a0b\u62c6\u89e3\u6210\u201c\u603b\u7ed3\u2192\u63cf\u8ff0\u2192\u63a8\u7406\u2192\u7ed3\u8bba\u201d\u56db\u4e2a\u6b65\u9aa4&#xff0c;\u8ba9AI\u7684\u201c\u8111\u56de\u8def\u201d\u6e05\u6670\u53ef\u89c1\u3002<br \/>\n\u4e0d\u8fc7&#xff0c;\u76f4\u63a5\u8fd0\u884cPython\u811a\u672c\u867d\u7136\u7b80\u5355&#xff0c;\u4f46\u60f3\u5728\u751f\u4ea7\u73af<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7591,9521,9327],"topic":[],"class_list":["post-85083","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-9521","tag-9327"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/85083.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b&#xff1a;NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b \u60f3\u8bd5\u8bd5\u90a3\u4e2a\u80fd\u770b\u61c2\u56fe\u7247&#xff0c;\u8fd8\u80fd\u50cf\u4eba\u4e00\u6837\u4e00\u6b65\u6b65\u63a8\u7406\u7684AI\u6a21\u578b\u5417&#xff1f;Llama-3.2V-11B-cot\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e0d\u4ec5\u80fd\u7406\u89e3\u56fe\u7247\u5185\u5bb9&#xff0c;\u8fd8\u80fd\u628a\u601d\u8003\u8fc7\u7a0b\u62c6\u89e3\u6210\u201c\u603b\u7ed3\u2192\u63cf\u8ff0\u2192\u63a8\u7406\u2192\u7ed3\u8bba\u201d\u56db\u4e2a\u6b65\u9aa4&#xff0c;\u8ba9AI\u7684\u201c\u8111\u56de\u8def\u201d\u6e05\u6670\u53ef\u89c1\u3002 \u4e0d\u8fc7&#xff0c;\u76f4\u63a5\u8fd0\u884cPython\u811a\u672c\u867d\u7136\u7b80\u5355&#xff0c;\u4f46\u60f3\u5728\u751f\u4ea7\u73af\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/85083.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-26T16:16:50+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85083.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/85083.html\",\"name\":\"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-26T16:16:50+00:00\",\"dateModified\":\"2026-07-26T16:16:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/85083.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/85083.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/85083.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/85083.html","og_locale":"zh_CN","og_type":"article","og_title":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b&#xff1a;NVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b \u60f3\u8bd5\u8bd5\u90a3\u4e2a\u80fd\u770b\u61c2\u56fe\u7247&#xff0c;\u8fd8\u80fd\u50cf\u4eba\u4e00\u6837\u4e00\u6b65\u6b65\u63a8\u7406\u7684AI\u6a21\u578b\u5417&#xff1f;Llama-3.2V-11B-cot\u5c31\u662f\u8fd9\u6837\u4e00\u4e2a\u89c6\u89c9\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e0d\u4ec5\u80fd\u7406\u89e3\u56fe\u7247\u5185\u5bb9&#xff0c;\u8fd8\u80fd\u628a\u601d\u8003\u8fc7\u7a0b\u62c6\u89e3\u6210\u201c\u603b\u7ed3\u2192\u63cf\u8ff0\u2192\u63a8\u7406\u2192\u7ed3\u8bba\u201d\u56db\u4e2a\u6b65\u9aa4&#xff0c;\u8ba9AI\u7684\u201c\u8111\u56de\u8def\u201d\u6e05\u6670\u53ef\u89c1\u3002 \u4e0d\u8fc7&#xff0c;\u76f4\u63a5\u8fd0\u884cPython\u811a\u672c\u867d\u7136\u7b80\u5355&#xff0c;\u4f46\u60f3\u5728\u751f\u4ea7\u73af","og_url":"https:\/\/www.wsisp.com\/helps\/85083.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-26T16:16:50+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/85083.html","url":"https:\/\/www.wsisp.com\/helps\/85083.html","name":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-26T16:16:50+00:00","dateModified":"2026-07-26T16:16:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/85083.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/85083.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/85083.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Llama-3.2V-11B-cot\u90e8\u7f72\u6559\u7a0b\uff1aNVIDIA Triton\u63a8\u7406\u670d\u52a1\u5668\u5c01\u88c5\u4e0e\u6027\u80fd\u538b\u6d4b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=85083"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/85083\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=85083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=85083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=85083"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=85083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}