{"id":2896,"date":"2026-03-08T14:15:26","date_gmt":"2026-03-08T06:15:26","guid":{"rendered":"https:\/\/www.starverse-ai.com\/guide\/archives\/2896"},"modified":"2026-03-08T14:15:26","modified_gmt":"2026-03-08T06:15:26","slug":"%e6%98%be%e5%8d%a1%e8%a1%8c%e6%83%85%e5%90%83%e7%b4%a7%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e5%81%9a%e3%80%8c%e5%b0%8f%e6%a0%b7%e6%9c%ac%e5%ad%a6%e4%b9%a0%e3%80%8d%e5%8f%8d%e8%80%8c%e6%9b%b4%e8%a6%81","status":"publish","type":"post","link":"https:\/\/www.starverse-ai.com\/guide\/archives\/2896","title":{"rendered":"\u663e\u5361\u884c\u60c5\u5403\u7d27\uff0c\u4e3a\u4ec0\u4e48\u505a\u300c\u5c0f\u6837\u672c\u5b66\u4e60\u300d\u53cd\u800c\u66f4\u8981\u79df\u5927\u5361\uff1f\u661f\u5b87\u667a\u7b97GPU\u79df\u8d41\u4eb2\u6d4b"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/03\/1772950525_84055e.png\" alt=\"\u663e\u5361\u884c\u60c5\u5403\u7d27\uff0c\u4e3a\u4ec0\u4e48\u505a\u300c\u5c0f\u6837\u672c\u5b66\u4e60\u300d\u53cd\u800c\u66f4\u8981\u79df\u5927\u5361\uff1f\u661f\u5b87\u667a\u7b97GPU\u79df\u8d41\u4eb2\u6d4b\" style=\"display:block; margin:10px auto; max-width:100%; height:auto;\" \/><\/figure>\n<blockquote>\n<p>\u663e\u5361\u884c\u60c5\u5403\u7d27\uff0c\u4e3a\u4ec0\u4e48\u505a\u300c\u5c0f\u6837\u672c\u5b66\u4e60\u300d\u53cd\u800c\u66f4\u8981\u79df\u5927\u5361\uff1f\u661f\u5b87\u667a\u7b97GPU\u79df\u8d41\u4eb2\u6d4b<br \/>\n\u4f5c\u8005\uff1a\u67d0\u9ad8\u6821NLP\u5b9e\u9a8c\u5ba4 \u9648\u535a\u58eb<\/p>\n<\/blockquote>\n<h2>\u884c\u60c5\uff1a\u4e00\u5f20A100 80G\u2248\u4e24\u53f0Mac Pro\uff0c\u79d1\u7814\u9884\u7b97\u539f\u5730\u84b8\u53d1<\/h2>\n<p>\u201cRTX 4090\u73b0\u8d27\u52a0\u4ef740%\u201d\u201cA100 80G\u6e20\u9053\u4ef7\u78348\u4e07\u201d\u2014\u2014\u8fc7\u53bb\u534a\u5e74\uff0c\u663e\u5361\u6ea2\u4ef7\u4ecePC\u5708\u70e7\u5230AI\u5708\u3002\u9ad8\u6821\u8bfe\u9898\u7ec4\u539f\u672c\u8ba1\u5212\u81ea\u8d2d\u4e24\u53f0<a href=\"https:\/\/www.starverse-ai.com\">GPU\u670d\u52a1\u5668\u79df\u7528<\/a>\u8bbe\u5907\uff0c\u7ed3\u679c\u62db\u6807\u4ef7\u4e00\u8def\u98d9\u5347\uff0c\u9884\u7b97\u53ea\u591f\u4e70\u534a\u5f20\u5361\u3002\u66f4\u5c34\u5c2c\u7684\u662f\uff0c<strong>\u5c0f\u6837\u672c\u5b66\u4e60\uff08Few-shot Learning\uff09<\/strong>\u770b\u4f3c\u201c\u6570\u636e\u5c11\u3001\u8bad\u7ec3\u8f7b\u201d\uff0c\u5b9e\u5219\u5bf9\u663e\u5b58\u5bb9\u91cf\u63d0\u51fa\u66f4\u9ad8\u8981\u6c42\uff1a<br \/>\n&#8211; \u5927\u53c2\u6570\u6a21\u578b\u505a\u4e0b\u6e38\u5fae\u8c03\uff0c\u9700\u5b8c\u6574\u52a0\u8f7d7B\u300113B\u751a\u81f333B\u53c2\u6570\uff1b<br \/>\n&#8211; LoRA\u3001AdaLoRA\u7b49\u53c2\u6570\u9ad8\u6548\u65b9\u6cd5\u867d\u51cf\u5c11\u8bad\u7ec3\u6743\u91cd\uff0c\u4f46Adam32\u4f4d\u4e3b\u72b6\u6001\u3001DeepSpeed Zero-3\u5206\u7247\u7f13\u5b58\u4f9d\u65e7\u628a\u663e\u5b58\u5403\u5f97\u5e72\u5e72\u51c0\u51c0\uff1b<br \/>\n&#8211; \u4e3a\u4e86\u5bf9\u6297\u8fc7\u62df\u5408\uff0c\u8fd8\u8981\u540c\u65f6\u4fdd\u7559\u539f\u59cbcheckpoint\u3001EMA\u6743\u91cd\u3001\u68af\u5ea6\u5907\u4efd\u2014\u2014<strong>\u201c\u5c0f\u6837\u672c\u201d\u53cd\u800c\u6210\u4e86\u201c\u5927\u663e\u5b58\u6740\u624b\u201d<\/strong>\u3002<\/p>\n<p>\u81ea\u8d2d\u9ad8\u7aef\u5361\u65e2\u8d35\u53c8\u7f3a\u8d27\uff0c\u79d1\u7814\u8282\u594f\u5374\u62d6\u4e0d\u8d77\u3002\u4e8e\u662f\u6211\u4eec\u628a\u76ee\u5149\u6295\u5411<a href=\"https:\/\/www.starverse-ai.com\">GPU\u4e91\u4e3b\u673a<\/a>\u3002<\/p>\n<h2>\u903b\u8f91\uff1a\u5c0f\u6837\u672c+\u5927\u53c2\u6570=\u663e\u5b58\u9ed1\u6d1e\uff0c\u521a\u9700A100 80G<\/h2>\n<p>\u57287B\u6a21\u578b\u4e0a\u505a5-shot\u5fae\u8c03\uff0c\u7406\u8bba\u6700\u4f4e\u663e\u5b58\u2248\u6a21\u578b\u53c2\u6570\u91cf\u00d72\uff08fp16\uff09+\u4f18\u5316\u5668\u72b6\u6001\u00d74\uff08fp32\uff09+\u6fc0\u6d3b\u5cf0\u503c\u00d70.8\u224848GB\u3002\u82e5\u518d\u7528DeepSpeed Zero-3\u628a\u4f18\u5316\u5668\u72b6\u6001\u5207\u7247\u5230\u591a\u5361\uff0c\u5355\u5361\u4e5f\u9700\u81f3\u5c1124GB\u5269\u4f59\u7a7a\u95f4\u5b58\u653e\u6fc0\u6d3b\u4e0e\u4e34\u65f6\u7f13\u5b58\u3002\u5e02\u9762\u4e0a24GB\u663e\u5b58\u7684RTX 3090\/4090\u770b\u4f3c\u591f\u7528\uff0c\u5b9e\u5219\u4e00\u8dd1batch size=2\u5c31OOM\u3002\u552f\u6709A100 80G\u80fd\u5728\u5355\u5361\u5185\u7559\u8db3\u5197\u4f59\uff0c<strong>\u4fdd\u8bc1\u5b9e\u9a8c\u53ef\u590d\u73b0\u3001\u8c03\u53c2\u4e0d\u7ffb\u8f66<\/strong>\u3002<\/p>\n<h2>\u5b9e\u9a8c\uff1a\u661f\u5b87\u667a\u7b97A100 80G\u4e09\u5c0f\u65f6\u590d\u73b07B\u6a21\u578bLoRA\u5fae\u8c03<\/h2>\n<p>\u6211\u4eec\u9009\u62e9\u5728<a href=\"https:\/\/www.starverse-ai.com\">\u661f\u5b87\u667a\u7b97<\/a>\u5e73\u53f0\u5b9e\u6d4b\uff1a<br \/>\n&#8211; \u5b9e\u4f8b\u89c4\u683c\uff1aA100-SXM4-80G\uff0cPCIe 4.0\u00d716\uff0cNVLink\u6ee1\u8840\u7248<br \/>\n&#8211; \u8f6f\u4ef6\u955c\u50cf\uff1apytorch2.1+CUDA12.1+DeepSpeed 0.12\uff0c\u5185\u7f6e\u6a21\u578b\u5e93\u76f4\u63a5\u62c9\u53d6Llama2-7B-hf<br \/>\n&#8211; \u6570\u636e\uff1a\u81ea\u5efa5-shot\u60c5\u611f\u5206\u7c7b\u6570\u636e\u96c6\uff0c\u4ec5685\u6761\u6837\u672c<br \/>\n&#8211; \u65b9\u6848\uff1aLoRA rank=16\uff0calpha=32\uff0ctarget\u6a21\u5757q_proj+v_proj\uff0cDeepSpeed Zero-3+CPU Offload<br \/>\n&#8211; \u811a\u672c\uff1a\u5355\u5361\u542f\u52a8\uff0cglobal batch size=8\uff0cmax length=512\uff0cepoch=6\uff0c\u5b66\u4e60\u73871e-4\uff0cwarmup 5%<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u4e00\u884c\u641e\u5b9a\uff1a<\/p>\n<pre><code class=\"language-bash\">deepspeed --num_gpus=1 train_lora.py \\\n          --model_name_or_path \/model\/Llama-2-7B-hf \\\n          --dataset_path \/data\/cloud_storage\/fewshot685 \\\n          --output_dir \/data\/cloud_storage\/lora_out \\\n          --deepspeed ds_zero3_cpu.json\n<\/code><\/pre>\n<p>\u5b9e\u6d4b\u65e5\u5fd7\uff1a<br \/>\n&#8211; \u663e\u5b58\u5360\u7528\u5cf0\u503c74.3GB\uff0c\u672a\u89e6\u53d1OOM\uff1b<br \/>\n&#8211; \u8bad\u7ec3\u603b\u6b65\u6570258\uff0c\u8017\u65f62h51min\uff1b<br \/>\n&#8211; \u751f\u6210checkpoint\u5927\u5c0f\u4ec551MB\uff08LoRA\u6743\u91cd\uff09\uff0c\u4e0b\u8f7d\u5230\u672c\u5730\u76f4\u63a5\u52a0\u8f7d\u63a8\u7406\uff1b<br \/>\n&#8211; \u6700\u7ec8F1=0.927\uff0c\u76f8\u6bd40-shot\u63d0\u534727.4%\uff0c\u5b9e\u9a8c\u76ee\u6807\u8fbe\u6210\u3002<\/p>\n<h2>\u6210\u672c\uff1a16\u5143\u8dd1\u5b8c\u4e00\u7bc7\u8bba\u6587\u7684\u6838\u5fc3\u5b9e\u9a8c<\/h2>\n<p>\u661f\u5b87\u667a\u7b97\u91c7\u7528\u6309\u91cf\u8ba1\u8d39\uff0cA100 80G\u5355\u4ef75.8\u5143\/\u5c0f\u65f6\u3002\u672c\u6b21\u8bad\u7ec32h51min\uff0c\u53e0\u52a0\u6570\u636e\u9884\u5904\u7406\u3001\u53ef\u89c6\u5316\u51713\u5c0f\u65f6\uff0c\u603b\u8d39\u7528<strong>16.2\u5143<\/strong>\u3002\u6ce8\u518c\u65b0\u7528\u6237\u5373\u900110\u5143\u4f53\u9a8c\u91d1\uff0c<strong>\u5b9e\u4ed86.2\u5143<\/strong>\u5b8c\u6210\u4e00\u6b217B\u7ea7\u5927\u6a21\u578b\u5fae\u8c03\uff0c\u5bf9\u6bd4\u81ea\u8d2d\u786c\u4ef6\u52a8\u8f84\u6570\u4e07\u5143\uff0c<strong>GPU\u670d\u52a1\u5668\u79df\u7528<\/strong>\u6a21\u5f0f\u628a\u8bd5\u9519\u6210\u672c\u538b\u5230\u6781\u9650\u3002\u82e5\u5b9e\u9a8c\u7ed3\u675f\u5373\u65f6\u91ca\u653e\u5b9e\u4f8b\uff0c<strong>\u4e0d\u518d\u4ea7\u751f\u4efb\u4f55\u95f2\u7f6e\u7535\u8d39\u4e0e\u6298\u65e7<\/strong>\u3002<\/p>\n<h2>\u7ed3\u8bba\uff1a\u79d1\u7814\u5feb\u901f\u9a8c\u8bc1\uff0c\u65e0\u9700\u88ab\u9ad8\u4ef7\u663e\u5361\u201c\u5957\u7262\u201d<\/h2>\n<ol>\n<li>\u5c0f\u6837\u672c\u5b66\u4e60\u2260\u5c0f\u7b97\u529b\uff0c\u53cd\u5411\u4f9d\u8d56\u5927\u663e\u5b58\uff0cA100 80G\u662f\u521a\u9700\uff1b  <\/li>\n<li>\u6ea2\u4ef7\u884c\u60c5\u4e0b\uff0c\u81ea\u8d2d\u786c\u4ef6ROI\u5df2\u88ab\u62c9\u957f\u81f33\u5e74\u4ee5\u4e0a\uff0c<strong>GPU\u4e91\u4e3b\u673a<\/strong>\u6210\u4e3a\u66f4\u7075\u6d3b\u7684\u9009\u62e9\uff1b  <\/li>\n<li>\u661f\u5b87\u667a\u7b97\u63d0\u4f9b\u7684\u955c\u50cf\u3001\u6570\u636e\u96c6\u3001\u6301\u4e45\u5316\u4e91\u5b58\u50a8\u8ba9\u73af\u5883\u642d\u5efa\u4ece\u6570\u5c0f\u65f6\u7f29\u77ed\u52305\u5206\u949f\uff0c<strong>AI\u5e94\u7528<\/strong>\u4e0a\u7ebf\u901f\u5ea6\u63d0\u534710\u500d\uff1b  <\/li>\n<li>\u6309\u91cf\u8ba1\u8d39+\u4f53\u9a8c\u91d1\uff0c\u771f\u6b63\u505a\u5230\u201c\u7528\u591a\u5c11\u4ed8\u591a\u5c11\u201d\uff0c\u79d1\u7814\u9884\u7b97\u53ef\u9884\u6d4b\u3001\u53ef\u590d\u73b0\u3002<\/li>\n<\/ol>\n<p>\u5982\u679c\u4f60\u4e5f\u5728\u88ab\u663e\u5361\u7f3a\u8d27\u3001\u9884\u7b97\u4e0d\u8db3\u56f0\u6270\uff0c\u4e0d\u59a8<a href=\"https:\/\/www.starverse-ai.com\">\u6ce8\u518c\u661f\u5b87\u667a\u7b97<\/a>\uff0c\u9886\u53d610\u5143\u4f53\u9a8c\u91d1\uff0c<strong>16\u5143\u5373\u53ef\u8dd1\u5b8c\u4e00\u6b217B\u5927\u6a21\u578b\u5c0f\u6837\u672c\u5b9e\u9a8c<\/strong>\u3002\u628a\u6602\u8d35\u7684A100\u7559\u7ed9\u4e91\u7aef\uff0c\u628a\u5b9d\u8d35\u7684\u79d1\u7814\u65f6\u95f4\u7559\u7ed9\u81ea\u5df1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u663e\u5361\u884c\u60c5\u5403\u7d27\uff0c\u4e3a\u4ec0\u4e48\u505a\u300c\u5c0f\u6837\u672c\u5b66\u4e60\u300d\u53cd\u800c\u66f4\u8981\u79df\u5927\u5361\uff1f\u661f\u5b87\u667a\u7b97&hellip;<\/p>\n","protected":false},"author":2,"featured_media":2895,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2896","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zixun"],"views":46,"_links":{"self":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/2896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/comments?post=2896"}],"version-history":[{"count":0,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/2896\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media\/2895"}],"wp:attachment":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media?parent=2896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/categories?post=2896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/tags?post=2896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}