{"id":117,"date":"2024-07-22T15:51:13","date_gmt":"2024-07-22T07:51:13","guid":{"rendered":"https:\/\/www.onetts.com\/ai\/?p=117"},"modified":"2024-07-24T11:55:51","modified_gmt":"2024-07-24T03:55:51","slug":"llama3-70b","status":"publish","type":"post","link":"https:\/\/www.onetts.com\/ai\/models\/llama3-70b\/","title":{"rendered":"Llama3-70B"},"content":{"rendered":"<p data-spm-anchor-id=\"a2c6h.13066512.0.i5.4aa336afpYsRxn\"><strong data-spm-anchor-id=\"a2c6h.13066512.0.i4.4aa336afpYsRxn\">Llama3-70B<\/strong>\u662f Meta \u516c\u53f8\u63a8\u51fa\u7684\u4e00\u6b3e\u5177\u6709\u91cc\u7a0b\u7891\u610f\u4e49\u7684\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff0c\u62e5\u6709\u9ad8\u8fbe70B\uff08\u53737000\u4ebf\uff09\u53c2\u6570\u3002\u8fd9\u6b3e\u6a21\u578b\u662f Llama \u7cfb\u5217\u7684\u6700\u65b0\u6210\u5458\uff0c\u65e8\u5728\u901a\u8fc7\u5176\u5e9e\u5927\u7684\u53c2\u6570\u89c4\u6a21\u548c\u5148\u8fdb\u7684\u7b97\u6cd5\uff0c\u63d0\u4f9b\u524d\u6240\u672a\u6709\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u80fd\u529b\u3002Llama3-70B \u80fd\u591f\u5904\u7406\u590d\u6742\u7684\u8bed\u8a00\u4efb\u52a1\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6587\u672c\u751f\u6210\u3001\u8bed\u8a00\u7ffb\u8bd1\u3001\u95ee\u7b54\u7cfb\u7edf\u548c\u60c5\u611f\u5206\u6790\u3002<\/p>\n<h2 id=\"-\">\u6a21\u578b\u8bc4\u6d4b<\/h2>\n<p>Llama3-70B \u6a21\u578b\u5728\u591a\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u4e0a\u8fdb\u884c\u4e86\u5e7f\u6cdb\u7684\u8bc4\u6d4b\u3002\u8bc4\u6d4b\u7ed3\u679c\u663e\u793a\uff0c\u8be5\u6a21\u578b\u5728\u7406\u89e3\u590d\u6742\u8bed\u5883\u3001\u751f\u6210\u8fde\u8d2f\u6587\u672c\u4ee5\u53ca\u5904\u7406\u591a\u8bed\u8a00\u6587\u672c\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002\u5176\u6307\u4ee4\u8c03\u6574\uff08instruction-tuned\uff09\u7248\u672c\u7279\u522b\u9002\u7528\u4e8e\u5bf9\u8bdd\u5e94\u7528\uff0c\u80fd\u591f\u6839\u636e\u7528\u6237\u7684\u6307\u4ee4\u751f\u6210\u76f8\u5173\u56de\u7b54\u3002\u6b64\u5916\uff0c\u6a21\u578b\u5728\u5904\u7406\u957f\u6587\u672c\u548c\u590d\u6742\u903b\u8f91\u5173\u7cfb\u65b9\u9762\u4e5f\u5c55\u73b0\u51fa\u4e86\u5353\u8d8a\u7684\u80fd\u529b\u3002<\/p>\n<h2 id=\"-\">\u90e8\u7f72\u4f7f\u7528<\/h2>\n<h4 id=\"-\">\u8be6\u7ec6\u6b65\u9aa4<\/h4>\n<ol>\n<li><strong>\u73af\u5883\u51c6\u5907<\/strong>\uff1a\n<ul>\n<li>\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u5b89\u88c5\u4e86 Python \u548c PyTorch\uff0c\u63a8\u8350\u4f7f\u7528 CUDA \u652f\u6301\u7684 GPU \u73af\u5883\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u514b\u9686\u5b58\u50a8\u5e93<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528 Git \u514b\u9686 Llama3 \u5b58\u50a8\u5e93\uff1a\n<pre><code class=\"lang-bash\"><span class=\"token function\">git<\/span> clone https:\/\/github.com\/meta-llama\/llama3.git\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd<\/strong>\uff1a\n<ul>\n<li>\u8bbf\u95ee Meta Llama \u7f51\u7ad9\u5e76\u6ce8\u518c\u4ee5\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\u3002\u6ce8\u518c\u540e\uff0c\u4f60\u5c06\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u6536\u5230\u4e00\u4e2a\u7b7e\u540d URL\u3002<\/li>\n<li>\u4f7f\u7528\u63d0\u4f9b\u7684 URL \u8fd0\u884c\u4e0b\u8f7d\u811a\u672c\uff1a\n<pre><code class=\"lang-bash\">.\/download.sh\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8fd0\u884c\u6a21\u578b<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u6a21\u578b\u8fdb\u884c\u63a8\u7406\uff1a\n<pre><code class=\"lang-bash\">torchrun --nproc_per_node 8 example_chat_completion.py \\\r\n    --ckpt_dir Meta-Llama-3-70B-Instruct\/ \\\r\n    --tokenizer_path Meta-Llama-3-70B-Instruct\/tokenizer.model \\\r\n    --max_seq_len 512 --max_batch_size 6\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8c03\u6574\u53c2\u6570<\/strong>\uff1a\n<ul>\n<li>\u6839\u636e\u4f60\u7684\u786c\u4ef6\u914d\u7f6e\u8c03\u6574\u00a0<code>max_seq_len<\/code>\u00a0\u548c\u00a0<code>max_batch_size<\/code>\u00a0\u53c2\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4 id=\"-mp-\">\u6a21\u578b\u5e76\u884c\uff08MP\uff09\u503c<\/h4>\n<ul>\n<li><strong>70B \u6a21\u578b<\/strong>\uff1aMP \u503c\u4e3a 8<\/li>\n<\/ul>\n<h2 id=\"-\">\u5e38\u89c1\u95ee\u9898<\/h2>\n<p><strong>Q: \u5982\u4f55\u4e0b\u8f7d Llama3-70B \u6a21\u578b\u6743\u91cd\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u9996\u5148\u8bbf\u95ee Meta Llama \u7f51\u7ad9\u5e76\u6ce8\u518c\uff0c\u6ce8\u518c\u540e\u4f60\u5c06\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u6536\u5230\u4e00\u4e2a\u7b7e\u540d URL\u3002\u4f7f\u7528\u6b64 URL \u8fd0\u884c\u4e0b\u8f7d\u811a\u672c\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u5982\u4f55\u5728\u672c\u5730\u8fd0\u884c Llama3-70B \u6a21\u578b\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u514b\u9686 Llama3 \u5b58\u50a8\u5e93\uff0c\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\uff0c\u7136\u540e\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u63d0\u4f9b\u7684\u793a\u4f8b\u811a\u672c\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u6a21\u578b\u652f\u6301\u7684\u6700\u5927\u5e8f\u5217\u957f\u5ea6\u662f\u591a\u5c11\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u6240\u6709\u6a21\u578b\u652f\u6301\u7684\u6700\u5927\u5e8f\u5217\u957f\u5ea6\u4e3a 8192 \u4e2a token\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u5982\u4f55\u5904\u7406\u6a21\u578b\u751f\u6210\u7684\u4e0d\u5b89\u5168\u5185\u5bb9\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u53ef\u4ee5\u90e8\u7f72\u989d\u5916\u7684\u5206\u7c7b\u5668\u6765\u8fc7\u6ee4\u8f93\u5165\u548c\u8f93\u51fa\uff0c\u786e\u4fdd\u5185\u5bb9\u7684\u5b89\u5168\u6027\u3002\u53c2\u8003 Llama \u98df\u8c31\u5b58\u50a8\u5e93\u4e2d\u7684\u793a\u4f8b\u3002<\/li>\n<\/ul>\n<p><strong>Q: \u6a21\u578b\u5e76\u884c\uff08MP\uff09\u503c\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<ul>\n<li>A: \u5bf9\u4e8e Llama3-70B \u6a21\u578b\uff0cMP \u503c\u4e3a 8\u3002\u8fd9\u610f\u5473\u7740\u5728\u8fd0\u884c\u6a21\u578b\u65f6\u9700\u8981\u8bbe\u7f6e\u00a0<code>--nproc_per_node 8<\/code>\u3002<\/li>\n<\/ul>\n<h2 id=\"-\">\u76f8\u5173\u8d44\u6e90<\/h2>\n<ul>\n<li><strong>GitHub \u5b58\u50a8\u5e93<\/strong>\uff1a<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/github.com\/meta-llama\/llama3\">Meta Llama 3<\/a><\/li>\n<li><strong>\u6a21\u578b\u4e0b\u8f7d\u9875\u9762<\/strong>\uff1a\u8bbf\u95ee Meta Llama \u7f51\u7ad9\u5e76\u6ce8\u518c\u4ee5\u83b7\u53d6\u4e0b\u8f7d\u94fe\u63a5\u3002<\/li>\n<li><strong>Hugging Face \u8bbf\u95ee<\/strong>\uff1a\u63d0\u4f9b\u5728 Hugging Face \u4e0a\u7684\u6a21\u578b\u4e0b\u8f7d\uff0c\u5305\u62ec transformers \u548c\u539f\u751f\u00a0<code>llama3<\/code>\u00a0\u683c\u5f0f\u3002<\/li>\n<li><strong>\u8d23\u4efb\u4f7f\u7528\u6307\u5357<\/strong>\uff1a\u5e2e\u52a9\u5f00\u53d1\u8005\u8d1f\u8d23\u4efb\u5730\u4f7f\u7528\u6a21\u578b\uff0c\u907f\u514d\u6f5c\u5728\u98ce\u9669\u3002<\/li>\n<li><strong>\u95ee\u9898\u62a5\u544a<\/strong>\uff1a\u901a\u8fc7 GitHub \u95ee\u9898\u8ddf\u8e2a\u5668\u6216\u4e13\u95e8\u7684\u53cd\u9988\u6e20\u9053\u62a5\u544a\u6a21\u578b\u95ee\u9898\u3001\u751f\u6210\u7684\u98ce\u9669\u5185\u5bb9\u6216\u5b89\u5168\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u8d44\u6e90\uff0c\u7528\u6237\u53ef\u4ee5\u6df1\u5165\u4e86\u89e3 Llama3-70B \u6a21\u578b\u7684\u529f\u80fd\u3001\u4e0b\u8f7d\u548c\u90e8\u7f72\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Llama3-70B\u662f Meta \u516c\u53f8\u63a8\u51fa\u7684\u4e00\u6b3e\u5177\u6709\u91cc\u7a0b\u7891\u610f\u4e49\u7684\u5927\u578b\u8bed\u8a00\u6a21\u578b\uff0c\u62e5\u6709\u9ad8\u8fbe70B\uff08\u53737000\u4ebf\uff09\u53c2\u6570\u3002\u8fd9\u6b3e\u6a21\u578b\u662f Llama \u7cfb\u5217\u7684\u6700\u65b0\u6210\u5458\uff0c\u65e8\u5728\u901a\u8fc7\u5176\u5e9e\u5927\u7684\u53c2\u6570\u89c4\u6a21\u548c\u5148\u8fdb\u7684\u7b97\u6cd5\uff0c\u63d0\u4f9b\u524d\u6240\u672a\u6709\u7684\u81ea\u7136\u8bed\u8a00\u5904\u7406\u80fd\u529b\u3002Llama3-70B \u80fd\u591f\u5904\u7406\u590d\u6742\u7684\u8bed\u8a00\u4efb\u52a1\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u6587\u672c\u751f\u6210\u3001\u8bed\u8a00\u7ffb\u8bd1\u3001\u95ee\u7b54\u7cfb\u7edf\u548c\u60c5\u611f\u5206\u6790\u3002 \u6a21\u578b\u8bc4\u6d4b Llama3-70B \u6a21\u578b\u5728\u591a\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u4efb\u52a1\u4e0a\u8fdb\u884c\u4e86\u5e7f\u6cdb\u7684\u8bc4\u6d4b\u3002\u8bc4\u6d4b\u7ed3\u679c\u663e\u793a\uff0c\u8be5\u6a21\u578b\u5728\u7406\u89e3\u590d\u6742\u8bed\u5883\u3001\u751f\u6210\u8fde\u8d2f\u6587\u672c\u4ee5\u53ca\u5904\u7406\u591a\u8bed\u8a00\u6587\u672c\u65b9\u9762\u8868\u73b0\u51fa\u8272\u3002\u5176\u6307\u4ee4\u8c03\u6574\uff08instruction-t<\/p>\n","protected":false},"author":1,"featured_media":118,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"collection":[50],"company":[38],"rank":[],"class_list":["post-117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-llm","collection-llama3","company-meta"],"_links":{"self":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":1,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/posts\/117\/revisions\/119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/media\/118"}],"wp:attachment":[{"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/tags?post=117"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/collection?post=117"},{"taxonomy":"company","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/company?post=117"},{"taxonomy":"rank","embeddable":true,"href":"https:\/\/www.onetts.com\/ai\/wp-json\/wp\/v2\/rank?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}