{"id":4486,"date":"2024-08-15T20:22:01","date_gmt":"2024-08-15T12:22:01","guid":{"rendered":"https:\/\/www.aqwu.net\/wp\/?p=4486"},"modified":"2024-08-15T20:22:23","modified_gmt":"2024-08-15T12:22:23","slug":"%e5%9c%a8%e4%b8%80%e5%bc%a0-24-gb-%e7%9a%84%e6%b6%88%e8%b4%b9%e7%ba%a7%e6%98%be%e5%8d%a1%e4%b8%8a%e7%94%a8-rlhf-%e5%be%ae%e8%b0%83-20b-llms","status":"publish","type":"post","link":"https:\/\/www.aqwu.net\/wp\/?p=4486","title":{"rendered":"\u5728\u4e00\u5f20 24 GB \u7684\u6d88\u8d39\u7ea7\u663e\u5361\u4e0a\u7528 RLHF \u5fae\u8c03 20B LLMs"},"content":{"rendered":"\n<p>\u6211\u4eec\u5f88\u9ad8\u5174\u6b63\u5f0f\u53d1\u5e03&nbsp;<code>trl<\/code>&nbsp;\u4e0e&nbsp;<code>peft<\/code>&nbsp;\u7684\u96c6\u6210\uff0c\u4f7f\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u66f4\u8f7b\u677e\u5730\u4f7f\u7528\u5f3a\u5316\u5b66\u4e60\u8fdb\u884c\u5927\u578b\u8bed\u8a00\u6a21\u578b (LLM) \u5fae\u8c03\uff01\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u89e3\u91ca\u4e86\u4e3a\u4ec0\u4e48\u8fd9\u662f\u73b0\u6709\u5fae\u8c03\u65b9\u6cd5\u7684\u6709\u7ade\u4e89\u529b\u7684\u66ff\u4ee3\u65b9\u6848\u3002<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c&nbsp;<code>peft<\/code>&nbsp;\u662f\u4e00\u79cd\u901a\u7528\u5de5\u5177\uff0c\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bb8\u591a ML \u7528\u4f8b\uff0c\u4f46\u5b83\u5bf9 RLHF \u7279\u522b\u6709\u8da3\uff0c\u56e0\u4e3a\u8fd9\u79cd\u65b9\u6cd5\u7279\u522b\u9700\u8981\u5185\u5b58\uff01<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u60f3\u76f4\u63a5\u6df1\u5165\u7814\u7a76\u4ee3\u7801\uff0c\u8bf7\u76f4\u63a5\u5728&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/trl\/main\/en\/sentiment_tuning_peft\">TRL \u7684\u6587\u6863\u9875\u9762<\/a>&nbsp;\u76f4\u63a5\u67e5\u770b\u793a\u4f8b\u811a\u672c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E4%BB%8B%E7%BB%8D\"><\/a>\u4ecb\u7ecd<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#llms--rlhf\"><\/a>LLMs &amp; RLHF<\/h3>\n\n\n\n<p>LLM \u7ed3\u5408 RLHF (\u4eba\u7c7b\u53cd\u9988\u5f3a\u5316\u5b66\u4e60) \u4f3c\u4e4e\u662f\u6784\u5efa\u975e\u5e38\u5f3a\u5927\u7684 AI \u7cfb\u7edf (\u4f8b\u5982 ChatGPT) \u7684\u4e0b\u4e00\u4e2a\u9996\u9009\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528 RLHF \u8bad\u7ec3\u8bed\u8a00\u6a21\u578b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u4e09\u4e2a\u6b65\u9aa4:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5728\u7279\u5b9a\u9886\u57df\u6216\u6307\u4ee4\u548c\u4eba\u7c7b\u793a\u8303\u8bed\u6599\u5e93\u4e0a\u5fae\u8c03\u9884\u8bad\u7ec3\u7684 LLM;<\/li>\n\n\n\n<li>\u6536\u96c6\u4eba\u7c7b\u6807\u6ce8\u7684\u6570\u636e\u96c6\uff0c\u8bad\u7ec3\u4e00\u4e2a\u5956\u52b1\u6a21\u578b;<\/li>\n\n\n\n<li>\u4f7f\u7528 RL (\u4f8b\u5982 PPO)\uff0c\u7528\u6b64\u6570\u636e\u96c6\u548c\u5956\u52b1\u6a21\u578b\u8fdb\u4e00\u6b65\u5fae\u8c03\u6b65\u9aa4 1 \u4e2d\u7684 LLM\u3002<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"632\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-1024x632.png\" alt=\"\" class=\"wp-image-4487\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-1024x632.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-300x185.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-768x474.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-1536x948.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-1320x814.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12-600x370.png 600w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-12.png 1854w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>ChatGPT \u7684\u8bad\u7ec3\u534f\u8bae\u6982\u8ff0\uff0c\u4ece\u6570\u636e\u6536\u96c6\u5230 RL \u90e8\u5206\u3002 \u8d44\u6599\u6765\u6e90:\u00a0<a href=\"https:\/\/openai.com\/blog\/chatgpt\" target=\"_blank\" rel=\"noreferrer noopener\">OpenAI \u7684 ChatGPT \u535a\u6587<\/a><\/strong><\/p>\n\n\n\n<p>\u57fa\u7840 LLM \u7684\u9009\u62e9\u5728\u8fd9\u91cc\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002\u5728\u64b0\u5199\u672c\u6587\u65f6\uff0c\u53ef\u4ee5\u201c\u5f00\u7bb1\u5373\u7528\u201d\u5730\u7528\u4e8e\u8bb8\u591a\u4efb\u52a1\u7684\u201c\u6700\u4f73\u201d\u5f00\u6e90 LLM \u662f\u6307\u4ee4\u5fae\u8c03 LLMs\u3002\u8457\u540d\u7684\u6a21\u578b\u6709:&nbsp;<a href=\"https:\/\/huggingface.co\/bigscience\/bloomz\">BLOOMZ<\/a>&nbsp;<a href=\"https:\/\/huggingface.co\/google\/flan-t5-xxl\">Flan-T5<\/a>\u3001<a href=\"https:\/\/huggingface.co\/google\/flan-ul2\">Flan-UL2<\/a>&nbsp;\u548c&nbsp;<a href=\"https:\/\/huggingface.co\/facebook\/opt-iml-max-30b\">OPT-IML<\/a>\u3002\u8fd9\u4e9b\u6a21\u578b\u7684\u7f3a\u70b9\u662f\u5b83\u4eec\u7684\u5c3a\u5bf8\u3002\u8981\u83b7\u5f97\u4e00\u4e2a\u50cf\u6837\u7684\u6a21\u578b\uff0c\u4f60\u81f3\u5c11\u9700\u8981\u73a9 10B+ \u7ea7\u522b\u7684\u6a21\u578b\uff0c\u5728\u5168\u7cbe\u5ea6\u60c5\u51b5\u4e0b\u8fd9\u5c06\u9700\u8981\u9ad8\u8fbe 40GB GPU \u5185\u5b58\uff0c\u53ea\u662f\u4e3a\u4e86\u5c06\u6a21\u578b\u88c5\u5728\u5355\u4e2a GPU \u8bbe\u5907\u4e0a\u800c\u4e0d\u8fdb\u884c\u4efb\u4f55\u8bad\u7ec3\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E4%BB%80%E4%B9%88%E6%98%AF-trl%EF%BC%9F\"><\/a>\u4ec0\u4e48\u662f TRL\uff1f<\/h3>\n\n\n\n<p><code>trl<\/code>&nbsp;\u5e93\u7684\u76ee\u7684\u662f\u4f7f RL \u7684\u6b65\u9aa4\u66f4\u5bb9\u6613\u548c\u7075\u6d3b\uff0c\u8ba9\u6bcf\u4e2a\u4eba\u53ef\u4ee5\u5728\u4ed6\u4eec\u81ea\u5df1\u7684\u6570\u636e\u96c6\u548c\u8bad\u7ec3\u8bbe\u7f6e\u4e0a\u7528 RL \u5fae\u8c03 LM\u3002\u5728\u8bb8\u591a\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u6b64\u7b97\u6cd5\u5fae\u8c03\u6a21\u578b\u4ee5\u751f\u6210&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/trl\/sentiment_tuning\">\u6b63\u9762\u7535\u5f71\u8bc4\u8bba<\/a>\u3001\u8fdb\u884c&nbsp;<a href=\"https:\/\/github.com\/lvwerra\/trl\/blob\/main\/examples\/sentiment\/notebooks\/gpt2-sentiment-control.ipynb\">\u53d7\u63a7\u751f\u6210<\/a>&nbsp;\u6216&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/trl\/detoxifying_a_lm\">\u964d\u4f4e\u6a21\u578b\u7684\u6bd2\u6027<\/a>\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>trl<\/code>&nbsp;\u4f60\u53ef\u4ee5\u5728\u5206\u5e03\u5f0f\u7ba1\u7406\u5668\u6216\u8005\u5355\u4e2a\u8bbe\u5907\u4e0a\u8fd0\u884c\u6700\u53d7\u6b22\u8fce\u7684\u6df1\u5ea6\u5f3a\u5316\u5b66\u4e60\u7b97\u6cd5\u4e4b\u4e00:&nbsp;<a href=\"https:\/\/huggingface.co\/deep-rl-course\/unit8\/introduction?fw=pt\">PPO<\/a>\u3002\u6211\u4eec\u5229\u7528 Hugging Face \u751f\u6001\u7cfb\u7edf\u4e2d\u7684&nbsp;<code>accelerate<\/code>&nbsp;\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u8fd9\u6837\u4efb\u4f55\u7528\u6237\u90fd\u53ef\u4ee5\u5c06\u5b9e\u9a8c\u6269\u5927\u5230\u4e00\u4e2a\u6709\u8da3\u7684\u89c4\u6a21\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528 RL \u5fae\u8c03\u8bed\u8a00\u6a21\u578b\u5927\u81f4\u9075\u5faa\u4e0b\u9762\u8be6\u8ff0\u7684\u534f\u8bae\u3002\u8fd9\u9700\u8981\u6709 2 \u4e2a\u539f\u59cb\u6a21\u578b\u7684\u526f\u672c; \u4e3a\u907f\u514d\u6d3b\u8dc3\u6a21\u578b\u4e0e\u5176\u539f\u59cb\u884c\u4e3a\/\u5206\u5e03\u504f\u79bb\u592a\u591a\uff0c\u4f60\u9700\u8981\u5728\u6bcf\u4e2a\u4f18\u5316\u6b65\u9aa4\u4e2d\u8ba1\u7b97\u53c2\u8003\u6a21\u578b\u7684 logits \u3002\u8fd9\u5bf9\u4f18\u5316\u8fc7\u7a0b\u589e\u52a0\u4e86\u786c\u7ea6\u675f\uff0c\u56e0\u4e3a\u4f60\u59cb\u7ec8\u9700\u8981\u6bcf\u4e2a GPU \u8bbe\u5907\u81f3\u5c11\u6709\u4e24\u4e2a\u6a21\u578b\u526f\u672c\u3002\u5982\u679c\u6a21\u578b\u7684\u5c3a\u5bf8\u53d8\u5927\uff0c\u5728\u5355\u4e2a GPU \u4e0a\u5b89\u88c5\u8bbe\u7f6e\u4f1a\u53d8\u5f97\u8d8a\u6765\u8d8a\u68d8\u624b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-1024x576.png\" alt=\"\" class=\"wp-image-4488\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-1024x576.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-300x169.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-768x432.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-1536x864.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-2048x1152.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-1320x743.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-13-600x338.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>TRL \u4e2d PPO \u8bad\u7ec3\u8bbe\u7f6e\u6982\u8ff0\u3002<\/strong><\/p>\n\n\n\n<p>\u5728&nbsp;<code>trl<\/code>&nbsp;\u4e2d\uff0c\u4f60\u8fd8\u53ef\u4ee5\u5728\u53c2\u8003\u6a21\u578b\u548c\u6d3b\u8dc3\u6a21\u578b\u4e4b\u95f4\u4f7f\u7528\u5171\u4eab\u5c42\u4ee5\u907f\u514d\u6574\u4e2a\u526f\u672c\u3002 \u6a21\u578b\u89e3\u6bd2\u793a\u4f8b\u4e2d\u5c55\u793a\u4e86\u6b64\u529f\u80fd\u7684\u5177\u4f53\u793a\u4f8b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E5%A4%A7%E8%A7%84%E6%A8%A1%E8%AE%AD%E7%BB%83\"><\/a>\u5927\u89c4\u6a21\u8bad\u7ec3<\/h3>\n\n\n\n<p>\u5927\u89c4\u6a21\u8bad\u7ec3\u662f\u5177\u6709\u6311\u6218\u6027\u7684\u3002\u7b2c\u4e00\u4e2a\u6311\u6218\u662f\u5728\u53ef\u7528\u7684 GPU \u8bbe\u5907\u4e0a\u62df\u5408\u6a21\u578b\uff0c\u53ca\u5176\u4f18\u5316\u5668\u72b6\u6001\u3002 \u5355\u4e2a\u53c2\u6570\u5360\u7528\u7684 GPU \u5185\u5b58\u91cf\u53d6\u51b3\u4e8e\u5176\u201c\u7cbe\u5ea6\u201d(\u6216\u66f4\u5177\u4f53\u5730\u8bf4\u662f&nbsp;<code>dtype<\/code>)\u3002 \u6700\u5e38\u89c1\u7684&nbsp;<code>dtype<\/code>&nbsp;\u662f&nbsp;<code>float32<\/code>&nbsp;(32 \u4f4d) \u3001&nbsp;<code>float16<\/code>&nbsp;\u548c&nbsp;<code>bfloat16<\/code>&nbsp;(16 \u4f4d)\u3002 \u6700\u8fd1\uff0c\u201c\u5947\u5f02\u7684\u201d\u7cbe\u5ea6\u652f\u6301\u5f00\u7bb1\u5373\u7528\u7684\u8bad\u7ec3\u548c\u63a8\u7406 (\u5177\u6709\u7279\u5b9a\u6761\u4ef6\u548c\u7ea6\u675f)\uff0c\u4f8b\u5982&nbsp;<code>int8<\/code>&nbsp;(8 \u4f4d)\u3002 \u7b80\u800c\u8a00\u4e4b\uff0c\u8981\u5728 GPU \u8bbe\u5907\u4e0a\u52a0\u8f7d\u4e00\u4e2a\u6a21\u578b\uff0c\u6bcf\u5341\u4ebf\u4e2a\u53c2\u6570\u5728 float32 \u7cbe\u5ea6\u4e0a\u9700\u8981 4GB\uff0c\u5728 float16 \u4e0a\u9700\u8981 2GB\uff0c\u5728 int8 \u4e0a\u9700\u8981 1GB\u3002 \u5982\u679c\u4f60\u60f3\u4e86\u89e3\u5173\u4e8e\u8fd9\u4e2a\u8bdd\u9898\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u67e5\u770b\u8fd9\u7bc7\u7814\u7a76\u6df1\u5165\u7684&nbsp;<a href=\"https:\/\/huggingface.co\/blog\/hf-bitsandbytes-integration%E3%80%82\">\u6587\u7ae0<\/a>\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u4f7f\u7528 AdamW \u4f18\u5316\u5668\uff0c\u6bcf\u4e2a\u53c2\u6570\u9700\u8981 8 \u4e2a\u5b57\u8282 (\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u7684\u6a21\u578b\u6709 1B \u4e2a\u53c2\u6570\uff0c\u5219\u6a21\u578b\u7684\u5b8c\u6574 AdamW \u4f18\u5316\u5668\u5c06\u9700\u8981 8GB GPU \u5185\u5b58&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/transformers\/v4.20.1\/en\/perf_train_gpu_one\">\u6765\u6e90<\/a>)\u3002<\/p>\n\n\n\n<p>\u8bb8\u591a\u6280\u672f\u5df2\u7ecf\u88ab\u91c7\u7528\u4ee5\u5e94\u5bf9\u5927\u89c4\u6a21\u8bad\u7ec3\u4e0a\u7684\u6311\u6218\u3002\u6700\u719f\u6089\u7684\u8303\u5f0f\u662f\u7ba1\u9053\u5e76\u884c\u3001\u5f20\u91cf\u5e76\u884c\u548c\u6570\u636e\u5e76\u884c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"421\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-1024x421.png\" alt=\"\" class=\"wp-image-4489\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-1024x421.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-300x123.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-768x316.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-1536x631.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-1320x543.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14-600x247.png 600w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-14.png 1946w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u56fe\u7247\u6765\u81ea\u00a0<a href=\"https:\/\/towardsdatascience.com\/distributed-parallel-training-data-parallelism-and-model-parallelism-ec2d234e3214\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fd9\u7bc7\u535a\u6587<\/a><\/strong><\/p>\n\n\n\n<p>\u901a\u8fc7\u6570\u636e\u5e76\u884c\u6027\uff0c\u540c\u4e00\u6a21\u578b\u5e76\u884c\u6258\u7ba1\u5728\u591a\u53f0\u673a\u5668\u4e0a\uff0c\u5e76\u4e14\u6bcf\u4e2a\u5b9e\u4f8b\u90fd\u88ab\u63d0\u4f9b\u4e0d\u540c\u7684\u6570\u636e\u6279\u6b21\u3002 \u8fd9\u662f\u6700\u76f4\u63a5\u7684\u5e76\u884c\u7b56\u7565\uff0c\u672c\u8d28\u4e0a\u662f\u590d\u5236\u5355 GPU \u7684\u60c5\u51b5\uff0c\u5e76\u4e14\u5df2\u7ecf\u88ab&nbsp;<code>trl<\/code>&nbsp;\u652f\u6301\u3002 \u4f7f\u7528\u7ba1\u9053\u5e76\u884c\u548c\u5f20\u91cf\u5e76\u884c\uff0c\u6a21\u578b\u672c\u8eab\u5206\u5e03\u5728\u673a\u5668\u4e0a: \u5728\u7ba1\u9053\u5e76\u884c\u4e2d\uff0c\u6a21\u578b\u6309\u5c42\u62c6\u5206\uff0c\u800c\u5f20\u91cf\u5e76\u884c\u5219\u8de8 GPU \u62c6\u5206\u5f20\u91cf\u64cd\u4f5c (\u4f8b\u5982\u77e9\u9635\u4e58\u6cd5)\u3002\u4f7f\u7528\u8fd9\u4e9b\u6a21\u578b\u5e76\u884c\u7b56\u7565\uff0c\u4f60\u9700\u8981\u5c06\u6a21\u578b\u6743\u91cd\u5206\u7247\u5230\u8bb8\u591a\u8bbe\u5907\u4e0a\uff0c\u8fd9\u9700\u8981\u4f60\u5b9a\u4e49\u8de8\u8fdb\u7a0b\u7684\u6fc0\u6d3b\u548c\u68af\u5ea6\u7684\u901a\u4fe1\u534f\u8bae\u3002 \u8fd9\u5b9e\u73b0\u8d77\u6765\u5e76\u4e0d\u7b80\u5355\uff0c\u53ef\u80fd\u9700\u8981\u91c7\u7528\u4e00\u4e9b\u6846\u67b6\uff0c\u4f8b\u5982&nbsp;<a href=\"https:\/\/github.com\/microsoft\/Megatron-DeepSpeed\"><code>Megatron-DeepSpeed<\/code><\/a>&nbsp;\u6216&nbsp;<a href=\"https:\/\/github.com\/NVIDIA\/NeMo\"><code>Nemo<\/code><\/a>\u3002\u5176\u4ed6\u5bf9\u6269\u5c55\u8bad\u7ec3\u81f3\u5173\u91cd\u8981\u7684\u5de5\u5177\u4e5f\u9700\u8981\u88ab\u5f3a\u8c03\uff0c\u4f8b\u5982\u81ea\u9002\u5e94\u6fc0\u6d3b\u68c0\u67e5\u70b9\u548c\u878d\u5408\u5185\u6838\u3002 \u53ef\u4ee5\u5728&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/transformers\/v4.17.0\/en\/parallelism\">\u6269\u5c55\u9605\u8bfb<\/a>&nbsp;\u627e\u5230\u6709\u5173\u5e76\u884c\u8303\u5f0f\u7684\u8fdb\u4e00\u6b65\u9605\u8bfb\u3002<\/p>\n\n\n\n<p>\u56e0\u6b64\uff0c\u6211\u4eec\u95ee\u81ea\u5df1\u4e0b\u9762\u4e00\u4e2a\u95ee\u9898: \u4ec5\u7528\u6570\u636e\u5e76\u884c\u6211\u4eec\u53ef\u4ee5\u8d70\u591a\u8fdc\uff1f\u6211\u4eec\u80fd\u5426\u4f7f\u7528\u73b0\u6709\u7684\u5de5\u5177\u5728\u5355\u4e2a\u8bbe\u5907\u4e2d\u9002\u5e94\u8d85\u5927\u578b\u8bad\u7ec3\u8fc7\u7a0b (\u5305\u62ec\u6d3b\u8dc3\u6a21\u578b\u3001\u53c2\u8003\u6a21\u578b\u548c\u4f18\u5316\u5668\u72b6\u6001)\uff1f \u7b54\u6848\u4f3c\u4e4e\u662f\u80af\u5b9a\u7684\u3002 \u4e3b\u8981\u56e0\u7d20\u662f: \u9002\u914d\u5668\u548c 8 \u4f4d\u77e9\u9635\u4e58\u6cd5\uff01 \u8ba9\u6211\u4eec\u5728\u4ee5\u4e0b\u90e8\u5206\u4e2d\u4ecb\u7ecd\u8fd9\u4e9b\u4e3b\u9898:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#8-%E4%BD%8D%E7%9F%A9%E9%98%B5%E4%B9%98%E6%B3%95\"><\/a>8 \u4f4d\u77e9\u9635\u4e58\u6cd5<\/h3>\n\n\n\n<p>\u9ad8\u6548\u7684 8 \u4f4d\u77e9\u9635\u4e58\u6cd5\u662f\u8bba\u6587 LLM.int8() \u4e2d\u9996\u6b21\u5f15\u5165\u7684\u4e00\u79cd\u65b9\u6cd5\uff0c\u65e8\u5728\u89e3\u51b3\u91cf\u5316\u5927\u89c4\u6a21\u6a21\u578b\u65f6\u7684\u6027\u80fd\u4e0b\u964d\u95ee\u9898\u3002 \u6240\u63d0\u51fa\u7684\u65b9\u6cd5\u5c06\u5728\u7ebf\u6027\u5c42\u4e2d\u5e94\u7528\u7684\u77e9\u9635\u4e58\u6cd5\u5206\u89e3\u4e3a\u4e24\u4e2a\u9636\u6bb5: \u5728 float16 \u4e2d\u5c06\u88ab\u6267\u884c\u7684\u5f02\u5e38\u503c\u9690\u85cf\u72b6\u6001\u90e8\u5206\u548c\u5728 int8 \u4e2d\u88ab\u6267\u884c\u7684\u201c\u975e\u5f02\u5e38\u503c\u201d\u90e8\u5206\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-1024x611.png\" alt=\"\" class=\"wp-image-4490\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-1024x611.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-300x179.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-768x458.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-1536x917.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-2048x1223.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-1320x788.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-15-600x358.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u9ad8\u6548\u7684 8 \u4f4d\u77e9\u9635\u4e58\u6cd5\u662f\u8bba\u6587\u00a0<a href=\"https:\/\/arxiv.org\/abs\/2208.07339\">LLM.int8()<\/a>\u00a0\u4e2d\u9996\u6b21\u5f15\u5165\u7684\u4e00\u79cd\u65b9\u6cd5\uff0c\u65e8\u5728\u89e3\u51b3\u91cf\u5316\u5927\u89c4\u6a21\u6a21\u578b\u65f6\u7684\u6027\u80fd\u4e0b\u964d\u95ee\u9898\u3002 \u6240\u63d0\u51fa\u7684\u65b9\u6cd5\u5c06\u5728\u7ebf\u6027\u5c42\u4e2d\u5e94\u7528\u7684\u77e9\u9635\u4e58\u6cd5\u5206\u89e3\u4e3a\u4e24\u4e2a\u9636\u6bb5: \u5728 float16 \u4e2d\u88ab\u6267\u884c\u7684\u5f02\u5e38\u503c\u9690\u85cf\u72b6\u6001\u90e8\u5206\u548c\u5728 int8 \u4e2d\u88ab\u6267\u884c\u7684\u201c\u975e\u5f02\u5e38\u503c\u201d\u90e8\u5206\u3002<\/strong><\/p>\n\n\n\n<p>\u7b80\u800c\u8a00\u4e4b\uff0c\u5982\u679c\u4f7f\u7528 8 \u4f4d\u77e9\u9635\u4e58\u6cd5\uff0c\u5219\u53ef\u4ee5\u5c06\u5168\u7cbe\u5ea6\u6a21\u578b\u7684\u5927\u5c0f\u51cf\u5c0f\u5230 4 \u5206\u4e4b\u4e00 (\u56e0\u6b64\uff0c\u5bf9\u4e8e\u534a\u7cbe\u5ea6\u6a21\u578b\uff0c\u53ef\u4ee5\u51cf\u5c0f 2 \u5206\u4e4b\u4e00)\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E4%BD%8E%E7%A7%A9%E9%80%82%E9%85%8D%E5%92%8C-peft\"><\/a>\u4f4e\u79e9\u9002\u914d\u548c PEFT<\/h3>\n\n\n\n<p>\u5728 2021 \u5e74\uff0c\u4e00\u7bc7\u53eb&nbsp;<strong>LoRA: Low-Rank Adaption of Large Language Models<\/strong>&nbsp;\u7684\u8bba\u6587\u8868\u660e\uff0c\u53ef\u4ee5\u901a\u8fc7\u51bb\u7ed3\u9884\u8bad\u7ec3\u6743\u91cd\uff0c\u5e76\u521b\u5efa\u67e5\u8be2\u548c\u503c\u5c42\u7684\u6ce8\u610f\u529b\u77e9\u9635\u7684\u4f4e\u79e9\u7248\u672c\u6765\u5bf9\u5927\u578b\u8bed\u8a00\u6a21\u578b\u8fdb\u884c\u5fae\u8c03\u3002\u8fd9\u4e9b\u4f4e\u79e9\u77e9\u9635\u7684\u53c2\u6570\u8fdc\u5c11\u4e8e\u539f\u59cb\u6a21\u578b\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u66f4\u5c11\u7684 GPU \u5185\u5b58\u8fdb\u884c\u5fae\u8c03\u3002 \u4f5c\u8005\u8bc1\u660e\uff0c\u4f4e\u9636\u9002\u914d\u5668\u7684\u5fae\u8c03\u53d6\u5f97\u4e86\u4e0e\u5fae\u8c03\u5b8c\u6574\u9884\u8bad\u7ec3\u6a21\u578b\u76f8\u5f53\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"439\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-16.png\" alt=\"\" class=\"wp-image-4491\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-16.png 600w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-16-300x220.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><strong>\u539f\u59cb (\u51bb\u7ed3\u7684) \u9884\u8bad\u7ec3\u6743\u91cd (\u5de6) \u7684\u8f93\u51fa\u6fc0\u6d3b\u7531\u4e00\u4e2a\u7531\u6743\u91cd\u77e9\u9635 A \u548c B \u7ec4\u6210\u7684\u4f4e\u79e9\u9002\u914d\u5668 (\u53f3) \u589e\u5f3a\u3002<\/strong><\/p>\n\n\n\n<p>\u8fd9\u79cd\u6280\u672f\u5141\u8bb8\u4f7f\u7528\u4e00\u5c0f\u90e8\u5206\u5185\u5b58\u6765\u5fae\u8c03 LLM\u3002 \u7136\u800c\uff0c\u4e5f\u6709\u4e00\u4e9b\u7f3a\u70b9\u3002\u7531\u4e8e\u9002\u914d\u5668\u5c42\u4e2d\u7684\u989d\u5916\u77e9\u9635\u4e58\u6cd5\uff0c\u524d\u5411\u548c\u53cd\u5411\u4f20\u9012\u7684\u901f\u5ea6\u5927\u7ea6\u662f\u539f\u6765\u7684\u4e24\u500d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E4%BB%80%E4%B9%88%E6%98%AF-peft%EF%BC%9F\"><\/a>\u4ec0\u4e48\u662f PEFT\uff1f<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/huggingface\/peft\">Parameter-Efficient Fine-Tuning (PEFT)<\/a>&nbsp;\u662f\u4e00\u4e2a Hugging Face \u7684\u5e93\uff0c\u5b83\u88ab\u521b\u9020\u51fa\u6765\u4ee5\u652f\u6301\u5728 LLM \u4e0a\u521b\u5efa\u548c\u5fae\u8c03\u9002\u914d\u5668\u5c42\u3002&nbsp;<code>peft<\/code>&nbsp;\u4e0e \ud83e\udd17 Accelerate \u65e0\u7f1d\u96c6\u6210\uff0c\u7528\u4e8e\u5229\u7528\u4e86 DeepSpeed \u548c Big Model Inference \u7684\u5927\u89c4\u6a21\u6a21\u578b\u3002<\/p>\n\n\n\n<p>\u6b64\u5e93\u652f\u6301\u5f88\u591a\u5148\u8fdb\u7684\u6a21\u578b\uff0c\u5e76\u4e14\u6709\u5927\u91cf\u7684\u4f8b\u5b50\uff0c\u5305\u62ec:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u56e0\u679c\u8bed\u8a00\u5efa\u6a21<\/li>\n\n\n\n<li>\u6761\u4ef6\u751f\u6210<\/li>\n\n\n\n<li>\u56fe\u50cf\u5206\u7c7b<\/li>\n\n\n\n<li>8 \u4f4d int8 \u8bad\u7ec3<\/li>\n\n\n\n<li>Dreambooth \u6a21\u578b\u7684\u4f4e\u79e9\u9002\u914d<\/li>\n\n\n\n<li>\u8bed\u4e49\u5206\u5272<\/li>\n\n\n\n<li>\u5e8f\u5217\u5206\u7c7b<\/li>\n\n\n\n<li>\u8bcd\u7b26\u5206\u7c7b<\/li>\n<\/ul>\n\n\n\n<p>\u8be5\u5e93\u4ecd\u5728\u5e7f\u6cdb\u548c\u79ef\u6781\u7684\u5f00\u53d1\u4e2d\uff0c\u8bb8\u591a\u5373\u5c06\u63a8\u51fa\u7684\u529f\u80fd\u5c06\u5728\u672a\u6765\u51e0\u4e2a\u6708\u5185\u516c\u5e03\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E4%BD%BF%E7%94%A8%E4%BD%8E%E8%B4%A8%E9%80%82%E9%85%8D%E5%99%A8%E5%BE%AE%E8%B0%83-20b-%E5%8F%82%E6%95%B0%E9%87%8F%E7%9A%84%E6%A8%A1%E5%9E%8B\"><\/a>\u4f7f\u7528\u4f4e\u8d28\u9002\u914d\u5668\u5fae\u8c03 20B \u53c2\u6570\u91cf\u7684\u6a21\u578b<\/h2>\n\n\n\n<p>\u73b0\u5728\u5148\u51b3\u6761\u4ef6\u5df2\u7ecf\u89e3\u51b3\uff0c\u8ba9\u6211\u4eec\u4e00\u6b65\u6b65\u8fc7\u4e00\u904d\u6574\u4e2a\u7ba1\u9053\uff0c\u5e76\u7528\u56fe\u8bf4\u660e\u5982\u4f55\u5728\u5355\u4e2a 24GB GPU \u4e0a\u4f7f\u7528\u4e0a\u8ff0\u5de5\u5177\u4f7f\u7528 RL \u5fae\u8c03 20B \u53c2\u6570\u91cf\u7684 LLM\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E7%AC%AC-1-%E6%AD%A5-%E5%9C%A8-8-%E4%BD%8D%E7%B2%BE%E5%BA%A6%E4%B8%8B%E5%8A%A0%E8%BD%BD%E4%BD%A0%E7%9A%84%E6%B4%BB%E8%B7%83%E6%A8%A1%E5%9E%8B\"><\/a>\u7b2c 1 \u6b65: \u5728 8 \u4f4d\u7cbe\u5ea6\u4e0b\u52a0\u8f7d\u4f60\u7684\u6d3b\u8dc3\u6a21\u578b<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"607\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-1024x607.png\" alt=\"\" class=\"wp-image-4492\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-1024x607.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-300x178.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-768x455.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-1536x910.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-2048x1214.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-1320x782.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-17-600x356.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u4e0e\u5168\u7cbe\u5ea6\u6a21\u578b\u76f8\u6bd4\uff0c\u4ee5 8 \u4f4d\u7cbe\u5ea6\u52a0\u8f7d\u6a21\u578b\u6700\u591a\u53ef\u8282\u7701 4 \u500d\u7684\u5185\u5b58<\/strong><\/p>\n\n\n\n<p>\u4f7f\u7528&nbsp;<code>transformers<\/code>&nbsp;\u51cf\u5c11 LLM \u5185\u5b58\u7684\u201c\u514d\u8d39\u5348\u9910\u201d\u662f\u4f7f\u7528 LLM.int8 \u4e2d\u63cf\u8ff0\u7684\u65b9\u6cd5\uff0c\u4ee5 8 \u4f4d\u7cbe\u5ea6\u52a0\u8f7d\u6a21\u578b\u3002 \u8fd9\u53ef\u4ee5\u901a\u8fc7\u5728\u8c03\u7528&nbsp;<code>from_pretrained<\/code>&nbsp;\u65b9\u6cd5\u65f6\u7b80\u5355\u5730\u6dfb\u52a0\u6807\u5fd7&nbsp;<code>load_in_8bit=True<\/code>&nbsp;\u6765\u6267\u884c (\u4f60\u53ef\u4ee5\u5728&nbsp;<a href=\"https:\/\/huggingface.co\/docs\/transformers\/main\/en\/main_classes\/quantization\">\u6587\u6863\u4e2d<\/a>&nbsp;\u9605\u8bfb\u66f4\u591a\u76f8\u5173\u4fe1\u606f)\u3002<\/p>\n\n\n\n<p>\u5982\u524d\u4e00\u8282\u6240\u8ff0\uff0c\u8ba1\u7b97\u52a0\u8f7d\u6a21\u578b\u6240\u9700\u7684 GPU \u5185\u5b58\u91cf\u7684\u201c\u6280\u5de7\u201d\u662f\u6839\u636e\u201c\u5341\u4ebf\u4e2a\u53c2\u6570\u91cf\u201d\u8fdb\u884c\u601d\u8003\u3002 \u7531\u4e8e\u4e00\u4e2a\u5b57\u8282\u9700\u8981 8 \u4f4d\uff0c\u56e0\u6b64\u5168\u7cbe\u5ea6\u6a21\u578b (32 \u4f4d = 4 \u5b57\u8282) \u6bcf\u5341\u4ebf\u4e2a\u53c2\u6570\u9700\u8981 4GB\uff0c\u534a\u7cbe\u5ea6\u6a21\u578b\u6bcf\u5341\u4ebf\u4e2a\u53c2\u6570\u9700\u8981 2GB\uff0cint8 \u6a21\u578b\u6bcf\u5341\u4ebf\u4e2a\u53c2\u6570\u9700\u8981 1GB\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u9996\u5148\uff0c\u6211\u4eec\u53ea\u52a0\u8f7d 8 \u4f4d\u7684\u6d3b\u8dc3\u6a21\u578b\u3002 \u8ba9\u6211\u4eec\u770b\u770b\u7b2c\u4e8c\u6b65\u9700\u8981\u505a\u4ec0\u4e48\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E7%AC%AC-2-%E6%AD%A5-%E4%BD%BF%E7%94%A8-peft-%E6%B7%BB%E5%8A%A0%E9%A2%9D%E5%A4%96%E5%8F%AF%E8%AE%AD%E7%BB%83%E7%9A%84%E9%80%82%E9%85%8D%E5%99%A8\"><\/a>\u7b2c 2 \u6b65: \u4f7f\u7528&nbsp;<code>peft<\/code>&nbsp;\u6dfb\u52a0\u989d\u5916\u53ef\u8bad\u7ec3\u7684\u9002\u914d\u5668<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-1024x538.png\" alt=\"\" class=\"wp-image-4493\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-1024x538.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-300x158.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-768x403.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-1536x806.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-1320x693.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18-600x315.png 600w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-18.png 1718w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u5728\u51bb\u7ed3\u7684 8 \u4f4d\u6a21\u578b\u4e0a\u6dfb\u52a0\u9002\u914d\u5668\uff0c\u4ece\u800c\u901a\u8fc7\u8bad\u7ec3\u4e00\u5c0f\u90e8\u5206\u53c2\u6570\u6765\u51cf\u5c11\u4f18\u5316\u5668\u72b6\u6001\u7684\u5185\u5b58\u9700\u6c42<\/strong><\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b65\u662f\u5728\u6a21\u578b\u4e2d\u52a0\u8f7d\u9002\u914d\u5668\u5e76\u4f7f\u8fd9\u4e9b\u9002\u914d\u5668\u53ef\u8bad\u7ec3\u3002 \u8fd9\u53ef\u4ee5\u5927\u5e45\u51cf\u5c11\u6d3b\u8dc3\u6a21\u578b\u6240\u9700\u7684\u53ef\u8bad\u7ec3\u6743\u91cd\u7684\u6570\u91cf\u3002 \u6b64\u6b65\u9aa4\u5229\u7528&nbsp;<code>peft<\/code>&nbsp;\u5e93\uff0c\u53ea\u9700\u51e0\u884c\u4ee3\u7801\u5373\u53ef\u6267\u884c\u3002 \u8bf7\u6ce8\u610f\uff0c\u4e00\u65e6\u9002\u914d\u5668\u7ecf\u8fc7\u8bad\u7ec3\uff0c\u60a8\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u5c06\u5b83\u4eec\u63a8\u9001\u5230 Hub \u4ee5\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E7%AC%AC-3-%E6%AD%A5-%E4%BD%BF%E7%94%A8%E5%90%8C%E6%A0%B7%E7%9A%84%E6%A8%A1%E5%9E%8B%E5%BE%97%E5%88%B0%E5%8F%82%E8%80%83%E5%92%8C%E6%B4%BB%E8%B7%83-logits\"><\/a>\u7b2c 3 \u6b65: \u4f7f\u7528\u540c\u6837\u7684\u6a21\u578b\u5f97\u5230\u53c2\u8003\u548c\u6d3b\u8dc3 logits<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-1024x504.png\" alt=\"\" class=\"wp-image-4494\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-1024x504.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-300x148.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-768x378.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-1536x757.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-2048x1009.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-1320x650.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-19-600x296.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u4f7f\u7528\u00a0<code>peft<\/code>\u00a0\u5173\u95ed\u548c\u4f7f\u80fd\u9002\u914d\u5668\u3002<\/strong><\/p>\n\n\n\n<p>\u7531\u4e8e\u9002\u914d\u5668\u53ef\u4ee5\u505c\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7684\u6a21\u578b\u6765\u83b7\u53d6 PPO \u7684\u53c2\u8003\u548c\u6d3b\u8dc3\u7684 logits \u503c\uff0c\u800c\u65e0\u9700\u521b\u5efa\u4e24\u4e2a\u76f8\u540c\u7684\u6a21\u578b\u526f\u672c\uff01 \u8fd9\u5229\u7528\u4e86&nbsp;<code>peft<\/code>&nbsp;\u5e93\u4e2d\u7684\u4e00\u4e2a\u529f\u80fd\uff0c\u5373&nbsp;<code>disable_adapters<\/code>&nbsp;\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E8%AE%AD%E7%BB%83%E8%84%9A%E6%9C%AC%E6%A6%82%E8%BF%B0\"><\/a>\u8bad\u7ec3\u811a\u672c\u6982\u8ff0<\/h3>\n\n\n\n<p>\u6211\u4eec\u73b0\u5728\u5c06\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528&nbsp;<code>transformers<\/code>&nbsp;\u3001&nbsp;<code>peft<\/code>&nbsp;\u548c&nbsp;<code>trl<\/code>&nbsp;\u8bad\u7ec3 20B \u53c2\u6570\u91cf\u7684&nbsp;<a href=\"https:\/\/huggingface.co\/EleutherAI\/gpt-neox-20b\">gpt-neox \u6a21\u578b<\/a>\u3002 \u8fd9\u4e2a\u4f8b\u5b50\u7684\u6700\u7ec8\u76ee\u6807\u662f\u5fae\u8c03 LLM \u4ee5\u5728\u5185\u5b58\u53d7\u9650\u7684\u8bbe\u7f6e\u4e2d\u751f\u6210\u79ef\u6781\u7684\u7535\u5f71\u8bc4\u8bba\u3002\u7c7b\u4f3c\u7684\u6b65\u9aa4\u53ef\u4ee5\u5e94\u7528\u4e8e\u5176\u4ed6\u4efb\u52a1\uff0c\u4f8b\u5982\u5bf9\u8bdd\u6a21\u578b\u3002<\/p>\n\n\n\n<p>\u6574\u4f53\u6765\u770b\u6709\u4e09\u4e2a\u5173\u952e\u6b65\u9aa4\u548c\u8bad\u7ec3\u811a\u672c:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/github.com\/lvwerra\/trl\/blob\/main\/examples\/sentiment\/scripts\/gpt-neox-20b_peft\/clm_finetune_peft_imdb.py\">\u811a\u672c 1<\/a><\/strong>\u00a0&#8211; \u5728\u51bb\u7ed3\u7684 8 \u4f4d\u6a21\u578b\u4e0a\u5fae\u8c03\u4f4e\u79e9\u9002\u914d\u5668\uff0c\u4ee5\u4fbf\u5728 imdb \u6570\u636e\u96c6\u4e0a\u751f\u6210\u6587\u672c\u3002<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/github.com\/lvwerra\/trl\/blob\/main\/examples\/sentiment\/scripts\/gpt-neox-20b_peft\/merge_peft_adapter.py\">\u811a\u672c 2<\/a><\/strong>\u00a0&#8211; \u5c06\u9002\u914d\u5668\u5c42\u5408\u5e76\u5230\u57fa\u7840\u6a21\u578b\u7684\u6743\u91cd\u4e2d\u5e76\u5c06\u5b83\u4eec\u5b58\u50a8\u5728 Hub \u4e0a\u3002<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/github.com\/lvwerra\/trl\/blob\/main\/examples\/sentiment\/scripts\/gpt-neox-20b_peft\/gpt-neo-20b_sentiment_peft.py\">\u811a\u672c 3<\/a><\/strong>\u00a0&#8211; \u5bf9\u4f4e\u7b49\u7ea7\u9002\u914d\u5668\u8fdb\u884c\u60c5\u611f\u5fae\u8c03\u4ee5\u521b\u5efa\u6b63\u9762\u8bc4\u4ef7\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u6211\u4eec\u5728 24GB NVIDIA 4090 GPU \u4e0a\u6d4b\u8bd5\u4e86\u8fd9\u4e9b\u6b65\u9aa4\u3002\u867d\u7136\u53ef\u4ee5\u5728 24 GB GPU \u4e0a\u6267\u884c\u6574\u4e2a\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u4f46\u5728 \ud83e\udd17 \u7814\u7a76\u96c6\u7fa4\u4e0a\u7684\u5355\u4e2a A100 \u4e0a\u65e0\u6cd5\u8fdb\u884c\u5b8c\u6574\u7684\u8bad\u7ec3\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<p>\u8bad\u7ec3\u8fc7\u7a0b\u7684\u7b2c\u4e00\u6b65\u662f\u5bf9\u9884\u8bad\u7ec3\u6a21\u578b\u8fdb\u884c\u5fae\u8c03\u3002 \u901a\u5e38\u8fd9\u9700\u8981\u51e0\u4e2a\u9ad8\u7aef\u7684 80GB A100 GPU\uff0c\u56e0\u6b64\u6211\u4eec\u9009\u62e9\u8bad\u7ec3\u4f4e\u9636\u9002\u914d\u5668\u3002 \u6211\u4eec\u5c06\u5176\u89c6\u4e3a\u4e00\u79cd\u56e0\u679c\u8bed\u8a00\u5efa\u6a21\u8bbe\u7f6e\uff0c\u5e76\u9488\u4ece&nbsp;<a href=\"https:\/\/huggingface.co\/datasets\/imdb\">imdb<\/a>&nbsp;\u6570\u636e\u96c6\u4e2d\u8bad\u7ec3\u4e86\u4e00\u4e2a epoch \u7684\u793a\u4f8b\uff0c\u8be5\u6570\u636e\u96c6\u5177\u6709\u7535\u5f71\u8bc4\u8bba\u548c\u6307\u660e\u79ef\u6781\u8fd8\u662f\u6d88\u6781\u60c5\u7eea\u7684\u6807\u7b7e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"463\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-1024x463.png\" alt=\"\" class=\"wp-image-4495\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-1024x463.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-300x136.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-768x347.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-1536x695.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-2048x926.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-1320x597.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-20-600x271.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>\u5728 imdb \u6570\u636e\u96c6\u4e0a\u8bad\u7ec3 gpt-neox-20b \u6a21\u578b\u4e00\u4e2a epoch \u671f\u95f4\u7684\u8bad\u7ec3\u635f\u5931<\/strong><\/p>\n\n\n\n<p>\u4e3a\u4e86\u5229\u7528\u5df2\u7ecf\u9002\u914d\u4e86\u7684\u6a21\u578b\u5e76\u4f7f\u7528 RL \u6267\u884c\u8fdb\u4e00\u6b65\u5fae\u8c03\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u7ec4\u5408\u81ea\u9002\u5e94\u6743\u91cd\uff0c\u8fd9\u662f\u901a\u8fc7\u52a0\u8f7d\u9884\u8bad\u7ec3\u6a21\u578b\u548c 16 \u4f4d\u6d6e\u70b9\u7cbe\u5ea6\u7684\u9002\u914d\u5668\u5e76\u4e14\u52a0\u548c\u6743\u91cd\u77e9\u9635 (\u5e94\u7528\u9002\u5f53\u7684\u7f29\u653e\u6bd4\u4f8b) \u6765\u5b9e\u73b0\u7684\u3002<\/p>\n\n\n\n<p>\u6700\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u51bb\u7ed3\u7684\u3001\u7528 imdb \u5fae\u8c03\u8fc7\u7684\u6a21\u578b\u4e4b\u4e0a\u5fae\u8c03\u53e6\u4e00\u4e2a\u4f4e\u79e9\u9002\u914d\u5668\u3002\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a imdb&nbsp;<a href=\"https:\/\/huggingface.co\/lvwerra\/distilbert-imdb\">\u60c5\u611f\u5206\u7c7b\u5668<\/a>&nbsp;\u6765\u4e3a RL \u7b97\u6cd5\u63d0\u4f9b\u5956\u52b1\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"463\" src=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-1024x463.png\" alt=\"\" class=\"wp-image-4496\" srcset=\"https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-1024x463.png 1024w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-300x136.png 300w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-768x347.png 768w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-1536x694.png 1536w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-2048x926.png 2048w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-1320x597.png 1320w, https:\/\/www.aqwu.net\/wp\/wp-content\/uploads\/2024\/08\/\u56fe\u7247-21-600x271.png 600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>RL \u5fae\u8c03 peft \u9002\u914d\u8fc7\u7684 20B \u53c2\u6570\u91cf\u7684\u6a21\u578b\u4ee5\u751f\u6210\u79ef\u6781\u5f71\u8bc4\u65f6\u7684\u5956\u52b1\u5747\u503c\u3002<\/strong><\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u60f3\u67e5\u770b\u66f4\u591a\u56fe\u8868\u548c\u6587\u672c\u751f\u6210\uff0c\u53ef\u5728&nbsp;<a href=\"https:\/\/wandb.ai\/edbeeching\/trl\/runs\/l8e7uwm6?workspace=user-edbeeching\">\u94fe\u63a5\u5904<\/a>&nbsp;\u83b7\u53d6\u6b64\u5b9e\u9a8c\u7684\u5b8c\u6574\u6743\u91cd\u548c\u504f\u5dee\u62a5\u544a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E7%BB%93%E8%AE%BA\"><\/a>\u7ed3\u8bba<\/h2>\n\n\n\n<p>\u6211\u4eec\u5728&nbsp;<code>trl<\/code>&nbsp;\u4e2d\u5b9e\u73b0\u4e86\u4e00\u9879\u65b0\u529f\u80fd\uff0c\u5141\u8bb8\u7528\u6237\u5229\u7528&nbsp;<code>peft<\/code>&nbsp;\u548c&nbsp;<code>bitsandbytes<\/code>&nbsp;\u5e93\u4ee5\u5408\u7406\u7684\u6210\u672c\u4f7f\u7528 RLHF \u5fae\u8c03\u5927\u578b\u8bed\u8a00\u6a21\u578b\u3002 \u6211\u4eec\u8bc1\u660e\u4e86\u53ef\u4ee5\u5728 24GB \u6d88\u8d39\u7ea7 GPU \u4e0a\u5fae\u8c03&nbsp;<code>gpt-neo-x<\/code>&nbsp;(\u4ee5&nbsp;<code>bfloat16<\/code>&nbsp;\u7cbe\u5ea6\u9700\u8981 40GB\uff01)\uff0c\u6211\u4eec\u671f\u671b\u793e\u533a\u5c06\u5e7f\u6cdb\u4f7f\u7528\u6b64\u96c6\u6210\u6765\u5fae\u8c03\u5229\u7528\u4e86 RLHF \u7684\u5927\u578b\u6a21\u578b\uff0c\u5e76\u5206\u4eab\u51fa\u8272\u7684\u5de5\u4ef6\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5df2\u7ecf\u4e3a\u63a5\u4e0b\u6765\u7684\u6b65\u9aa4\u786e\u5b9a\u4e86\u4e00\u4e9b\u6709\u8da3\u7684\u65b9\u5411\uff0c\u4ee5\u6311\u6218\u8fd9\u79cd\u96c6\u6210\u7684\u6781\u9650:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8fd9\u5c06\u5982\u4f55\u5728\u591a GPU \u8bbe\u7f6e\u4e2d\u6269\u5c55\uff1f<\/strong>\u00a0\u6211\u4eec\u5c06\u4e3b\u8981\u63a2\u7d22\u8fd9\u79cd\u96c6\u6210\u5c06\u5982\u4f55\u6839\u636e GPU \u7684\u6570\u91cf\u8fdb\u884c\u6269\u5c55\uff0c\u662f\u5426\u53ef\u4ee5\u5f00\u7bb1\u5373\u7528\u5730\u5e94\u7528\u6570\u636e\u5e76\u884c\uff0c\u6216\u8005\u662f\u5426\u9700\u8981\u5728\u4efb\u4f55\u76f8\u5173\u5e93\u4e0a\u91c7\u7528\u4e00\u4e9b\u65b0\u529f\u80fd\u3002<\/li>\n\n\n\n<li><strong>\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u54ea\u4e9b\u5de5\u5177\u6765\u63d0\u9ad8\u8bad\u7ec3\u901f\u5ea6\uff1f<\/strong>\u00a0\u6211\u4eec\u89c2\u5bdf\u5230\u8fd9\u79cd\u96c6\u6210\u7684\u4e3b\u8981\u7f3a\u70b9\u662f\u6574\u4f53\u8bad\u7ec3\u901f\u5ea6\u3002 \u5728\u672a\u6765\uff0c\u6211\u4eec\u5c06\u6301\u7eed\u63a2\u7d22\u4f7f\u8bad\u7ec3\u66f4\u5feb\u7684\u53ef\u80fd\u65b9\u5411\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft#%E5%8F%82%E8%80%83\"><\/a>\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5e76\u884c\u8303\u5f0f:\u00a0<a href=\"https:\/\/hf.co\/docs\/transformers\/v4.17.0\/en\/parallelism\">https:\/\/hf.co\/docs\/transformers\/v4.17.0\/en\/parallelism<\/a><\/li>\n\n\n\n<li><code>transformers<\/code>\u00a0\u4e2d\u7684 8 \u4f4d\u96c6\u6210:\u00a0<a href=\"https:\/\/hf.co\/blog\/hf-bitsandbytes-integration\">https:\/\/hf.co\/blog\/hf-bitsandbytes-integration<\/a><\/li>\n\n\n\n<li>LLM.int8 \u8bba\u6587:\u00a0<a href=\"https:\/\/arxiv.org\/abs\/2208.07339\">https:\/\/arxiv.org\/abs\/2208.07339<\/a><\/li>\n\n\n\n<li>\u68af\u5ea6\u68c0\u67e5\u70b9\u89e3\u91ca:\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/model-parallel-extended-features-pytorch-activation-checkpointing.html\">https:\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/model-parallel-extended-features-pytorch-activation-checkpointing.html<\/a><\/li>\n<\/ul>\n\n\n\n<p>\u6765\u81ea\u6211\u4eec\u535a\u5ba2\u7684\u66f4\u591a\u6587\u7ae0<\/p>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/huggingface.co\/blog\/zh\/trl-peft\">\u5728\u4e00\u5f20 24 GB \u7684\u6d88\u8d39\u7ea7\u663e\u5361\u4e0a\u7528 RLHF \u5fae\u8c03 20B LLMs (huggingface.co)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u5f88\u9ad8\u5174\u6b63\u5f0f\u53d1\u5e03&nbsp;trl&nbsp;\u4e0e&nbsp;peft&nbsp;\u7684\u96c6\u6210\uff0c\u4f7f\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u66f4\u8f7b\u677e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[43],"tags":[],"class_list":["post-4486","post","type-post","status-publish","format-standard","hentry","category-infoarticle"],"views":675,"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4486"}],"version-history":[{"count":2,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4486\/revisions"}],"predecessor-version":[{"id":4498,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/4486\/revisions\/4498"}],"wp:attachment":[{"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aqwu.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}