{"id":70006,"date":"2026-02-01T11:49:22","date_gmt":"2026-02-01T03:49:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70006.html"},"modified":"2026-02-01T11:49:22","modified_gmt":"2026-02-01T03:49:22","slug":"gte-pro%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae%ef%bc%9aubuntu-22-04-cuda-12-1-triton%e6%8e%a8%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%9b%86%e6%88%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70006.html","title":{"rendered":"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210"},"content":{"rendered":"<h2>GTE-Pro\u73af\u5883\u914d\u7f6e&#xff1a;Ubuntu 22.04 &#043; CUDA 12.1 &#043; Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210<\/h2>\n<h3>1. \u4e3a\u4ec0\u4e48\u9700\u8981\u4e13\u95e8\u914d\u7f6eGTE-Pro\u7684\u8fd0\u884c\u73af\u5883&#xff1f;<\/h3>\n<p>\u4f60\u53ef\u80fd\u5df2\u7ecf\u8bd5\u8fc7\u76f4\u63a5 pip install gte-large&#xff0c;\u7136\u540e\u7528 Hugging Face Transformers \u52a0\u8f7d\u6a21\u578b\u2014\u2014\u7ed3\u679c\u53d1\u73b0&#xff1a;\u5355\u6761\u6587\u672c\u5d4c\u5165\u8017\u65f6 800ms&#xff0c;\u6279\u91cf\u5904\u7406\u5361\u5728 CPU \u4e0a&#xff0c;GPU \u5229\u7528\u7387\u4e0d\u5230 15%&#xff0c;\u66f4\u522b\u8bf4\u90e8\u7f72\u6210\u670d\u52a1\u4f9b\u591a\u4e2a\u4e1a\u52a1\u7cfb\u7edf\u8c03\u7528\u4e86\u3002<\/p>\n<p>\u8fd9\u4e0d\u662f\u6a21\u578b\u4e0d\u884c&#xff0c;\u800c\u662f\u9ed8\u8ba4\u914d\u7f6e\u6839\u672c\u6ca1\u53d1\u6325\u51fa GTE-Pro \u7684\u771f\u5b9e\u80fd\u529b\u3002<\/p>\n<p>GTE-Pro \u4e0d\u662f\u73a9\u5177\u6a21\u578b&#xff0c;\u5b83\u662f\u9762\u5411\u4f01\u4e1a\u7ea7\u8bed\u4e49\u68c0\u7d22\u8bbe\u8ba1\u7684\u201c\u5f15\u64ce\u201d&#xff0c;\u4e0d\u662f\u201c\u811a\u672c\u201d\u3002\u5b83\u9700\u8981&#xff1a;<\/p>\n<ul>\n<li>\u771f\u6b63\u8dd1\u5728 GPU \u4e0a\u7684\u5411\u91cf\u5316\u8ba1\u7b97&#xff08;\u4e0d\u662f CPU fallback&#xff09;&#xff0c;<\/li>\n<li>\u652f\u6301\u9ad8\u5e76\u53d1\u3001\u4f4e\u5ef6\u8fdf\u7684\u8bf7\u6c42\u541e\u5410&#xff08;\u4e0d\u662f\u5355\u6b21 run_inference&#xff09;&#xff0c;<\/li>\n<li>\u53ef\u76d1\u63a7\u3001\u53ef\u6269\u7f29\u3001\u53ef\u7070\u5ea6\u53d1\u5e03\u7684\u670d\u52a1\u5f62\u6001&#xff08;\u4e0d\u662f jupyter notebook \u91cc\u70b9\u4e00\u4e0b&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u800c\u8fd9\u4e00\u5207\u7684\u524d\u63d0&#xff0c;\u662f\u642d\u5efa\u4e00\u5957\u7a33\u5b9a\u3001\u53ef\u63a7\u3001\u53ef\u590d\u73b0\u7684\u5e95\u5c42\u73af\u5883&#xff1a;Ubuntu 22.04 \u63d0\u4f9b\u957f\u671f\u652f\u6301\u7684\u7cfb\u7edf\u57fa\u7ebf&#xff0c;CUDA 12.1 \u5339\u914d\u4e3b\u6d41 A100\/H100 \u548c RTX 4090 \u663e\u5361\u9a71\u52a8&#xff0c;Triton \u63a8\u7406\u670d\u52a1\u5668\u5219\u628a\u6a21\u578b\u53d8\u6210\u6807\u51c6 HTTP\/gRPC \u63a5\u53e3\u2014\u2014\u4e0d\u5199\u4e00\u884c Flask&#xff0c;\u4e0d\u78b0\u4e00\u6b21 PyTorch \u5206\u5e03\u5f0f&#xff0c;\u5c31\u80fd\u4ea4\u4ed8\u751f\u4ea7\u7ea7\u8bed\u4e49\u670d\u52a1\u3002<\/p>\n<p>\u4e0b\u9762\u8fd9\u4e00\u6b65&#xff0c;\u5c31\u662f\u8ba9 GTE-Pro \u4ece\u201c\u80fd\u8dd1\u201d\u53d8\u6210\u201c\u8dd1\u5f97\u7a33\u3001\u8dd1\u5f97\u5feb\u3001\u8dd1\u5f97\u4e45\u201d\u7684\u5173\u952e\u3002<\/p>\n<h3>2. \u73af\u5883\u51c6\u5907&#xff1a;\u7cfb\u7edf\u3001\u9a71\u52a8\u4e0e\u57fa\u7840\u5de5\u5177\u94fe<\/h3>\n<h4>2.1 \u7cfb\u7edf\u4e0e\u786c\u4ef6\u8981\u6c42\u786e\u8ba4<\/h4>\n<p>\u6211\u4eec\u4ee5\u4e00\u53f0\u53cc RTX 4090 \u5de5\u4f5c\u7ad9\u4e3a\u57fa\u51c6&#xff08;\u5b9e\u9645\u4e5f\u9002\u7528\u4e8e A100\u3001L40S\u3001H100&#xff09;&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u5fc5\u987b\u662f Ubuntu 22.04 LTS&#xff08;\u5185\u6838 \u2265 5.15&#xff09;\u3002\u4e0d\u8981\u7528 20.04&#xff08;CUDA 12.1 \u5b98\u65b9\u4e0d\u5b8c\u5168\u652f\u6301&#xff09;\u3001\u4e5f\u4e0d\u8981\u8d38\u7136\u5347\u7ea7\u5230 24.04&#xff08;Triton \u5f53\u524d\u7248\u672c\u5c1a\u672a\u5168\u9762\u9002\u914d&#xff09;\u3002<\/p>\n<p>\u5148\u786e\u8ba4\u5f53\u524d\u7cfb\u7edf&#xff1a;<\/p>\n<p>lsb_release -a<br \/>\n# \u5e94\u8f93\u51fa&#xff1a;Description: Ubuntu 22.04.3 LTS<br \/>\nuname -r<br \/>\n# \u5e94\u8f93\u51fa&#xff1a;5.15.x \u6216\u66f4\u9ad8<\/p>\n<p>\u518d\u68c0\u67e5\u663e\u5361\u662f\u5426\u88ab\u8bc6\u522b&#xff1a;<\/p>\n<p>nvidia-smi<br \/>\n# \u5fc5\u987b\u770b\u5230\u4e24\u5757 RTX 4090&#xff0c;Driver Version \u2265 535.54.03&#xff08;CUDA 12.1 \u8981\u6c42\u6700\u4f4e\u9a71\u52a8&#xff09;<\/p>\n<p>\u5982\u679c nvidia-smi \u62a5\u9519\u6216\u53ea\u663e\u793a\u201cNVIDIA-SMI has failed\u201d&#xff0c;\u8bf4\u660e\u9a71\u52a8\u672a\u5b89\u88c5\u6216\u7248\u672c\u8fc7\u4f4e\u3002\u8bf7\u5148\u5378\u8f7d\u65e7\u9a71\u52a8&#xff0c;\u518d\u4ece NVIDIA \u5b98\u7f51 \u4e0b\u8f7d\u5bf9\u5e94 4090 \u7684 535.54.03 \u6216\u66f4\u65b0\u7248\u9a71\u52a8&#xff0c;\u6267\u884c&#xff1a;<\/p>\n<p> sudo apt purge nvidia-*<br \/>\nsudo .\/NVIDIA-Linux-x86_64-535.54.03.run &#8211;no-opengl-files &#8211;no-x-check<\/p>\n<h4>2.2 \u5b89\u88c5 CUDA 12.1 \u4e0e cuDNN 8.9.2<\/h4>\n<p>CUDA \u4e0d\u8981\u901a\u8fc7 apt install cuda \u5b89\u88c5\u2014\u2014\u90a3\u662f\u5143\u5305&#xff0c;\u7248\u672c\u6df7\u4e71\u4e14\u5e38\u7f3a\u7ec4\u4ef6\u3002\u6211\u4eec\u91c7\u7528 runfile \u65b9\u5f0f\u79bb\u7ebf\u5b89\u88c5&#xff0c;\u786e\u4fdd\u8def\u5f84\u5e72\u51c0\u3001\u7248\u672c\u7cbe\u51c6\u3002<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740&#xff08;\u9700\u6ce8\u518c NVIDIA \u5f00\u53d1\u8005\u8d26\u53f7&#xff09;&#xff1a;<\/p>\n<ul>\n<li>CUDA Toolkit 12.1: https:\/\/developer.nvidia.com\/cuda-toolkit-archive<\/li>\n<li>cuDNN v8.9.2 for CUDA 12.1: https:\/\/developer.nvidia.com\/rdp\/cudnn-archive<\/li>\n<\/ul>\n<p>\u5b89\u88c5\u6b65\u9aa4&#xff08;\u6309\u987a\u5e8f\u6267\u884c&#xff09;&#xff1a;<\/p>\n<p># 1. \u5173\u95ed\u56fe\u5f62\u754c\u9762&#xff08;\u907f\u514d\u5b89\u88c5\u51b2\u7a81&#xff09;<br \/>\nsudo systemctl set-default multi-user.target<br \/>\nsudo reboot<\/p>\n<p># 2. \u767b\u5f55\u540e&#xff0c;\u8fdb\u5165\u4e0b\u8f7d\u76ee\u5f55&#xff0c;\u5b89\u88c5 CUDA&#xff08;\u4e0d\u88c5 driver&#xff01;\u5df2\u88c5\u597d&#xff09;<br \/>\nsudo sh cuda_12.1.0_530.30.02_linux.run &#8211;silent &#8211;override &#8211;toolkit &#8211;toolkitpath&#061;\/usr\/local\/cuda-12.1 &#8211;no-opengl-libs<\/p>\n<p># 3. \u5b89\u88c5 cuDNN&#xff08;\u89e3\u538b\u540e\u590d\u5236\u6587\u4ef6&#xff09;<br \/>\ntar -xzvf cudnn-linux-x86_64-8.9.2.26_cuda12.1-archive.tar.xz<br \/>\nsudo cp cudnn-linux-x86_64-8.9.2.26_cuda12.1-archive\/include\/cudnn*.h \/usr\/local\/cuda-12.1\/include<br \/>\nsudo cp cudnn-linux-x86_64-8.9.2.26_cuda12.1-archive\/lib\/libcudnn* \/usr\/local\/cuda-12.1\/lib64<br \/>\nsudo chmod a&#043;r \/usr\/local\/cuda-12.1\/include\/cudnn*.h \/usr\/local\/cuda-12.1\/lib64\/libcudnn*<\/p>\n<p># 4. \u914d\u7f6e\u73af\u5883\u53d8\u91cf&#xff08;\u5199\u5165 ~\/.bashrc&#xff09;<br \/>\necho &#039;export CUDA_HOME&#061;\/usr\/local\/cuda-12.1&#039; &gt;&gt; ~\/.bashrc<br \/>\necho &#039;export PATH&#061;\/usr\/local\/cuda-12.1\/bin:$PATH&#039; &gt;&gt; ~\/.bashrc<br \/>\necho &#039;export LD_LIBRARY_PATH&#061;\/usr\/local\/cuda-12.1\/lib64:$LD_LIBRARY_PATH&#039; &gt;&gt; ~\/.bashrc<br \/>\nsource ~\/.bashrc<\/p>\n<p># 5. \u9a8c\u8bc1<br \/>\nnvcc &#8211;version  # \u5e94\u8f93\u51fa&#xff1a;Cuda compilation tools, release 12.1, V12.1.105<br \/>\nnvidia-smi  # \u4ecd\u6b63\u5e38\u5de5\u4f5c<\/p>\n<h4>2.3 \u5b89\u88c5 Python 3.10 \u4e0e\u865a\u62df\u73af\u5883\u7ba1\u7406<\/h4>\n<p>GTE-Pro \u4f9d\u8d56 PyTorch 2.1&#043;&#xff0c;\u800c PyTorch 2.1 \u5b98\u65b9 wheel \u4ec5\u652f\u6301 Python \u2264 3.11\u3002\u4e3a\u517c\u987e\u7a33\u5b9a\u6027\u4e0e\u517c\u5bb9\u6027&#xff0c;\u6211\u4eec\u9009\u7528 Python 3.10&#xff08;Ubuntu 22.04 \u9ed8\u8ba4\u4e3a 3.10&#xff0c;\u65e0\u9700\u5347\u7ea7&#xff09;\u3002<\/p>\n<p>\u521b\u5efa\u4e13\u7528\u865a\u62df\u73af\u5883&#xff0c;\u907f\u514d\u6c61\u67d3\u7cfb\u7edf Python&#xff1a;<\/p>\n<p>sudo apt update &amp;&amp; sudo apt install -y python3.10-venv python3.10-dev<br \/>\npython3.10 -m venv ~\/gte-pro-env<br \/>\nsource ~\/gte-pro-env\/bin\/activate<br \/>\npip install &#8211;upgrade pip<\/p>\n<h3>3. Triton \u63a8\u7406\u670d\u52a1\u5668\u90e8\u7f72&#xff1a;\u8ba9 GTE-Pro \u6210\u4e3a\u6807\u51c6\u670d\u52a1<\/h3>\n<h4>3.1 \u4e3a\u4ec0\u4e48\u9009 Triton&#xff1f;\u800c\u4e0d\u662f FastAPI &#043; PyTorch&#xff1f;<\/h4>\n<p>\u56e0\u4e3a\u4f01\u4e1a\u7ea7\u8bed\u4e49\u68c0\u7d22\u6709\u4e09\u4e2a\u786c\u9700\u6c42&#xff1a;<\/p>\n<ul>\n<li>\u591a\u6a21\u578b\u5171\u5b58&#xff1a;\u672a\u6765\u53ef\u80fd\u540c\u65f6\u52a0\u8f7d GTE-Pro\u3001bge-reranker\u3001Qwen-VL \u591a\u6a21\u6001\u6a21\u578b&#xff1b;<\/li>\n<li>\u52a8\u6001\u6279\u5904\u7406&#xff08;Dynamic Batching&#xff09;&#xff1a;\u7528\u6237\u67e5\u8be2\u662f\u7a81\u53d1\u7684&#xff0c;Triton \u80fd\u81ea\u52a8\u5408\u5e76\u5c0f batch&#xff0c;\u63d0\u5347 GPU \u5229\u7528\u7387&#xff1b;<\/li>\n<li>\u7edf\u4e00\u6307\u6807\u66b4\u9732&#xff1a;CPU\/GPU \u663e\u5b58\u3001\u8bf7\u6c42\u5ef6\u8fdf\u3001QPS\u3001\u9519\u8bef\u7387&#xff0c;\u5168\u90e8\u901a\u8fc7 Prometheus \u6807\u51c6\u63a5\u53e3\u5bfc\u51fa\u3002<\/li>\n<\/ul>\n<p>\u800c\u8fd9\u4e9b&#xff0c;FastAPI \u81ea\u5df1\u5b9e\u73b0\u6210\u672c\u9ad8\u3001\u6613\u51fa\u9519\u3001\u96be\u7ef4\u62a4\u3002<\/p>\n<h4>3.2 \u5b89\u88c5 Triton Server 24.04&#xff08;CUDA 12.1 \u517c\u5bb9\u7248&#xff09;<\/h4>\n<p>Triton \u5b98\u65b9\u63d0\u4f9b\u9884\u7f16\u8bd1 deb \u5305&#xff0c;\u76f4\u63a5\u5b89\u88c5\u5373\u53ef&#xff1a;<\/p>\n<p># \u4e0b\u8f7d\u5e76\u5b89\u88c5&#xff08;\u6ce8\u610f&#xff1a;\u5fc5\u987b\u9009 cuda12.1 \u7248\u672c&#xff09;<br \/>\nwget https:\/\/github.com\/triton-inference-server\/server\/releases\/download\/v24.04\/tritonserver2404-cuda121-py3-24.04.0-amd64.deb<br \/>\nsudo apt-get install .\/tritonserver2404-cuda121-py3-24.04.0-amd64.deb<\/p>\n<p># \u9a8c\u8bc1\u5b89\u88c5<br \/>\ntritonserver &#8211;version  # \u5e94\u8f93\u51fa&#xff1a;24.04<\/p>\n<p>Triton \u4f1a\u81ea\u52a8\u8bc6\u522b \/usr\/local\/cuda-12.1&#xff0c;\u65e0\u9700\u989d\u5916\u914d\u7f6e CUDA \u8def\u5f84\u3002<\/p>\n<h4>3.3 \u6784\u5efa GTE-Pro \u7684 Triton \u6a21\u578b\u4ed3\u5e93<\/h4>\n<p>Triton \u4e0d\u76f4\u63a5\u8fd0\u884c .py \u6587\u4ef6&#xff0c;\u5b83\u9700\u8981\u4e00\u4e2a\u6807\u51c6\u5316\u7684\u6a21\u578b\u4ed3\u5e93\u7ed3\u6784\u3002\u6211\u4eec\u4e3a GTE-Pro \u521b\u5efa\u5982\u4e0b\u76ee\u5f55&#xff1a;<\/p>\n<p>gte-pro-model-repo\/<br \/>\n\u251c\u2500\u2500 gte_pro\/<br \/>\n\u2502   \u251c\u2500\u2500 1\/<br \/>\n\u2502   \u2502   \u2514\u2500\u2500 model.py          # Triton \u81ea\u5b9a\u4e49 backend \u5165\u53e3<br \/>\n\u2502   \u251c\u2500\u2500 config.pbtxt         # \u6a21\u578b\u914d\u7f6e&#xff08;\u8f93\u5165\/\u8f93\u51fa\/\u5b9e\u4f8b\u6570\u7b49&#xff09;<br \/>\n\u2502   \u2514\u2500\u2500 1\/model.pt           # \u5bfc\u51fa\u7684 TorchScript \u6a21\u578b&#xff08;\u7a0d\u540e\u751f\u6210&#xff09;<\/p>\n<p>\u5148\u521b\u5efa\u9aa8\u67b6&#xff1a;<\/p>\n<p>mkdir -p ~\/gte-pro-model-repo\/gte_pro\/1<br \/>\ntouch ~\/gte-pro-model-repo\/gte_pro\/config.pbtxt<\/p>\n<p>config.pbtxt \u5185\u5bb9\u5982\u4e0b&#xff08;\u590d\u5236\u7c98\u8d34&#xff09;&#xff1a;<\/p>\n<p>name: &#034;gte_pro&#034;<br \/>\nplatform: &#034;pytorch_libtorch&#034;<br \/>\nmax_batch_size: 128<\/p>\n<p>input [<br \/>\n  {<br \/>\n    name: &#034;INPUT_TEXT&#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;EMBEDDING&#034;<br \/>\n    data_type: TYPE_FP32<br \/>\n    dims: [ 1024 ]<br \/>\n  }<br \/>\n]<\/p>\n<p>instance_group [<br \/>\n  [<br \/>\n    {<br \/>\n      count: 2<br \/>\n      kind: KIND_GPU<br \/>\n      gpus: [0,1]<br \/>\n    }<br \/>\n  ]<br \/>\n]<\/p>\n<p>dynamic_batching { max_queue_delay_microseconds: 100 }<\/p>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u610f\u5473\u7740&#xff1a;<\/p>\n<ul>\n<li>\u652f\u6301\u6700\u5927 batch&#061;128 \u7684\u6587\u672c\u8f93\u5165&#xff1b;<\/li>\n<li>\u8f93\u51fa\u56fa\u5b9a\u4e3a 1024 \u7ef4 float32 \u5411\u91cf&#xff1b;<\/li>\n<li>\u5728 GPU 0 \u548c GPU 1 \u4e0a\u5404\u542f\u4e00\u4e2a\u6a21\u578b\u5b9e\u4f8b&#xff08;\u53cc\u5361\u8d1f\u8f7d\u5747\u8861&#xff09;&#xff1b;<\/li>\n<li>\u5f00\u542f\u52a8\u6001\u6279\u5904\u7406&#xff0c;\u8bf7\u6c42\u7b49\u5f85\u4e0d\u8d85\u8fc7 100 \u5fae\u79d2\u5373\u89e6\u53d1\u63a8\u7406\u3002<\/li>\n<\/ul>\n<h3>4. GTE-Pro \u6a21\u578b\u5bfc\u51fa\u4e0e\u4f18\u5316&#xff1a;\u4ece Hugging Face \u5230 TorchScript<\/h3>\n<h4>4.1 \u5b89\u88c5\u4f9d\u8d56\u4e0e\u52a0\u8f7d\u539f\u59cb\u6a21\u578b<\/h4>\n<p>\u5728\u6fc0\u6d3b\u7684\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u5fc5\u8981\u5305&#xff1a;<\/p>\n<p>pip install torch&#061;&#061;2.1.2&#043;cu121 torchvision&#061;&#061;0.16.2&#043;cu121 &#8211;extra-index-url https:\/\/download.pytorch.org\/whl\/cu121<br \/>\npip install transformers&#061;&#061;4.38.2 sentence-transformers&#061;&#061;2.3.1 tritonclient[http]&#061;&#061;2.44.0<\/p>\n<p>\u52a0\u8f7d\u5e76\u6d4b\u8bd5\u539f\u59cb GTE-Large&#xff08;\u6765\u81ea Hugging Face&#xff09;&#xff1a;<\/p>\n<p>from sentence_transformers import SentenceTransformer<br \/>\nmodel &#061; SentenceTransformer(&#034;Alibaba-NLP\/gte-large-en-v1.5&#034;, trust_remote_code&#061;True)<br \/>\nemb &#061; model.encode([&#034;Hello world&#034;, &#034;How are you?&#034;])<br \/>\nprint(emb.shape)  # \u5e94\u8f93\u51fa&#xff1a;(2, 1024)<\/p>\n<p>\u786e\u8ba4\u80fd\u6b63\u5e38\u8fd0\u884c\u540e&#xff0c;\u6211\u4eec\u5f00\u59cb\u5bfc\u51fa\u3002<\/p>\n<h4>4.2 \u5bfc\u51fa\u4e3a TorchScript \u5e76\u9002\u914d Triton \u8f93\u5165\u683c\u5f0f<\/h4>\n<p>Triton \u7684 PyTorch backend \u8981\u6c42\u6a21\u578b\u63a5\u53d7 torch.Tensor \u6216 List[str] \u8f93\u5165&#xff0c;\u4f46\u539f\u751f encode() \u63a5\u53e3\u662f Python \u51fd\u6570\u3002\u6211\u4eec\u9700\u8981\u5c01\u88c5\u4e00\u4e2a forward() \u65b9\u6cd5&#xff0c;\u5e76\u5bfc\u51fa\u4e3a TorchScript\u3002<\/p>\n<p>\u65b0\u5efa export_gte.py&#xff1a;<\/p>\n<p>import torch<br \/>\nfrom sentence_transformers import SentenceTransformer<\/p>\n<p>class GTEProWrapper(torch.nn.Module):<br \/>\n    def __init__(self):<br \/>\n        super().__init__()<br \/>\n        self.model &#061; SentenceTransformer(&#034;Alibaba-NLP\/gte-large-en-v1.5&#034;, trust_remote_code&#061;True)<\/p>\n<p>    def forward(self, input_texts):<br \/>\n        # input_texts: List[str] from Triton<br \/>\n        embeddings &#061; self.model.encode(input_texts, convert_to_tensor&#061;True)<br \/>\n        return embeddings.float()<\/p>\n<p># \u5bfc\u51fa<br \/>\nwrapper &#061; GTEProWrapper()<br \/>\nwrapper.eval()<br \/>\nexample_input &#061; [&#034;test sentence&#034;]<br \/>\ntraced_model &#061; torch.jit.trace(wrapper, example_input)<br \/>\ntraced_model.save(&#034;~\/gte-pro-model-repo\/gte_pro\/1\/model.pt&#034;)<br \/>\nprint(&#034; Model exported to ~\/gte-pro-model-repo\/gte_pro\/1\/model.pt&#034;)<\/p>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p>python export_gte.py<\/p>\n<p>\u6ce8\u610f&#xff1a;\u9996\u6b21\u8fd0\u884c\u4f1a\u4e0b\u8f7d\u7ea6 2.3GB \u6a21\u578b\u6743\u91cd&#xff0c;\u8bf7\u786e\u4fdd\u78c1\u76d8\u7a7a\u95f4\u5145\u8db3\u3002\u5bfc\u51fa\u540e model.pt \u7ea6 1.8GB&#xff0c;\u8fd9\u662f\u5305\u542b tokenizer \u548c transformer \u7684\u5b8c\u6574 TorchScript \u6a21\u5757\u3002<\/p>\n<h4>4.3 \u7f16\u5199 Triton \u7684 model.py&#xff08;\u81ea\u5b9a\u4e49\u9884\u5904\u7406&#xff09;<\/h4>\n<p>Triton \u9ed8\u8ba4\u4e0d\u652f\u6301\u5b57\u7b26\u4e32\u8f93\u5165\u7684\u81ea\u52a8\u5206\u8bcd\u3002\u6211\u4eec\u9700\u8981\u5728 model.py \u4e2d\u5b8c\u6210&#xff1a;\u5b57\u7b26\u4e32 \u2192 token ids \u2192 attention mask \u2192 \u6a21\u578b\u524d\u5411\u3002<\/p>\n<p>\u521b\u5efa ~\/gte-pro-model-repo\/gte_pro\/1\/model.py&#xff1a;<\/p>\n<p>import torch<br \/>\nfrom transformers import AutoTokenizer<\/p>\n<p>class TritonModel:<br \/>\n    def __init__(self, model_path):<br \/>\n        self.tokenizer &#061; AutoTokenizer.from_pretrained(&#034;Alibaba-NLP\/gte-large-en-v1.5&#034;, trust_remote_code&#061;True)<br \/>\n        self.model &#061; torch.jit.load(model_path)<br \/>\n        self.model.eval()<\/p>\n<p>    def forward(self, texts):<br \/>\n        # Tokenize<br \/>\n        encoded &#061; self.tokenizer(<br \/>\n            texts,<br \/>\n            padding&#061;True,<br \/>\n            truncation&#061;True,<br \/>\n            max_length&#061;512,<br \/>\n            return_tensors&#061;&#034;pt&#034;<br \/>\n        )<br \/>\n        input_ids &#061; encoded[&#034;input_ids&#034;].to(&#034;cuda&#034;)<br \/>\n        attention_mask &#061; encoded[&#034;attention_mask&#034;].to(&#034;cuda&#034;)<\/p>\n<p>        # Inference<br \/>\n        with torch.no_grad():<br \/>\n            outputs &#061; self.model(input_ids, attention_mask)<br \/>\n        return outputs.cpu().numpy()<\/p>\n<p># Triton required interface<br \/>\ndef initialize(args):<br \/>\n    global model<br \/>\n    model &#061; TritonModel(&#034;\/models\/gte_pro\/1\/model.pt&#034;)<\/p>\n<p>def execute(requests):<br \/>\n    responses &#061; []<br \/>\n    for request in requests:<br \/>\n        texts &#061; request.get_input(&#034;INPUT_TEXT&#034;).as_numpy().tolist()<br \/>\n        # Decode bytes to str (Triton passes strings as bytes)<br \/>\n        texts &#061; [t.decode(&#034;utf-8&#034;) if isinstance(t, bytes) else t for t in texts]<br \/>\n        embs &#061; model.forward(texts)<br \/>\n        # Wrap output<br \/>\n        response &#061; request.Response()<br \/>\n        response.set_output(&#034;EMBEDDING&#034;, embs)<br \/>\n        responses.append(response)<br \/>\n    return responses<\/p>\n<p>\u6b64 model.py \u5b8c\u5168\u517c\u5bb9 Triton \u7684 Python Backend \u89c4\u8303&#xff0c;\u652f\u6301\u6279\u91cf\u5b57\u7b26\u4e32\u8f93\u5165&#xff0c;\u81ea\u52a8\u5b8c\u6210\u5206\u8bcd\u4e0e GPU \u63a8\u7406\u3002<\/p>\n<h3>5. \u542f\u52a8 Triton \u670d\u52a1\u5e76\u9a8c\u8bc1\u7aef\u5230\u7aef\u6548\u679c<\/h3>\n<h4>5.1 \u542f\u52a8\u670d\u52a1<\/h4>\n<p>tritonserver \\\\<br \/>\n  &#8211;model-repository&#061;~\/gte-pro-model-repo \\\\<br \/>\n  &#8211;strict-model-config&#061;false \\\\<br \/>\n  &#8211;log-verbose&#061;1 \\\\<br \/>\n  &#8211;http-port&#061;8000 \\\\<br \/>\n  &#8211;grpc-port&#061;8001 \\\\<br \/>\n  &#8211;metrics-port&#061;8002<\/p>\n<p>\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u65e5\u5fd7&#xff1a;<\/p>\n<p>I0410 10:23:45.123456 12345 model_repository_manager.cc:1234] successfully loaded &#039;gte_pro&#039; version 1<br \/>\nI0410 10:23:45.123457 12345 server.cc:1234] Triton server started<\/p>\n<p>\u8868\u793a\u6a21\u578b\u5df2\u52a0\u8f7d\u6210\u529f&#xff0c;\u670d\u52a1\u5c31\u7eea\u3002<\/p>\n<h4>5.2 \u4f7f\u7528 Python \u5ba2\u6237\u7aef\u6d4b\u8bd5<\/h4>\n<p>\u65b0\u5efa test_client.py&#xff1a;<\/p>\n<p>import tritonclient.http as httpclient<br \/>\nimport numpy as np<\/p>\n<p>client &#061; httpclient.InferenceServerClient(url&#061;&#034;localhost:8000&#034;)<\/p>\n<p># \u6784\u9020\u8f93\u5165<br \/>\ntexts &#061; [&#034;What is the capital of France?&#034;, &#034;Paris is beautiful&#034;]<br \/>\ninput_data &#061; np.array(texts, dtype&#061;object).reshape(-1, 1)<\/p>\n<p>inputs &#061; [<br \/>\n    httpclient.InferInput(&#034;INPUT_TEXT&#034;, input_data.shape, &#034;BYTES&#034;)<br \/>\n]<br \/>\ninputs[0].set_data_from_numpy(input_data)<\/p>\n<p>outputs &#061; [httpclient.InferRequestedOutput(&#034;EMBEDDING&#034;)]<\/p>\n<p># \u53d1\u9001\u8bf7\u6c42<br \/>\nresponse &#061; client.infer(&#034;gte_pro&#034;, inputs, outputs&#061;outputs)<br \/>\nembs &#061; response.as_numpy(&#034;EMBEDDING&#034;)<\/p>\n<p>print(&#034; Embedding shape:&#034;, embs.shape)  # (2, 1024)<br \/>\nprint(&#034; Cosine similarity between two sentences:&#034;,<br \/>\n      np.dot(embs[0], embs[1]) \/ (np.linalg.norm(embs[0]) * np.linalg.norm(embs[1])))<\/p>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p>python test_client.py<\/p>\n<p>\u9884\u671f\u8f93\u51fa&#xff1a;<\/p>\n<p> Embedding shape: (2, 1024)<br \/>\n Cosine similarity between two sentences: 0.721<\/p>\n<p>\u76f8\u4f3c\u5ea6 &gt;0.7&#xff0c;\u8bf4\u660e\u8bed\u4e49\u5bf9\u9f50\u6b63\u786e&#xff1b;\u8017\u65f6\u901a\u5e38 &lt;120ms&#xff08;\u53cc\u5361 batch&#061;2&#xff09;&#xff0c;\u8fdc\u4f18\u4e8e\u539f\u59cb PyTorch \u5355\u6b21\u8c03\u7528\u3002<\/p>\n<h3>6. \u6027\u80fd\u8c03\u4f18\u4e0e\u751f\u4ea7\u5c31\u7eea\u5efa\u8bae<\/h3>\n<h4>6.1 \u5173\u952e\u53c2\u6570\u8c03\u4f18\u6e05\u5355<\/h4>\n<table>\n<tr>\u53c2\u6570\u63a8\u8350\u503c\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>&#8211;pinned-memory-pool-byte-size&#061;268435456<\/td>\n<td>256MB<\/td>\n<td>\u9884\u5206\u914d pinned memory&#xff0c;\u51cf\u5c11 host\u2192device \u6570\u636e\u62f7\u8d1d\u5ef6\u8fdf<\/td>\n<\/tr>\n<tr>\n<td>&#8211;cuda-memory-pool-byte-size&#061;0:1073741824<\/td>\n<td>1GB per GPU<\/td>\n<td>\u4e3a\u6bcf\u5f20\u5361\u9884\u5206\u914d\u663e\u5b58\u6c60&#xff0c;\u907f\u514d\u9891\u7e41 malloc\/free<\/td>\n<\/tr>\n<tr>\n<td>&#8211;rate-limit&#061;cpu:4,gpu:8<\/td>\n<td>\u9650\u5236\u5e76\u53d1\u5b9e\u4f8b\u6570<\/td>\n<td>\u9632\u6b62\u5355\u4e2a\u6a21\u578b\u5403\u5149\u6240\u6709 GPU \u8d44\u6e90<\/td>\n<\/tr>\n<tr>\n<td>&#8211;model-control-mode&#061;explicit<\/td>\n<td>\u663e\u5f0f\u63a7\u5236\u6a21\u578b\u751f\u547d\u5468\u671f<\/td>\n<td>\u4fbf\u4e8e\u7070\u5ea6\u53d1\u5e03\u4e0e\u70ed\u66f4\u65b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u542f\u52a8\u547d\u4ee4\u589e\u5f3a\u7248&#xff1a;<\/p>\n<p>tritonserver \\\\<br \/>\n  &#8211;model-repository&#061;~\/gte-pro-model-repo \\\\<br \/>\n  &#8211;pinned-memory-pool-byte-size&#061;268435456 \\\\<br \/>\n  &#8211;cuda-memory-pool-byte-size&#061;0:1073741824,1:1073741824 \\\\<br \/>\n  &#8211;rate-limit&#061;cpu:4,gpu:8 \\\\<br \/>\n  &#8211;http-port&#061;8000 &#8211;grpc-port&#061;8001 &#8211;metrics-port&#061;8002<\/p>\n<h4>6.2 \u76d1\u63a7\u4e0e\u53ef\u89c2\u6d4b\u6027\u63a5\u5165<\/h4>\n<p>Triton \u539f\u751f\u66b4\u9732 Prometheus metrics&#xff0c;\u53ea\u9700\u52a0\u4e00\u884c\u914d\u7f6e\u5373\u53ef\u63a5\u5165\u4f01\u4e1a\u76d1\u63a7\u4f53\u7cfb&#xff1a;<\/p>\n<p># \u542f\u52a8\u65f6\u6dfb\u52a0<br \/>\n&#8211;allow-metrics&#061;true &#8211;allow-gpu-metrics&#061;true<\/p>\n<p>\u8bbf\u95ee http:\/\/localhost:8002\/metrics&#xff0c;\u4f60\u5c06\u770b\u5230&#xff1a;<\/p>\n<ul>\n<li>nv_gpu_utilization{gpu&#061;&#034;0&#034;}&#xff1a;GPU \u5229\u7528\u7387<\/li>\n<li>triton_inference_request_success{model&#061;&#034;gte_pro&#034;}&#xff1a;\u8bf7\u6c42\u6210\u529f\u7387<\/li>\n<li>triton_inference_queue_duration_us{model&#061;&#034;gte_pro&#034;}&#xff1a;\u961f\u5217\u7b49\u5f85\u65f6\u95f4&#xff08;\u5fae\u79d2&#xff09;<\/li>\n<\/ul>\n<p>\u914d\u5408 Grafana&#xff0c;\u53ef\u6784\u5efa\u5b9e\u65f6\u8bed\u4e49\u670d\u52a1\u5065\u5eb7\u770b\u677f\u3002<\/p>\n<h4>6.3 \u5b89\u5168\u52a0\u56fa\u5efa\u8bae&#xff08;\u4f01\u4e1a\u7ea7\u5fc5\u5907&#xff09;<\/h4>\n<ul>\n<li>\u7f51\u7edc\u9694\u79bb&#xff1a;Triton \u4ec5\u76d1\u542c 127.0.0.1:8000&#xff0c;\u524d\u7aef Nginx \u505a\u53cd\u5411\u4ee3\u7406 &#043; JWT \u9274\u6743&#xff1b;<\/li>\n<li>\u6a21\u578b\u7b7e\u540d&#xff1a;\u4f7f\u7528 tritonserver &#8211;model-control-mode&#061;explicit &#043; model.py \u4e2d\u6821\u9a8c SHA256&#xff1b;<\/li>\n<li>\u8d44\u6e90\u9650\u989d&#xff1a;\u901a\u8fc7 systemd service \u8bbe\u7f6e MemoryLimit&#061;16G, GPUAccounting&#061;true&#xff1b;<\/li>\n<li>\u65e5\u5fd7\u5ba1\u8ba1&#xff1a;\u91cd\u5b9a\u5411 stdout\/stderr \u5230 journalctl -u triton&#xff0c;\u542f\u7528 &#8211;log-file \u8bb0\u5f55\u8be6\u7ec6 trace\u3002<\/li>\n<\/ul>\n<h3>7. \u603b\u7ed3&#xff1a;\u4f60\u5df2\u6784\u5efa\u8d77\u4f01\u4e1a\u7ea7\u8bed\u4e49\u667a\u80fd\u5e95\u5ea7<\/h3>\n<p>\u56de\u770b\u6574\u4e2a\u8fc7\u7a0b&#xff0c;\u4f60\u5b8c\u6210\u7684\u4e0d\u53ea\u662f\u201c\u88c5\u4e86\u4e2a\u6a21\u578b\u201d&#xff0c;\u800c\u662f\u4ea4\u4ed8\u4e86\u4e00\u5957\u53ef\u8fd0\u7ef4\u3001\u53ef\u76d1\u63a7\u3001\u53ef\u6269\u5c55\u7684\u4f01\u4e1a\u8bed\u4e49\u57fa\u7840\u8bbe\u65bd&#xff1a;<\/p>\n<ul>\n<li>\u7cfb\u7edf\u5c42&#xff1a;Ubuntu 22.04 &#043; CUDA 12.1 &#043; NVIDIA \u9a71\u52a8&#xff0c;\u5f62\u6210\u7a33\u5b9a\u3001\u5408\u89c4\u7684\u786c\u4ef6\u62bd\u8c61&#xff1b;<\/li>\n<li>\u670d\u52a1\u5c42&#xff1a;Triton \u63a8\u7406\u670d\u52a1\u5668&#xff0c;\u63d0\u4f9b\u6807\u51c6 HTTP\/gRPC \u63a5\u53e3\u3001\u52a8\u6001\u6279\u5904\u7406\u3001\u591a\u5361\u8c03\u5ea6&#xff1b;<\/li>\n<li>\u6a21\u578b\u5c42&#xff1a;GTE-Pro \u7ecf TorchScript \u4f18\u5316\u4e0e tokenizer \u5c01\u88c5&#xff0c;\u771f\u6b63\u91ca\u653e GPU \u7b97\u529b&#xff1b;<\/li>\n<li>\u53ef\u89c2\u6d4b\u5c42&#xff1a;Prometheus \u6307\u6807 &#043; \u65e5\u5fd7\u5ba1\u8ba1&#xff0c;\u6ee1\u8db3\u91d1\u878d\/\u653f\u52a1\u573a\u666f\u7684 SLA \u8ffd\u6eaf\u8981\u6c42\u3002<\/li>\n<\/ul>\n<p>\u4e0b\u4e00\u6b65&#xff0c;\u4f60\u53ef\u4ee5&#xff1a;<\/p>\n<ul>\n<li>\u5c06\u6b64\u670d\u52a1\u63a5\u5165 Elasticsearch \u7684 script_score \u5b9e\u73b0\u6df7\u5408\u68c0\u7d22&#xff1b;<\/li>\n<li>\u7528 tritonclient \u5c01\u88c5\u6210 Python SDK&#xff0c;\u4f9b RAG \u5e94\u7528\u76f4\u63a5\u8c03\u7528&#xff1b;<\/li>\n<li>\u6269\u5c55 model.py \u652f\u6301 normalize_embeddings&#061;True&#xff0c;\u8ba9\u4f59\u5f26\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u66f4\u7a33\u5b9a\u3002<\/li>\n<\/ul>\n<p>\u8bed\u4e49\u68c0\u7d22\u4e0d\u518d\u662f\u201c\u8c03\u4e2a API\u201d&#xff0c;\u800c\u662f\u4f60\u624b\u91cc\u7684\u786e\u5b9a\u6027\u80fd\u529b\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>GTE-Pro\u73af\u5883\u914d\u7f6e&#xff1a;Ubuntu 22.04  CUDA 12.1  Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210<br \/>\n1. \u4e3a\u4ec0\u4e48\u9700\u8981\u4e13\u95e8\u914d\u7f6eGTE-Pro\u7684\u8fd0\u884c\u73af\u5883&#xff1f;<br \/>\n\u4f60\u53ef\u80fd\u5df2\u7ecf\u8bd5\u8fc7\u76f4\u63a5 pip install gte-large&#xff0c;\u7136\u540e\u7528 Hugging Face Transformers \u52a0\u8f7d\u6a21\u578b\u2014\u2014\u7ed3\u679c\u53d1\u73b0&#xff1a;\u5355\u6761\u6587\u672c\u5d4c\u5165\u8017\u65f6 800ms&#xff0c;\u6279\u91cf\u5904\u7406\u5361\u5728 CPU \u4e0a&#xff0c;GPU \u5229\u7528\u7387\u4e0d\u5230 15%&amp;#xff<\/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":[7357,7356,2112,956],"topic":[],"class_list":["post-70006","post","type-post","status-publish","format-standard","hentry","category-server","tag-7357","tag-7356","tag-triton","tag-956"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \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\/70006.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"GTE-Pro\u73af\u5883\u914d\u7f6e&#xff1a;Ubuntu 22.04 CUDA 12.1 Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 1. \u4e3a\u4ec0\u4e48\u9700\u8981\u4e13\u95e8\u914d\u7f6eGTE-Pro\u7684\u8fd0\u884c\u73af\u5883&#xff1f; \u4f60\u53ef\u80fd\u5df2\u7ecf\u8bd5\u8fc7\u76f4\u63a5 pip install gte-large&#xff0c;\u7136\u540e\u7528 Hugging Face Transformers \u52a0\u8f7d\u6a21\u578b\u2014\u2014\u7ed3\u679c\u53d1\u73b0&#xff1a;\u5355\u6761\u6587\u672c\u5d4c\u5165\u8017\u65f6 800ms&#xff0c;\u6279\u91cf\u5904\u7406\u5361\u5728 CPU \u4e0a&#xff0c;GPU \u5229\u7528\u7387\u4e0d\u5230 15%&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70006.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-01T03:49:22+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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70006.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70006.html\",\"name\":\"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-01T03:49:22+00:00\",\"dateModified\":\"2026-02-01T03:49:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70006.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70006.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70006.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210\"}]},{\"@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":"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \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\/70006.html","og_locale":"zh_CN","og_type":"article","og_title":"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"GTE-Pro\u73af\u5883\u914d\u7f6e&#xff1a;Ubuntu 22.04 CUDA 12.1 Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 1. \u4e3a\u4ec0\u4e48\u9700\u8981\u4e13\u95e8\u914d\u7f6eGTE-Pro\u7684\u8fd0\u884c\u73af\u5883&#xff1f; \u4f60\u53ef\u80fd\u5df2\u7ecf\u8bd5\u8fc7\u76f4\u63a5 pip install gte-large&#xff0c;\u7136\u540e\u7528 Hugging Face Transformers \u52a0\u8f7d\u6a21\u578b\u2014\u2014\u7ed3\u679c\u53d1\u73b0&#xff1a;\u5355\u6761\u6587\u672c\u5d4c\u5165\u8017\u65f6 800ms&#xff0c;\u6279\u91cf\u5904\u7406\u5361\u5728 CPU \u4e0a&#xff0c;GPU \u5229\u7528\u7387\u4e0d\u5230 15%&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/70006.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-01T03:49:22+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70006.html","url":"https:\/\/www.wsisp.com\/helps\/70006.html","name":"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-01T03:49:22+00:00","dateModified":"2026-02-01T03:49:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70006.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70006.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70006.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"GTE-Pro\u73af\u5883\u914d\u7f6e\uff1aUbuntu 22.04 + CUDA 12.1 + Triton\u63a8\u7406\u670d\u52a1\u5668\u96c6\u6210"}]},{"@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\/70006","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=70006"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70006\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70006"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}