{"id":18022,"date":"2026-06-10T09:02:30","date_gmt":"2026-06-10T01:02:30","guid":{"rendered":"https:\/\/ab123.xyz\/?p=18022"},"modified":"2026-06-10T09:02:30","modified_gmt":"2026-06-10T01:02:30","slug":"llama-3-1-70b-%e6%8e%a8%e7%90%86%e9%80%9f%e5%ba%a6%e4%bc%98%e5%8c%96%e4%b8%8e%e6%89%b9%e5%a4%84%e7%90%86%ef%bc%9avllm-%e5%b7%a5%e5%85%b7%e5%ae%8c%e6%95%b4%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/ab123.xyz\/?p=18022","title":{"rendered":"Llama 3.1 70B \u63a8\u7406\u901f\u5ea6\u4f18\u5316\u4e0e\u6279\u5904\u7406\uff1avLLM \u5de5\u5177\u5b8c\u6574\u6307\u5357"},"content":{"rendered":"<p>\u5728\u5927\u578b\u8bed\u8a00\u6a21\u578b\u90e8\u7f72\u4e2d\uff0cLlama 3.1 70B \u4ee5\u5176\u5f3a\u5927\u7684\u80fd\u529b\u5907\u53d7\u5173\u6ce8\uff0c\u4f46\u5176\u63a8\u7406\u901f\u5ea6\u4e0e\u663e\u5b58\u6d88\u8017\u4e00\u76f4\u662f\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5173\u952e\u74f6\u9888\u3002\u9488\u5bf9\u8fd9\u4e00\u9700\u6c42\uff0c\u4e1a\u754c\u9886\u5148\u7684\u5f00\u6e90\u63a8\u7406\u5f15\u64ce <strong>vLLM<\/strong> \u63d0\u4f9b\u4e86\u6781\u81f4\u7684\u4f18\u5316\u65b9\u6848\uff0c\u901a\u8fc7\u9ad8\u6548\u7684\u6279\u5904\u7406\u4e0e\u5185\u5b58\u7ba1\u7406\uff0c\u5c06 Llama 3.1 70B \u7684\u63a8\u7406\u541e\u5410\u91cf\u63d0\u5347\u6570\u500d\u3002\u4ee5\u4e0b\u4ece\u529f\u80fd\u3001\u4f18\u52bf\u3001\u5e94\u7528\u573a\u666f\u53ca\u4f7f\u7528\u65b9\u5f0f\u8fdb\u884c\u5168\u9762\u4ecb\u7ecd\u3002<\/p>\n<h2>vLLM \u7684\u6838\u5fc3\u529f\u80fd\u4e0e\u4f18\u5316\u539f\u7406<\/h2>\n<p>vLLM \u4e13\u4e3a\u5927\u89c4\u6a21 Transformer \u6a21\u578b\u8bbe\u8ba1\uff0c\u5176\u6838\u5fc3\u6280\u672f <strong>PagedAttention<\/strong> \u501f\u9274\u64cd\u4f5c\u7cfb\u7edf\u7684\u865a\u62df\u5185\u5b58\u7ba1\u7406\uff0c\u5c06 KV \u7f13\u5b58\u5206\u9875\u5b58\u50a8\uff0c\u6d88\u9664\u663e\u5b58\u788e\u7247\uff0c\u4f7f\u6279\u5904\u7406\u5bb9\u91cf\u63d0\u5347 2-4 \u500d\u3002\u540c\u65f6\u652f\u6301\u8fde\u7eed\u6279\u5904\u7406\uff08continuous batching\uff09\uff0c\u5728\u63a8\u7406\u8fc7\u7a0b\u4e2d\u52a8\u6001\u8c03\u5ea6\u8bf7\u6c42\uff0c\u6700\u5927\u5316 GPU \u5229\u7528\u7387\u3002\u9488\u5bf9 Llama 3.1 70B\uff0cvLLM \u8fd8\u80fd\u81ea\u52a8\u9009\u62e9\u6700\u4f73\u91cf\u5316\u65b9\u6848\uff08\u5982 FP8\u3001INT4\uff09\uff0c\u8fdb\u4e00\u6b65\u964d\u4f4e\u663e\u5b58\u5360\u7528\u3002<\/p>\n<h3>\u6279\u5904\u7406\u80fd\u529b\u7a81\u7834<\/h3>\n<p>\u4f20\u7edf\u63a8\u7406\u6846\u67b6\u5728\u6279\u5904\u7406\u65f6\u5f80\u5f80\u53d7\u9650\u4e8e\u56fa\u5b9a batch size \u5bfc\u81f4\u7684\u663e\u5b58\u6d6a\u8d39\u3002vLLM \u7684 PagedAttention \u5141\u8bb8\u6bcf\u4e2a\u8bf7\u6c42\u6309\u9700\u5206\u914d\u7f13\u5b58\uff0c\u652f\u6301\u6570\u5343\u4e2a\u5e76\u53d1\u8bf7\u6c42\u7684 batch \u5904\u7406\uff0c\u5b9e\u6d4b\u5728 A100 80GB \u4e0a\uff0cLlama 3.1 70B \u7684\u541e\u5410\u91cf\u53ef\u8fbe\u6bcf\u79d2 1000+ tokens\u3002<\/p>\n<h3>\u7075\u6d3b\u90e8\u7f72\u67b6\u6784<\/h3>\n<p>vLLM \u63d0\u4f9b\u4e0e OpenAI API \u517c\u5bb9\u7684 HTTP \u670d\u52a1\u5668\uff0c\u652f\u6301 NVIDIA\u3001AMD \u53ca\u534e\u4e3a\u6607\u817e\u7b49\u591a\u79cd\u786c\u4ef6\u540e\u7aef\uff0c\u5e76\u53ef\u4e0e Kubernetes\u3001Docker \u65e0\u7f1d\u96c6\u6210\uff0c\u9002\u5408\u4e91\u7aef\u4e0e\u79c1\u6709\u5316\u90e8\u7f72\u3002<\/p>\n<h2>vLLM \u7684\u72ec\u7279\u4f18\u52bf<\/h2>\n<p>\u4e0e TensorRT-LLM\u3001llama.cpp \u7b49\u65b9\u6848\u76f8\u6bd4\uff0cvLLM \u5728\u6613\u7528\u6027\u4e0e\u6027\u80fd\u4e4b\u95f4\u53d6\u5f97\u6700\u4f73\u5e73\u8861\uff1a<\/p>\n<ul>\n<li><strong>\u96f6\u4ee3\u7801\u9002\u914d<\/strong>\uff1a\u65e0\u9700\u624b\u52a8\u4f18\u5316\u6a21\u578b\u56fe\uff0c\u76f4\u63a5\u52a0\u8f7d Hugging Face \u683c\u5f0f\u7684 Llama 3.1 \u6743\u91cd\u5373\u53ef\u3002<\/li>\n<li><strong>\u52a8\u6001\u524d\u7f00\u7f13\u5b58<\/strong>\uff1a\u81ea\u52a8\u8bc6\u522b\u516c\u5171 prompt \u524d\u7f00\uff08\u5982\u7cfb\u7edf\u63d0\u793a\u8bcd\uff09\uff0c\u663e\u8457\u51cf\u5c11\u91cd\u590d\u8ba1\u7b97\u3002<\/li>\n<li><strong>\u6d41\u5f0f\u8f93\u51fa<\/strong>\uff1a\u652f\u6301 token \u7ea7\u522b\u7684\u6d41\u5f0f\u54cd\u5e94\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n<li><strong>\u663e\u5b58\u63a7\u5236<\/strong>\uff1a\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u7cbe\u786e\u9650\u5236 GPU \u663e\u5b58\u4e0a\u9650\uff0c\u907f\u514d OOM\u3002<\/li>\n<\/ul>\n<h2>\u5178\u578b\u5e94\u7528\u573a\u666f<\/h2>\n<h3>\u4f01\u4e1a\u7ea7 API \u670d\u52a1<\/h3>\n<p>\u4e3a\u5ba2\u670d\u3001\u6587\u6863\u5206\u6790\u7b49\u9ad8\u5e76\u53d1\u573a\u666f\u63d0\u4f9b\u4f4e\u5ef6\u8fdf\u63a8\u7406\uff0cvLLM \u53ef\u540c\u65f6\u5904\u7406\u4e0a\u5343\u4e2a\u8bf7\u6c42\uff0c\u5e73\u5747\u9996 token \u5ef6\u8fdf\u4f4e\u4e8e 50ms\u3002<\/p>\n<h3>\u804a\u5929\u673a\u5668\u4eba\u4e0e\u667a\u80fd\u52a9\u624b<\/h3>\n<p>\u7ed3\u5408\u957f\u4e0a\u4e0b\u6587\u7a97\u53e3\uff0832K\uff09\uff0cvLLM \u5b8c\u7f8e\u652f\u6491\u591a\u8f6e\u5bf9\u8bdd\uff0c\u6279\u91cf\u5904\u7406\u7fa4\u804a\u6d88\u606f\u65f6\u4fdd\u6301\u6d41\u7545\u4ea4\u4e92\u3002<\/p>\n<h3>\u7814\u7a76\u4e0e\u5b9e\u9a8c<\/h3>\n<p>\u5b66\u672f\u56e2\u961f\u53ef\u5feb\u901f\u8fed\u4ee3 Prompt \u5de5\u7a0b\u6216\u5fae\u8c03\u6a21\u578b\uff0cvLLM \u7684\u6279\u5904\u7406\u80fd\u529b\u8ba9\u5927\u89c4\u6a21\u8bc4\u4f30\u5b9e\u9a8c\u8017\u65f6\u4ece\u6570\u5929\u7f29\u77ed\u81f3\u6570\u5c0f\u65f6\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528 vLLM \u52a0\u901f Llama 3.1 70B<\/h2>\n<p>\u901a\u8fc7 pip \u5b89\u88c5\u540e\uff0c\u4ec5\u9700\u4e09\u884c\u4ee3\u7801\u5373\u53ef\u542f\u52a8\uff1a<\/p>\n<p><code>from vllm import LLM, SamplingParams<br \/>llm = LLM(model=\"meta-llama\/Meta-Llama-3.1-70B\", tensor_parallel_size=4)<br \/>outputs = llm.generate(prompts, sampling_params)<\/code><\/p>\n<p>\u5efa\u8bae\u5728\u62e5\u6709 4 \u5f20 A100\uff0880GB\uff09\u7684\u8282\u70b9\u4e0a\u8fd0\u884c\uff0c\u6216\u5229\u7528 vLLM \u7684 <strong>AWQ\/GPTQ<\/strong> \u91cf\u5316\u652f\u6301\uff0c\u5728\u5355\u5361 RTX 4090 \u4e0a\u5b9e\u73b0\u8fd1\u4f3c\u6548\u679c\u3002\u66f4\u591a\u8c03\u4f18\u53c2\u6570\u8bf7\u53c2\u9605\u5b98\u65b9\u6587\u6863\u3002<a href=\"https:\/\/github.com\/vllm-project\/vllm\" target=\"_blank\">\u5b98\u65b9\u7f51\u7ad9<\/a><\/p>\n<p>vLLM \u5df2\u88ab\u591a\u5bb6\u5934\u90e8\u4f01\u4e1a\u7528\u4e8e\u751f\u4ea7\u73af\u5883\uff0c\u6210\u4e3a Llama 3.1 70B \u63a8\u7406\u4f18\u5316\u7684\u9996\u9009\u5de5\u5177\u3002\u7acb\u5373\u90e8\u7f72\uff0c\u91ca\u653e\u5927\u6a21\u578b\u7684\u5168\u90e8\u6f5c\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5927\u578b\u8bed\u8a00\u6a21\u578b\u90e8\u7f72\u4e2d\uff0cLlama 3.1 70B \u4ee5\u5176\u5f3a\u5927\u7684\u80fd\u529b\u5907\u53d7\u5173\u6ce8\uff0c\u4f46\u5176\u63a8\u7406\u901f\u5ea6\u4e0e\u663e\u5b58\u6d88\u8017\u4e00\u76f4\u662f\u5b9e\u9645\u5e94\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[21384,21386,9327,1012,21385],"class_list":["post-18022","post","type-post","status-publish","format-standard","hentry","category-4","tag-llama-3-1-70b","tag-vllm","tag-9327","tag-1012","tag-21385"],"_links":{"self":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/18022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18022"}],"version-history":[{"count":1,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/18022\/revisions"}],"predecessor-version":[{"id":18023,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/18022\/revisions\/18023"}],"wp:attachment":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}