{"id":2748,"date":"2026-03-06T16:13:46","date_gmt":"2026-03-06T08:13:46","guid":{"rendered":"https:\/\/www.starverse-ai.com\/guide\/archives\/2748"},"modified":"2026-03-06T16:13:46","modified_gmt":"2026-03-06T08:13:46","slug":"%e5%a4%a7%e6%a8%a1%e5%9e%8b%e5%be%ae%e8%b0%83%e5%99%a9%e6%a2%a6%ef%bc%9f%e6%98%9f%e5%ae%87%e6%99%ba%e7%ae%97%e3%80%8c%e6%b5%b7%e9%87%8f%e6%95%b0%e6%8d%ae%e9%9b%86lora-%e4%b8%80%e9%94%ae%e9%95%9c","status":"publish","type":"post","link":"https:\/\/www.starverse-ai.com\/guide\/archives\/2748","title":{"rendered":"\u5927\u6a21\u578b\u5fae\u8c03\u5669\u68a6\uff1f\u661f\u5b87\u667a\u7b97\u300c\u6d77\u91cf\u6570\u636e\u96c6+LoRA \u4e00\u952e\u955c\u50cf\u300d\u628a 7B \u6a21\u578b\u5fae\u8c03\u538b\u5230 30 \u5206\u949f"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/03\/1772784825_9380a2.png\" alt=\"\u5927\u6a21\u578b\u5fae\u8c03\u5669\u68a6\uff1f\u661f\u5b87\u667a\u7b97\u300c\u6d77\u91cf\u6570\u636e\u96c6+LoRA \u4e00\u952e\u955c\u50cf\u300d\u628a 7B \u6a21\u578b\u5fae\u8c03\u538b\u5230 30 \u5206\u949f\" style=\"display:block; margin:10px auto; max-width:100%; height:auto;\" \/><\/figure>\n<blockquote>\n<p>\u80cc\u666f\uff1a6 \u6708 6 \u65e5\uff0c\u901a\u4e49\u5343\u95ee Qwen2.5-7B \u5f00\u6e90\uff0c\u6027\u80fd\u76f4\u63a5\u5bf9\u6807 Llama3-70B\uff0c\u5f00\u53d1\u8005\u5708\u77ac\u95f4\u6cb8\u817e\u3002\u53ef\u5174\u594b\u4e0d\u8fc7\u4e09\u79d2\uff0c\u201c\u5fae\u8c03\u201d\u8fd9\u5ea7\u5927\u5c71\u5c31\u6a2a\u5728\u773c\u524d\u2014\u2014\u6570\u636e\u6e05\u6d17\u3001\u73af\u5883\u642d\u5efa\u3001\u9a71\u52a8\u5bf9\u9f50\u3001\u4f9d\u8d56\u7f16\u8bd1\uff0c\u5168\u6d41\u7a0b\u8dd1\u901a\u81f3\u5c11\u4e24\u5929\uff0c\u8c03\u53c2\u518d\u4e24\u5929\uff0c\u4e00\u5f20 A100 \u7684\u79df\u91d1\u5df2\u7ecf\u70e7\u6389\u56db\u4f4d\u6570\u3002\u5927\u6a21\u578b\u843d\u5730\uff0c\u7b2c\u4e00\u6b65\u5c31\u88ab\u201c\u65f6\u95f4+\u91d1\u94b1\u201d\u53cc\u91cd\u529d\u9000\u3002<\/p>\n<\/blockquote>\n<h2>\u4e00\u3001\u5f00\u6e90\u72c2\u6b22\u80cc\u540e\uff0c7B \u6a21\u578b\u5fae\u8c03\u7684\u9690\u5f62\u95e8\u69db<\/h2>\n<p>Qwen2.5-7B \u7684\u6743\u91cd\u53ea\u6709 15 GB\uff0c\u770b\u4f3c\u4eb2\u6c11\uff0c\u5374\u6697\u85cf\u6740\u673a\uff1a<\/p>\n<ul>\n<li>\u4e2d\u6587\u8bed\u6599\u566a\u58f0\u5927\uff0c\u53bb\u91cd\u3001\u5206\u8bcd\u3001\u957f\u5ea6\u8fc7\u6ee4\u3001\u654f\u611f\u6e05\u6d17\uff0c\u811a\u672c\u5199\u5b8c 6 \u5c0f\u65f6\u8d77\u6b65\uff1b<\/li>\n<li>CUDA\u3001PyTorch\u3001transformers\u3001peft\u3001deepspeed \u7248\u672c\u53ea\u8981\u9519\u4e00\u4f4d\uff0c\u8bad\u7ec3\u76f4\u63a5\u5d29\u6e83\uff1b<\/li>\n<li>LoRA \u867d\u7136\u7701\u663e\u5b58\uff0c\u4f46\u5b66\u4e60\u7387\u3001rank\u3001alpha\u3001target_modules \u7ec4\u5408\u7206\u70b8\uff0c\u672c\u5730 4090 24 G \u53cd\u590d OOM\u3002<\/li>\n<\/ul>\n<p>\u7ed3\u679c\u5c31\u662f\uff1aGPU \u670d\u52a1\u5668\u79df\u7528 8 \u5361 A100 \u6392\u961f 4 \u5c0f\u65f6\uff0c\u771f\u6b63\u8bad\u7ec3 10 \u5206\u949f\uff0c\u8c03\u8bd5 2 \u5929\uff0c\u9884\u7b97\u8d85 3000 \u5143\u3002\u5927\u6a21\u578b\u201c\u5e73\u6c11\u5316\u201d\u53e3\u53f7\u558a\u5f97\u54cd\uff0c\u843d\u5730\u5374\u4ecd\u662f\u201c\u571f\u8c6a\u6e38\u620f\u201d\u3002<\/p>\n<h2>\u4e8c\u3001\u661f\u5b87\u667a\u7b97\u300c\u4e00\u952e LoRA \u955c\u50cf\u300d\uff1a\u628a 48 \u5c0f\u65f6\u538b\u8fdb 30 \u5206\u949f<\/h2>\n<p>\u661f\u5b87\u667a\u7b97\u56e2\u961f\u628a\u5f00\u53d1\u8005\u6700\u75db\u7684\u73af\u8282\u5168\u90e8\u6253\u5305\u6210\u201c\u767d\u5ad6\u7ea7\u201d\u65b9\u6848\uff1a<\/p>\n<ol>\n<li>\n<p>\u5e02\u573a\u5185\u7f6e 50+ \u4e2d\u6587\u6e05\u6d17\u6570\u636e\u96c6<br \/>\n   \u4ece Common Crawl \u4e2d\u6587\u3001\u767e\u79d1\u3001\u95ee\u7b54\u3001\u91d1\u878d\u3001\u533b\u7597\u5230\u4ee3\u7801\uff0c\u5168\u90e8\u6309 2 TB \u89c4\u6a21\u53bb\u91cd\u3001\u8131\u654f\u3001token \u957f\u5ea6 2048 \u5bf9\u9f50\uff0c\u76f4\u63a5 <code>cp<\/code> \u5230\u5b9e\u4f8b\u5373\u53ef\u7528\uff0c\u7701\u53bb\u4e0b\u8f7d+\u6e05\u6d17 36 \u5c0f\u65f6\u3002<\/p>\n<\/li>\n<li>\n<p>LoRA \u955c\u50cf\u4e00\u952e\u542f\u52a8<br \/>\n   \u955c\u50cf\u5df2\u9884\u88c5 CUDA 12.1\u3001PyTorch 2.2\u3001transformers 4.40\u3001peft 0.11\u3001deepspeed 0.14\uff0c\u8bad\u7ec3\u811a\u672c\u3001monitor\u3001tensorboard \u5168\u90e8\u5c31\u4f4d\uff1b\u5f00\u673a 3 \u5206\u949f\uff0c\u76f4\u63a5 <code>bash train.sh<\/code> \u5f00\u8dd1\u3002<\/p>\n<\/li>\n<li>\n<p>\u5355\u5361 A100 30 \u5206\u949f loss \u964d\u5230 1.02<br \/>\n   \u5b9e\u6d4b Qwen2.5-7B\uff0c\u6570\u636e\u96c6 200 M token\uff0cmax_seq_len=2048\uff0clr=2e-4\uff0crank=64\uff0calpha=128\uff0c\u5355\u5361 A100 40 G \u663e\u5b58\u5360\u7528 38 G\uff0c30 \u5206\u949f 1200 step\uff0closs \u7a33\u5b9a 1.02\uff0cC-eval \u63d0\u5347 8.7%\uff0c\u6210\u672c\u4e0d\u5230 15 \u5143\u3002<\/p>\n<\/li>\n<li>\n<p>\u7075\u6d3b\u8ba1\u8d39\uff0c\u65e0 GPU \u6a21\u5f0f\u5148\u90e8\u7f72<br \/>\n   \u6015\u73af\u5883\u88c5\u4e00\u534a\u5173\u673a\u6d6a\u8d39\uff1f\u661f\u5b87\u667a\u7b97\u652f\u6301\u201c<a href=\"https:\/\/www.starverse-ai.com\/node\/019b88a8-066a-785b-93c1-b3f4a34eb309\">\u65e0 GPU \u542f\u52a8<\/a>\u201d\uff0c0.2 \u5143\/\u5c0f\u65f6\u5148\u628a\u4f9d\u8d56\u3001\u6570\u636e\u3001\u811a\u672c\u5bf9\u9f50\uff0c\u771f\u6b63\u8bad\u7ec3\u524d\u518d\u201c\u5e26\u5361\u542f\u52a8\u201d\uff0c<strong>GPU \u4e91\u4e3b\u673a<\/strong>\u6309\u79d2\u8ba1\u8d39\uff0c\u60f3\u505c\u5c31\u505c\uff0c\u9884\u7b97\u53ef\u63a7\u3002<\/p>\n<\/li>\n<\/ol>\n<h2>\u4e09\u3001\u5f00\u7bb1\u5b9e\u5f55\uff1a\u4ece 0 \u5230 7B \u6a21\u578b\u5fae\u8c03\uff0c\u53ea\u8981 4 \u6b65<\/h2>\n<p>\u6b65\u9aa4 1\uff1a\u6ce8\u518c\u9001 10 \u5143\u4f53\u9a8c\u91d1<br \/>\n\u6253\u5f00 <a href=\"https:\/\/www.starverse-ai.com\">AI\u5e94\u7528<\/a> \u5b98\u7f51\uff0c\u624b\u673a\u53f7\u6ce8\u518c\uff0c10 \u5143\u4f53\u9a8c\u91d1\u79d2\u5230\uff0c\u53ef\u62b5 50 A100-GPU \u5206\u949f\u3002<\/p>\n<p>\u6b65\u9aa4 2\uff1a\u521b\u5efa\u5b9e\u4f8b<br \/>\n\u63a7\u5236\u53f0\u70b9\u51fb\u201c<a href=\"https:\/\/www.starverse-ai.com\/node\/019b88a7-b591-7b4e-b2a4-a840bd73fa50\">\u521b\u5efa\u5b9e\u4f8b<\/a>\u201d\uff0c\u9009\u62e9\u201cAI \u5e94\u7528\u2014Qwen2.5-7B LoRA \u5fae\u8c03\u201d\uff0c\u955c\u50cf\u5927\u5c0f 35 GB\uff0c\u81ea\u52a8\u6302\u8f7d 50 G \u7cfb\u7edf\u76d8+200 G \u4e91\u786c\u76d8\uff0c\u70b9\u51fb\u786e\u8ba4\uff0c30 \u79d2\u5f00\u673a\u3002<\/p>\n<p>\u6b65\u9aa4 3\uff1a\u62f7\u8d1d\u6570\u636e\u96c6<br \/>\n\u5b9e\u4f8b\u5185\u6267\u884c  <\/p>\n<pre><code>cp -r \/public\/dataset\/chinese_finance_2048 .\/data\n<\/code><\/pre>\n<p>3 \u5206\u949f\u5b8c\u6210 42 G \u6570\u636e\u62f7\u8d1d\uff0c\u65e0\u9700\u5916\u7f51\u4e0b\u8f7d\uff0c\u6d41\u91cf 0 \u8d39\u7528\u3002<\/p>\n<p>\u6b65\u9aa4 4\uff1a\u542f\u52a8\u8bad\u7ec3  <\/p>\n<pre><code>bash train_lora.sh --data_path .\/data --model_id qwen2.5-7b --rank 64 --alpha 128\n<\/code><\/pre>\n<p>\u56de\u8f66\uff0ctensorboard \u7aef\u53e3\u81ea\u52a8\u6620\u5c04\uff0c\u6d4f\u89c8\u5668\u6253\u5f00 <code>https:\/\/\u5b9e\u4f8bIP:6006<\/code> \u5b9e\u65f6\u770b loss\u300230 \u5206\u949f\u540e\uff0ccheckpoint \u81ea\u52a8\u4fdd\u5b58\u5230 <code>\/workspace\/output<\/code>\uff0c\u53ef\u76f4\u63a5 push \u5230 Hugging Face\u3002<\/p>\n<h2>\u56db\u3001\u4e0d\u6b62\u662f\u8bad\u7ec3\uff0c\u661f\u5b87\u667a\u7b97\u628a\u540e\u7eed\u5de5\u4f5c\u4e5f\u7701\u4e86<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.starverse-ai.com\/node\/019b88aa-2fc4-790b-97e1-fdff4da0e8a6\">\u4e91\u786c\u76d8<\/a> \u652f\u6301\u8de8\u5b9e\u4f8b\u6302\u8f7d\uff1a\u8bad\u7ec3\u5b8c\u628a\u76d8\u6302\u5230 4090 \u63a8\u7406\u5b9e\u4f8b\uff0c\u65e0\u9700\u91cd\u590d\u4e0a\u4f20\uff1b<\/li>\n<li><a href=\"https:\/\/www.starverse-ai.com\/node\/019b88ac-0730-7451-a8ab-9c3c873fef42\">\u4e91\u5b58\u50a8<\/a> \u63d0\u4f9b 10 Gbps \u516c\u7f51\u4e0b\u884c\uff1a\u6a21\u578b\u5bfc\u51fa\u540e\u4e00\u952e\u5206\u4eab\u4e0b\u8f7d\u94fe\u63a5\uff0c\u5ba2\u6237\/\u6295\u8d44\u4eba\u968f\u65f6\u62c9\u53d6\uff1b<\/li>\n<li><a href=\"https:\/\/www.starverse-ai.com\/node\/019b88ac-286a-70a3-bafa-cfa47c851b4d\">\u6a21\u578b\u548c\u6570\u636e\u96c6<\/a> \u516c\u5171\u5e93\u6301\u7eed\u66f4\u65b0\uff1aBaichuan2-13B\u3001Yi-34B\u3001GLM-4-9B\u3001Llama3-70B \u5df2\u4e0a\u7ebf\uff0c\u8c03\u7528\u5373\u8d70\uff1b<\/li>\n<li>\u7075\u6d3b\u8ba1\u8d39\uff1a\u6309\u91cf\u3001\u5305\u5929\u3001\u5305\u5468\u3001\u5305\u6708\u56db\u79cd\u6a21\u5f0f\uff0cA100 \u6700\u4f4e 1.98 \u5143\/\u5361\/\u65f6\uff0c\u6bd4\u81ea\u5efa\u673a\u623f\u8282\u7701 68% \u6210\u672c\u3002<\/li>\n<\/ul>\n<h2>\u4e94\u3001\u5199\u5728\u6700\u540e<\/h2>\n<p>\u5927\u6a21\u578b\u65f6\u4ee3\uff0c\u62fc\u7684\u4e0d\u518d\u662f\u201c\u6709\u6ca1\u6709\u5361\u201d\uff0c\u800c\u662f\u201c\u8c01\u80fd\u6700\u5feb\u628a\u5361\u7528\u5230\u5200\u5203\u4e0a\u201d\u3002\u661f\u5b87\u667a\u7b97\u7528\u4e00\u5957\u201c\u6d77\u91cf\u6570\u636e\u96c6+LoRA \u4e00\u952e\u955c\u50cf\u201d\uff0c\u628a Qwen2.5-7B \u5fae\u8c03\u4ece 48 \u5c0f\u65f6\u538b\u7f29\u5230 30 \u5206\u949f\uff0c\u6210\u672c\u538b\u5230\u4e00\u676f\u5976\u8336\u7684\u94b1\u3002\u5bf9\u9ad8\u6821\u5b9e\u9a8c\u5ba4\uff0c\u8fd9\u610f\u5473\u7740\u8bba\u6587\u5b9e\u9a8c\u5468\u671f\u4ece\u6708\u53d8\u6210\u5929\uff1b\u5bf9\u521d\u521b\u516c\u53f8\uff0c\u8fd9\u610f\u5473\u7740 Demo \u53ef\u4ee5\u63d0\u524d\u4e24\u5468\u4ea4\u4ed8\uff1b\u5bf9\u5927\u578b\u79d1\u6280\u516c\u53f8\uff0c\u8fd9\u610f\u5473\u7740\u53ef\u4ee5\u628a\u5b9d\u8d35\u7684\u4eba\u624d\u4ece\u91cd\u590d\u52b3\u52a8\u4e2d\u89e3\u653e\uff0c\u4e13\u6ce8\u7b97\u6cd5\u521b\u65b0\u3002<\/p>\n<p>\u5982\u679c\u4f60\u4e5f\u88ab\u201c\u73af\u5883\u642d\u5efa+\u6570\u636e\u6e05\u6d17\u201d\u6298\u78e8\u5230\u6000\u7591\u4eba\u751f\uff0c\u4e0d\u59a8\u82b1 1 \u5206\u949f\u6ce8\u518c\u661f\u5b87\u667a\u7b97\uff0c10 \u5143\u4f53\u9a8c\u91d1\u76f4\u63a5\u62b5\u7528 A100\uff0c<strong>GPU\u670d\u52a1\u5668\u79df\u7528<\/strong>\u4ece\u672a\u5982\u6b64\u4e1d\u6ed1\u3002\u5927\u6a21\u578b\u5fae\u8c03\u5669\u68a6\uff1f\u4ece\u4eca\u5929\u8d77\uff0c\u5b83\u53ea\u662f\u4e00\u4e2a\u201c30 \u5206\u949f\u201d\u7684\u5c0f\u61a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f\uff1a6 \u6708 6 \u65e5\uff0c\u901a\u4e49\u5343\u95ee Qwen2.5-7B \u5f00\u6e90\uff0c&hellip;<\/p>\n","protected":false},"author":2,"featured_media":2747,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2748","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zixun"],"views":54,"_links":{"self":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/2748","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=2748"}],"version-history":[{"count":0,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/2748\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media\/2747"}],"wp:attachment":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media?parent=2748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/categories?post=2748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/tags?post=2748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}