{"id":76,"date":"2024-09-18T10:24:33","date_gmt":"2024-09-18T02:24:33","guid":{"rendered":"https:\/\/ai.oaido.com\/?p=76"},"modified":"2024-09-18T11:34:00","modified_gmt":"2024-09-18T03:34:00","slug":"pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86","status":"publish","type":"post","link":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/","title":{"rendered":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6"},"content":{"rendered":"\n<p><strong>\u5982\u4f55\u4f7f\u7528\u4e09\u884c\u4ee3\u7801\u5c06\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6\u63d0\u9ad8 2 \u500d<\/strong><\/p>\n\n\n\n<p id=\"36c5\">\u60a8\u662f\u5426\u66fe\u5e0c\u671b\u60a8\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u80fd\u591f\u8fd0\u884c\u5f97\u66f4\u5feb\uff1f<\/p>\n\n\n\n<p id=\"8ca7\">GPU \u4ef7\u683c\u6602\u8d35\u3002\u6570\u636e\u96c6\u975e\u5e38\u5e9e\u5927\uff0c\u8bad\u7ec3\u8fc7\u7a0b\u4f3c\u4e4e\u6c38\u65e0\u6b62\u5883\uff1b\u60a8\u9700\u8981\u8fdb\u884c\u4e00\u767e\u4e07\u6b21\u5b9e\u9a8c\uff0c\u5e76\u4e14\u6709\u4e00\u4e2a\u6700\u540e\u671f\u9650\u8981\u6ee1\u8db3 \u2014\u2014 \u6240\u6709\u8fd9\u4e9b\u90fd\u662f\u671f\u5f85\u7279\u5b9a\u5f62\u5f0f\u7684\u8bad\u7ec3\u52a0\u901f\u7684\u5145\u5206\u7406\u7531\u3002<\/p>\n\n\n\n<p id=\"5d78\">\u4f46\u662f\u8be5\u9009\u62e9\u54ea\u4e00\u4e2a\u5462\uff1f<\/p>\n\n\n\n<p id=\"0fd7\"><a href=\"https:\/\/pytorch.org\/tutorials\/recipes\/recipes\/tuning_guide.html\" rel=\"noreferrer noopener\" target=\"_blank\">PyTorch<\/a>\u3001<a href=\"https:\/\/huggingface.co\/docs\/transformers\/v4.15.0\/performance\" rel=\"noreferrer noopener\" target=\"_blank\">HuggingFace<\/a>\u548c<a href=\"https:\/\/docs.nvidia.com\/deeplearning\/performance\/index.html\" rel=\"noreferrer noopener\" target=\"_blank\">Nvidia<\/a>\u5df2\u7ecf\u5728\u6a21\u578b\u8bad\u7ec3\u7684\u6027\u80fd\u8c03\u6574\u65b9\u9762\u63d0\u4f9b\u4e86\u5f88\u597d\u7684\u53c2\u8003\uff0c\u5305\u62ec\u5f02\u6b65\u6570\u636e\u52a0\u8f7d\u3001\u7f13\u51b2\u533a\u68c0\u67e5\u70b9\u3001\u5206\u5e03\u5f0f\u6570\u636e\u5e76\u884c\u5316\u548c<strong>\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6<\/strong>\u3002<\/p>\n\n\n\n<p id=\"0610\">\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u4ecb\u7ecd\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u6280\u672f\u3002\u6211\u5c06\u9996\u5148\u7b80\u8981\u4ecb\u7ecd Nvidia \u7684\u5f20\u91cf\u6838\u5fc3\u8bbe\u8ba1\uff0c\u7136\u540e\u4ecb\u7ecd\u5728 ICLR 2018 \u4e0a\u53d1\u8868\u7684\u5f00\u521b\u6027\u5de5\u4f5c\u201c\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u201d\u8bba\u6587\uff0c\u6700\u540e\u4ecb\u7ecd\u5728 FashionMNIST \u4e0a\u8bad\u7ec3 ResNet50 \u7684\u7b80\u5355\u793a\u4f8b\uff0c\u4ee5\u53ca\u5982\u4f55\u5728<strong>\u4ec5\u4f7f\u7528\u4e09\u884c\u989d\u5916\u4ee3\u7801\u7684\u60c5\u51b5<\/strong>\u4e0b\u5c06\u8bad\u7ec3\u901f\u5ea6\u63d0\u9ad8 2 \u500d\uff0c\u540c\u65f6\u52a0\u8f7d 2 \u500d\u7684\u6279\u5904\u7406\u5927\u5c0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"469\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image.jpeg\" alt=\"\" class=\"wp-image-80\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image.jpeg 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-300x201.jpeg 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"8aed\"><strong>\u786c\u4ef6\u57fa\u7840\u77e5\u8bc6\u2014\u2014Nvidia Tensor Cores<\/strong><\/h2>\n\n\n\n<p id=\"7d7d\">\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u56de\u987e\u4e00\u4e0b GPU \u8bbe\u8ba1\u7684\u4e00\u4e9b\u57fa\u672c\u539f\u7406\u3002Nvidia GPUS \u6700\u53d7\u6b22\u8fce\u7684\u5546\u4e1a\u4ea7\u54c1\u4e4b\u4e00\u662f Volta \u7cfb\u5217\uff0c\u4f8b\u5982\u57fa\u4e8e GV100 GPU \u8bbe\u8ba1\u7684 V100 GPU\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5c06<em>\u56f4\u7ed5\u4e0b\u9762\u7684 GV100 \u67b6\u6784\u8fdb\u884c\u8ba8\u8bba<\/em>\u3002<\/p>\n\n\n\n<p id=\"1862\">\u5bf9\u4e8e GV100\uff0c<strong>\u6d41\u5f0f\u591a\u5904\u7406\u5668 (SM)<\/strong>\u662f\u8ba1\u7b97\u7684\u6838\u5fc3\u8bbe\u8ba1\u3002\u6bcf\u4e2a GPU \u5305\u542b 6 \u4e2a GPU \u5904\u7406\u96c6\u7fa4 (GPC) \u548c S84 \u4e2a SM\uff08\u5bf9\u4e8e V100 \u5219\u4e3a 80 \u4e2a SM\uff09\u3002\u6574\u4f53\u8bbe\u8ba1\u5982\u4e0b\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"402\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-7.png\" alt=\"\" class=\"wp-image-84\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-7.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-7-300x172.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">Volta GV100 GPU \u8bbe\u8ba1\u3002\u6bcf\u4e2a GPU \u5305\u542b 6 \u4e2a GPC\uff0c\u6bcf\u4e2a GPC \u5305\u542b 14 \u4e2a SM\u3002\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/arxiv.org\/pdf\/1803.04014\" rel=\"noreferrer noopener\" target=\"_blank\">https :\/\/arxiv.org\/pdf\/1803.04014<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"3c32\">\u5bf9\u4e8e\u6bcf\u4e2a SM\uff0c\u5b83\u5305\u542b\u4e24\u79cd\u7c7b\u578b\u7684\u6838\u5fc3\uff1aCUDA \u6838\u5fc3\u548c Tensor \u6838\u5fc3\u3002CUDA<strong>\u6838\u5fc3<\/strong>\u662f Nvidia \u4e8e 2006 \u5e74\u63a8\u51fa\u7684\u539f\u59cb\u8bbe\u8ba1\uff0c\u662f CUDA \u5e73\u53f0\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002CUDA \u6838\u5fc3\u53ef\u5206\u4e3a\u4e09\u79cd\u7c7b\u578b\uff1aFP64 \u6838\u5fc3\/\u5355\u5143\u3001FP32 \u6838\u5fc3\/\u5355\u5143\u548c Int32 \u6838\u5fc3\/\u5355\u5143\u3002\u6bcf\u4e2a GV100 SM \u5305\u542b 32 \u4e2a FP64 \u6838\u5fc3\u300164 \u4e2a FP32 \u6838\u5fc3\u548c 64 \u4e2a Int32 \u6838\u5fc3\u3002Volta \/Turing (2017) \u7cfb\u5217 GPU \u5f15\u5165\u4e86<strong>Tensor \u6838\u5fc3\uff0c\u4ee5\u533a\u522b\u4e8e\u4e4b\u524d\u7684 Pascal (2016) \u7cfb\u5217\u3002GV100 \u4e0a\u7684\u6bcf\u4e2a SM \u5305\u542b 8 \u4e2a Tensor \u6838\u5fc3\u3002<\/strong><a href=\"https:\/\/datacrunch.io\/blog\/nvidia-v100-gpu-specs\" rel=\"noreferrer noopener\" target=\"_blank\">\u6b64\u5904\u63d0\u4f9b\u4e86<\/a>V100 GPU\u7684\u5b8c\u6574\u8be6\u7ec6\u4fe1\u606f\u5217\u8868\u3002\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u4e86 SM \u8bbe\u8ba1\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"690\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-6.png\" alt=\"\" class=\"wp-image-83\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-6.png 633w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-6-275x300.png 275w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><figcaption class=\"wp-element-caption\">\u6d41\u5904\u7406\u5668 (SM) \u7684\u5b50 Warp\u3002\u6bcf\u4e2a SM \u5305\u542b\u56db\u4e2a\u5b50 Warp\u3002\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/arxiv.org\/pdf\/1903.03640\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/arxiv.org\/pdf\/1903.03640<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"5ef2\"><strong>\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528 Tensor \u6838\u5fc3\uff1fNvidia Tensor \u6838\u5fc3\u4e13\u95e8\u7528\u4e8e\u6267\u884c\u901a\u7528\u77e9\u9635\u4e58\u6cd5 (GEMM) \u548c\u534a\u7cbe\u5ea6\u77e9\u9635\u4e58\u6cd5\u548c\u7d2f\u52a0 (HMMA) \u8fd0\u7b97\u3002<\/strong>\u7b80\u800c\u8a00\u4e4b\uff0cGEMM \u4ee5 A*B + C \u7684\u683c\u5f0f\u6267\u884c\u77e9\u9635\u8fd0\u7b97\uff0c\u800c HMMA \u5c06\u8fd0\u7b97\u8f6c\u6362\u4e3a\u534a\u7cbe\u5ea6\u683c\u5f0f\u3002\u8be6\u7ec6\u8ba8\u8bba\u53ef<a href=\"https:\/\/leimao.github.io\/blog\/NVIDIA-Tensor-Core-Programming\/\" rel=\"noreferrer noopener\" target=\"_blank\">\u5728\u6b64\u5904<\/a>\u627e\u5230\u3002\u7531\u4e8e\u6df1\u5ea6\u5b66\u4e60\u5927\u91cf\u6d89\u53ca MMA\uff0c\u56e0\u6b64<strong>Tensor \u6838\u5fc3\u5728\u5f53\u4eca\u7684\u6a21\u578b\u8bad\u7ec3\u548c\u52a0\u901f\u4e2d\u81f3\u5173\u91cd\u8981<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"628\" height=\"167\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-1.png\" alt=\"\" class=\"wp-image-77\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-1.png 628w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-1-300x80.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><figcaption class=\"wp-element-caption\">GEMM \u64cd\u4f5c\u793a\u4f8b\u3002\u5bf9\u4e8e HMMA\uff0cA \u548c B \u901a\u5e38\u8f6c\u6362\u4e3a FP16\uff0c\u800c C \u548c D \u53ef\u4ee5\u662f FP16 \u6216 FP32\u3002\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/arxiv.org\/pdf\/1811.08309\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/arxiv.org\/pdf\/1811.08309<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"4684\">\u5f53\u7136\uff0c\u5728\u5207\u6362\u5230\u6df7\u200b\u200b\u5408\u7cbe\u5ea6\u8bad\u7ec3\u65f6\uff0c\u8bf7\u52a1\u5fc5\u68c0\u67e5\u6240\u7528 GPU \u7684\u89c4\u683c\u3002\u53ea\u6709<a href=\"https:\/\/www.wevolver.com\/article\/tensor-cores-vs-cuda-cores\" rel=\"noreferrer noopener\" target=\"_blank\">\u6700\u65b0\u7684 GPU \u7cfb\u5217\u624d\u652f\u6301 Tensor \u6838\u5fc3<\/a>\uff0c\u5e76\u4e14\u53ea\u80fd\u5728\u8fd9\u4e9b\u673a\u5668\u4e0a\u4f7f\u7528\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c8ca\"><strong>\u6570\u636e\u683c\u5f0f\u57fa\u7840\u77e5\u8bc6 &#8211; \u5355\u7cbe\u5ea6\uff08FP32\uff09\u4e0e\u534a\u7cbe\u5ea6\uff08FP16\uff09<\/strong><\/h2>\n\n\n\n<p id=\"b990\">\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u4ed4\u7ec6\u770b\u770b FP32 \u548c FP16 \u683c\u5f0f\u3002FP32 \u548c FP16 \u662f\u4f7f\u7528 32 \u4f4d\u4e8c\u8fdb\u5236\u5b58\u50a8\u548c 16 \u4f4d\u4e8c\u8fdb\u5236\u5b58\u50a8\u8868\u793a\u6d6e\u70b9\u6570\u7684 IEEE \u683c\u5f0f\u3002\u4e24\u79cd\u683c\u5f0f\u90fd\u5305\u542b\u4e09\u90e8\u5206\uff1aa) \u7b26\u53f7\u4f4d\u3001b) \u6307\u6570\u4f4d\u548c c) \u5c3e\u6570\u4f4d\u3002FP32 \u548c FP16 \u5728<strong>\u5206\u914d\u7ed9\u6307\u6570\u548c\u5c3e\u6570\u7684\u4f4d\u6570<\/strong>\u4e0a\u6709\u6240\u4e0d\u540c\uff0c\u8fd9\u5bfc\u81f4\u4e0d\u540c\u7684\u503c\u8303\u56f4\u548c\u7cbe\u5ea6\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"456\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-5.png\" alt=\"\" class=\"wp-image-82\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-5.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-5-300x195.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">FP16\uff08IEEE \u6807\u51c6\uff09\u3001BF16\uff08Google Brain \u6807\u51c6\uff09\u3001FP32\uff08IEEE \u6807\u51c6\uff09\u548c TF32\uff08Nvidia \u6807\u51c6\uff09\u4e4b\u95f4\u7684\u533a\u522b\u3002\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/en.wikipedia.org\/wiki\/Bfloat16_floating-point_format\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/en.wikipedia.org\/wiki\/Bfloat16_floating-point_format<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"dd65\">\u5982\u4f55\u5c06 FP16 \u548c FP32 \u8f6c\u6362\u4e3a\u5b9e\u6570\uff1f\u6839\u636e IEEE-754 \u6807\u51c6\uff0cFP32 \u7684\u5341\u8fdb\u5236\u503c = (-1)^(\u7b26\u53f7) \u00d7 2^(\u5341\u8fdb\u5236\u6307\u6570 \u2014127) \u00d7 (\u9690\u5f0f\u524d\u5bfc 1 + \u5341\u8fdb\u5236\u5c3e\u6570)\uff0c\u5176\u4e2d 127 \u662f\u504f\u7f6e\u6307\u6570\u503c\u3002\u5bf9\u4e8e FP16\uff0c\u516c\u5f0f\u53d8\u4e3a (-1)^(\u7b26\u53f7) \u00d7 2^(\u5341\u8fdb\u5236\u6307\u6570 \u2014 15) \u00d7 (\u9690\u5f0f\u524d\u5bfc 1 + \u5341\u8fdb\u5236\u5c3e\u6570)\uff0c\u5176\u4e2d 15 \u662f\u76f8\u5e94\u7684\u504f\u7f6e\u6307\u6570\u503c\u3002<a href=\"https:\/\/en.wikipedia.org\/wiki\/Exponent_bias\" rel=\"noreferrer noopener\" target=\"_blank\">\u5728\u6b64\u5904<\/a>\u67e5\u770b\u504f\u7f6e\u6307\u6570\u503c\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n\n\n\n<p id=\"6cc0\">\u4ece\u8fd9\u4e2a\u610f\u4e49\u4e0a\u8bb2\uff0cFP32 \u7684\u503c\u8303\u56f4\u7ea6\u4e3a [-2\u00b9\u00b2\u2077, 2\u00b9\u00b2\u2077] ~[-1.7*1e38, 1.7*1e38]\uff0cFP16 \u7684\u503c\u8303\u56f4\u7ea6\u4e3a [-2\u00b9\u2075, 2\u00b9\u2075]=[-32768, 32768]\u3002\u8bf7\u6ce8\u610f\uff0cFP32 \u7684\u5341\u8fdb\u5236\u6307\u6570\u4ecb\u4e8e 0 \u5230 255 \u4e4b\u95f4\uff0c\u6211\u4eec\u6392\u9664\u4e86\u6700\u5927\u503c 0xFF\uff0c\u56e0\u4e3a\u5b83\u4ee3\u8868 NAN\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6700\u5927\u7684\u5341\u8fdb\u5236\u6307\u6570\u662f 254-127 = 127\u3002\u7c7b\u4f3c\u7684\u89c4\u5219\u9002\u7528\u4e8e FP16\u3002<\/p>\n\n\n\n<p id=\"4d14\">\u5bf9\u4e8e\u7cbe\u5ea6\uff0c\u8bf7\u6ce8\u610f\u6307\u6570\u548c\u5c3e\u6570\u90fd\u4f1a\u5f71\u54cd\u7cbe\u5ea6\u9650\u5236\uff08\u4e5f\u79f0\u4e3a<strong>\u975e\u89c4\u8303\u5316<\/strong>\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/cs.stackexchange.com\/questions\/101632\/understanding-denormalized-numbers-in-floating-point-representation\" rel=\"noreferrer noopener\" target=\"_blank\">\u6b64\u5904\u7684\u8be6\u7ec6\u8ba8\u8bba<\/a>\uff09\uff0c\u56e0\u6b64 FP32 \u53ef\u4ee5\u8868\u793a\u9ad8\u8fbe 2^(-23)*2^(-126)=2^(-149) \u7684\u7cbe\u5ea6\uff0c\u800c FP16 \u53ef\u4ee5\u8868\u793a\u9ad8\u8fbe 2^(10)*2^(-14)=2^(-24) \u7684\u7cbe\u5ea6\u3002<\/p>\n\n\n\n<p id=\"60ed\">FP32 \u548c FP16 \u8868\u793a\u4e4b\u95f4\u7684\u5dee\u5f02\u5e26\u6765\u4e86\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u7684\u5173\u952e\u95ee\u9898\uff0c\u56e0\u4e3a<strong>\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u7684\u4e0d\u540c\u5c42\/\u64cd\u4f5c\u5bf9\u503c\u8303\u56f4\u548c\u7cbe\u5ea6\u4e0d\u654f\u611f\u6216\u654f\u611f\uff0c\u9700\u8981\u5206\u522b\u5904\u7406<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2bda\"><strong>\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3<\/strong><\/h2>\n\n\n\n<p id=\"d0cc\">\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86 MMA \u7684\u786c\u4ef6\u57fa\u7840\u3001Tensor \u6838\u5fc3\u7684\u6982\u5ff5\u4ee5\u53ca FP32 \u548c FP16 \u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8ba8\u8bba\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u7684\u7ec6\u8282\u3002<\/p>\n\n\n\n<p id=\"9500\">\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u7684\u6982\u5ff5\u6700\u65e9\u51fa\u73b0\u5728 2018 \u5e74 ICLR \u8bba\u6587\u300a<a href=\"https:\/\/arxiv.org\/abs\/1710.03740\" rel=\"noreferrer noopener\" target=\"_blank\">\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3<\/a>\u300b\u4e2d\uff0c\u5373\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u5c06\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u8f6c\u6362\u4e3a\u534a\u7cbe\u5ea6\u6d6e\u70b9\u6570\uff0c\u800c\u4e0d\u4f1a\u635f\u5931\u6a21\u578b\u7cbe\u5ea6\u6216\u4fee\u6539\u8d85\u53c2\u6570\u3002\u5982\u4e0a\u6240\u8ff0\uff0c\u7531\u4e8e FP32 \u548c FP16 \u4e4b\u95f4\u7684\u5173\u952e\u533a\u522b\u5728\u4e8e\u53d6\u503c\u8303\u56f4\u548c\u7cbe\u5ea6\uff0c\u56e0\u6b64\u8be5\u8bba\u6587\u8be6\u7ec6\u8ba8\u8bba\u4e86<strong>FP16 \u5bfc\u81f4\u68af\u5ea6\u6d88\u5931\u7684\u539f\u56e0<\/strong>\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7<strong>\u635f\u5931\u7f29\u653e<\/strong>\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u6b64\u5916\uff0c\u8be5\u8bba\u6587\u8fd8\u63d0\u51fa\u4e86\u4e00\u4e9b\u6280\u5de7\uff0c\u4f8b\u5982\u4f7f\u7528 FP32 \u4e3b\u6743\u91cd\u590d\u5236\u4ee5\u53ca\u4f7f\u7528 FP32 \u8fdb\u884c\u7279\u5b9a\u64cd\u4f5c\uff08\u4f8b\u5982\u7f29\u51cf\u548c\u77e2\u91cf\u70b9\u751f\u6210\u7d2f\u79ef\uff09\u3002<\/p>\n\n\n\n<p id=\"8b9d\"><strong>\u635f\u5931\u7f29\u653e<\/strong>\u3002\u8bba\u6587\u7ed9\u51fa\u4e86\u4f7f\u7528 FP32 \u7cbe\u5ea6\u8bad\u7ec3 Multibox SSD \u68c0\u6d4b\u7f51\u7edc\u7684\u793a\u4f8b\uff0c\u5982\u4e0b\u6240\u793a\u3002\u5982\u679c\u4e0d\u8fdb\u884c\u4efb\u4f55\u7f29\u653e\uff0cFP16 \u68af\u5ea6\u7684\u6307\u6570\u8303\u56f4 \u2265 2^(-24)\uff0c\u5e76\u4e14\u4ee5\u4e0b\u6240\u6709\u5185\u5bb9\u90fd\u5c06\u53d8\u4e3a\u96f6\uff0c\u4e0e FP32 \u76f8\u6bd4\u662f\u4e0d\u591f\u7684\u3002\u4f46\u662f\uff0c\u901a\u8fc7\u5b9e\u9a8c\uff0c\u53ea\u9700\u5c06\u68af\u5ea6\u7f29\u653e 2\u00b3=8 \u500d\uff0c\u5c31\u53ef\u4ee5\u4f7f\u534a\u7cbe\u5ea6\u8bad\u7ec3\u7cbe\u5ea6\u56de\u5230\u4e0e FP32 \u5339\u914d\u7684\u72b6\u6001\u3002\u4ece\u8fd9\u4e2a\u610f\u4e49\u4e0a\u8bb2\uff0c\u4f5c\u8005\u8ba4\u4e3a [2^(-27), 2^(-24)] \u4e4b\u95f4\u7684\u989d\u5916\u51e0\u4e2a\u767e\u5206\u70b9\u7684\u68af\u5ea6\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4ecd\u7136\u5f88\u91cd\u8981\uff0c\u800c 2^(-27) \u4ee5\u4e0b\u7684\u503c\u5e76\u4e0d\u91cd\u8981\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"450\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-4.png\" alt=\"\" class=\"wp-image-81\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-4.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-4-300x193.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">Multibox SSD \u8bad\u7ec3\u793a\u4f8b\u4e2d\u4f7f\u7528 FP32 \u7cbe\u5ea6\u7684\u68af\u5ea6\u503c\u8303\u56f4\u3002\u8bf7\u6ce8\u610f\uff0c[2^(-27), 2^(-24)] \u4e4b\u95f4\u7684\u503c\u8d85\u51fa\u4e86 FP16 \u975e\u89c4\u8303\u5316\u8303\u56f4\uff0c\u4ec5\u5360\u603b\u68af\u5ea6\u7684\u51e0\u4e2a\u767e\u5206\u70b9\uff0c\u4f46\u5728\u6574\u4e2a\u8bad\u7ec3\u4e2d\u4ecd\u7136\u5f88\u91cd\u8981\u3002\u56fe\u7247\u6765\u6e90\uff1a<a href=\"https:\/\/arxiv.org\/pdf\/1710.03740\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/arxiv.org\/pdf\/1710.03740<\/a><\/figcaption><\/figure>\n\n\n\n<p id=\"5819\">\u89e3\u51b3\u8fd9\u79cd\u6bd4\u4f8b\u5dee\u5f02\u7684\u65b9\u6cd5\u662f\u5e94\u7528\u635f\u5931\u7f29\u653e\u3002\u6839\u636e\u94fe\u89c4\u5219\uff0c\u7f29\u653e\u635f\u5931\u5c06\u786e\u4fdd\u6240\u6709\u68af\u5ea6\u90fd\u7f29\u653e\u76f8\u540c\u7684\u91cf\u3002\u5728\u6700\u7ec8\u6743\u91cd\u66f4\u65b0\u4e4b\u524d\uff0c\u9700\u8981\u53d6\u6d88\u7f29\u653e\u68af\u5ea6\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"eb81\"><strong>\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3<\/strong><\/h2>\n\n\n\n<p id=\"e037\">Nvidia \u6700\u521d\u5c06\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u5f00\u53d1\u4e3a PyTorch \u7684\u6269\u5c55\uff0c\u79f0\u4e3a APEX\uff0c\u968f\u540e\u88ab PyTorch\u3001TensorFlow\u3001MXNet \u7b49\u4e3b\u6d41\u6846\u67b6\u5e7f\u6cdb\u91c7\u7528\u3002\u8bf7\u53c2\u9605<a href=\"https:\/\/docs.nvidia.com\/deeplearning\/performance\/mixed-precision-training\/index.html#\" rel=\"noreferrer noopener\" target=\"_blank\">\u6b64\u5904\u7684 Nvidia \u6587\u6863<\/a>\u3002\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c\u6211\u4eec\u4ec5\u4ecb\u7ecd PyTorch \u7684\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\uff1a<a href=\"https:\/\/pytorch.org\/docs\/stable\/amp.html\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/pytorch.org\/docs\/stable\/amp.html<\/a>\u3002<\/p>\n\n\n\n<p id=\"caf2\">amp \u5e93\u53ef\u4ee5\u81ea\u52a8\u5904\u7406\u5927\u591a\u6570\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u6280\u672f\uff0c\u4f8b\u5982 FP32 \u4e3b\u6743\u91cd\u590d\u5236\u3002\u7528\u6237\u4e3b\u8981\u63a5\u89e6<strong>ops autocast<\/strong>\u548c<strong>\u68af\u5ea6\/\u635f\u5931\u7f29\u653e<\/strong>\u3002<\/p>\n\n\n\n<p id=\"c90c\"><strong>Ops autocast\u3002<\/strong>\u867d\u7136\u6211\u4eec\u63d0\u5230\u5f20\u91cf\u6838\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8 GEMM \u64cd\u4f5c\u7684\u6027\u80fd\uff0c\u4f46\u67d0\u4e9b\u64cd\u4f5c\u5e76\u4e0d\u9002\u5408\u534a\u7cbe\u5ea6\u8868\u793a\u3002<\/p>\n\n\n\n<p id=\"d837\">amp \u5e93\u7ed9\u51fa\u4e86\u7b26\u5408\u534a\u7cbe\u5ea6\u8981\u6c42\u7684<a href=\"https:\/\/pytorch.org\/docs\/stable\/amp.html#autocast-op-reference\" rel=\"noreferrer noopener\" target=\"_blank\">CUDA \u64cd\u4f5c\u5217\u8868<\/a>\u3002\u5927\u591a\u6570\u77e9\u9635\u4e58\u6cd5\u3001\u5377\u79ef\u548c\u7ebf\u6027\u6fc0\u6d3b\u90fd\u5b8c\u5168\u7531 amp.autocast \u8986\u76d6\uff0c\u4f46\u662f\uff0c\u5bf9\u4e8e\u51cf\u5c11\/\u6c42\u548c\u3001softmax \u548c\u635f\u5931\u8ba1\u7b97\uff0c\u8ba1\u7b97\u4ecd\u7136\u5728 FP32 \u4e2d\u6267\u884c\uff0c\u56e0\u4e3a\u5b83\u4eec\u5bf9\u6570\u636e\u8303\u56f4\u548c\u7cbe\u5ea6\u66f4\u654f\u611f\u3002<\/p>\n\n\n\n<p id=\"c7b6\"><strong>\u68af\u5ea6\/\u635f\u5931\u7f29\u653e\u3002amp<\/strong>\u5e93\u63d0\u4f9b\u4e86<a href=\"https:\/\/docs.nvidia.com\/deeplearning\/performance\/mixed-precision-training\/index.html#scalefactor\" rel=\"noreferrer noopener\" target=\"_blank\">\u81ea\u52a8\u68af\u5ea6\u7f29\u653e<\/a>\u6280\u672f\uff0c\u56e0\u6b64\u7528\u6237\u65e0\u9700\u5728\u8bad\u7ec3\u671f\u95f4\u624b\u52a8\u8c03\u6574\u7f29\u653e\u3002\u7f29\u653e\u56e0\u5b50\u7684\u66f4\u8be6\u7ec6\u7b97\u6cd5\u53ef<a href=\"https:\/\/docs.nvidia.com\/deeplearning\/performance\/mixed-precision-training\/index.html#scalefactor\" rel=\"noreferrer noopener\" target=\"_blank\">\u5728\u6b64\u5904<\/a>\u627e\u5230\u3002<\/p>\n\n\n\n<p id=\"6770\">\u4e00\u65e6\u68af\u5ea6\u88ab\u7f29\u653e\uff0c\u5728\u68af\u5ea6\u88c1\u526a\u548c\u6b63\u5219\u5316\u4e4b\u524d\u9700\u8981\u5c06\u5176\u7f29\u5c0f\u3002\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u53ef<a href=\"https:\/\/pytorch.org\/docs\/stable\/amp.html#autocast-op-reference\" rel=\"noreferrer noopener\" target=\"_blank\">\u5728\u6b64\u5904<\/a>\u627e\u5230\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"b000\"><strong>FashionMNIST \u8bad\u7ec3\u793a\u4f8b<\/strong><\/h2>\n\n\n\n<p id=\"f103\">torch.amp \u5e93\u76f8\u5bf9\u5bb9\u6613\u4f7f\u7528\uff0c\u53ea\u9700\u8981\u4e09\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u5c06\u4f60\u7684\u8bad\u7ec3\u901f\u5ea6\u63d0\u9ad8 2 \u500d\u3002<\/p>\n\n\n\n<p id=\"cb04\"><a href=\"https:\/\/github.com\/zalandoresearch\/fashion-mnist\/blob\/master\/LICENSE\" rel=\"noreferrer noopener\" target=\"_blank\">\u6211\u4eec\u4ece\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u4efb\u52a1\u5f00\u59cb\uff0c\u4f7f\u7528 FP32 \u5728 FashionMNIST \u6570\u636e\u96c6\uff08 MIT \u8bb8\u53ef\u8bc1<\/a>\uff09\u4e0a\u8bad\u7ec3 ResNet50 \u6a21\u578b\uff1b\u6211\u4eec\u53ef\u4ee5\u770b\u5230 10 \u4e2a epoch \u7684\u8bad\u7ec3\u65f6\u95f4\u4e3a 333 \u79d2\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"871\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-11.png\" alt=\"\" class=\"wp-image-88\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-11.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-11-241x300.png 241w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u5728 FashionMNIST \u4e0a\u8fdb\u884c ResNet50 \u8bad\u7ec3\u3002\u56fe\u7247\u7531\u4f5c\u8005\u63d0\u4f9b\u3002<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"518\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\" alt=\"\" class=\"wp-image-87\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10-300x222.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u5c0f\u4e8e 2**(-24) \u7684\u68af\u5ea6\u4e0e\u603b\u68af\u5ea6\u4e4b\u95f4\u7684\u6bd4\u7387\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0cFP16 \u4f1a\u5c06\u8fd1 1\/4 \u7684\u603b\u68af\u5ea6\u53d8\u4e3a\u96f6\u3002\u56fe\u7247\u6765\u81ea\u4f5c\u8005\u3002<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"472\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-8.png\" alt=\"\" class=\"wp-image-85\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-8.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-8-300x202.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u8bc4\u4f30\u7ed3\u679c\u3002\u56fe\u7247\u7531\u4f5c\u8005\u63d0\u4f9b\u3002<\/figcaption><\/figure>\n\n\n\n<p id=\"26a5\">\u73b0\u5728\u6211\u4eec\u4f7f\u7528 amp \u5e93\u3002amp \u5e93\u53ea\u9700\u8981\u4e09\u884c\u989d\u5916\u7684\u4ee3\u7801\u5373\u53ef\u8fdb\u884c\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8bad\u7ec3\u5728 141 \u79d2\u5185\u5b8c\u6210\uff0c\u6bd4 FP32 \u8bad\u7ec3\u5feb 2.36 \u500d\uff0c\u540c\u65f6\u5b9e\u73b0\u76f8\u540c\u7684\u7cbe\u5ea6\u3001\u53ec\u56de\u7387\u548c F1 \u5206\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">scaler = torch.cuda.amp.GradScaler()<br># \u5f00\u59cb\u4f60\u7684\u8bad\u7ec3\u4ee3\u7801<br># ... <br>with torch.autocast(device_type= \"cuda\" ): <br>  # \u8bad\u7ec3\u4ee3\u7801<br><br># \u5305\u88c5\u635f\u5931\u548c\u4f18\u5316\u5668<br>scaler.scale(loss).backward() <br>scaler.step(optimizer) <br><br>scaler.update()<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"947\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-9.png\" alt=\"\" class=\"wp-image-86\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-9.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-9-222x300.png 222w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u4f7f\u7528 amp \u8bad\u7ec3\u4ee3\u7801\u3002\u56fe\u7247\u7531\u4f5c\u8005\u63d0\u4f9b\u3002<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"525\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-2.png\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-2.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-2-300x225.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u8bad\u7ec3\u671f\u95f4\u7684\u7f29\u653e\u56e0\u5b50\u3002\u7f29\u653e\u56e0\u5b50\u4ec5\u5728\u7b2c\u4e00\u6b65\u53d1\u751f\u53d8\u5316\uff0c\u4e4b\u540e\u4fdd\u6301\u4e0d\u53d8\u3002\u56fe\u7247\u6765\u81ea\u4f5c\u8005\u3002<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"479\" src=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-3.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-3.png 700w, https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-3-300x205.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\">\u6700\u7ec8\u7ed3\u679c\u4e0e FP32 \u8bad\u7ec3\u7ed3\u679c\u76f8\u5f53\u3002\u56fe\u7247\u7531\u4f5c\u8005\u63d0\u4f9b\u3002<\/figcaption><\/figure>\n\n\n\n<p id=\"a621\">\u4e0a\u9762\u4ee3\u7801\u7684 github \u94fe\u63a5\u5728<a href=\"https:\/\/github.com\/adoskk\/MachineLearningBasics\/blob\/main\/mixed_precision_training\/mixed_precision_training.ipynb\" rel=\"noreferrer noopener\" target=\"_blank\">\u8fd9\u91cc<\/a>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ce48\">\u6982\u62ec<\/h2>\n\n\n\n<p id=\"f2e5\">\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u662f\u52a0\u901f\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u8bad\u7ec3\u7684\u4e00\u9879\u5b9d\u8d35\u6280\u672f\u3002\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u52a0\u901f\u6d6e\u70b9\u8fd0\u7b97\uff0c\u8fd8\u53ef\u4ee5\u8282\u7701 GPU \u5185\u5b58\uff0c\u56e0\u4e3a\u8bad\u7ec3\u6279\u6b21\u53ef\u4ee5\u8f6c\u6362\u4e3a FP16\uff0c\u4ece\u800c\u8282\u7701\u4e00\u534a\u7684 GPU \u5185\u5b58\u3002\u4f7f\u7528 PyTorch \u7684 amp \u5e93\uff0c\u989d\u5916\u7684\u4ee3\u7801\u53ef\u4ee5\u51cf\u5c11\u5230\u4e09\u884c\uff0c\u56e0\u4e3a\u6743\u91cd\u590d\u5236\u3001\u635f\u5931\u7f29\u653e\u3001\u64cd\u4f5c\u7c7b\u578b\u8f6c\u6362\u90fd\u7531\u5e93\u5185\u90e8\u5904\u7406\u3002<\/p>\n\n\n\n<p id=\"d365\">\u7136\u800c\uff0c\u5982\u679c\u6a21\u578b\u6743\u91cd\u5927\u5c0f\u8fdc\u5927\u4e8e\u6570\u636e\u6279\u6b21\uff0c\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u5e76\u4e0d\u80fd\u771f\u6b63\u89e3\u51b3 GPU \u5185\u5b58\u95ee\u9898\u3002\u9996\u5148\uff0c\u53ea\u6709\u6a21\u578b\u7684\u67d0\u4e9b\u5c42\u88ab\u8f6c\u6362\u4e3a FP16\uff0c\u800c\u5176\u4f59\u5c42\u4ecd\u5728 FP32 \u4e2d\u8ba1\u7b97\uff1b\u5176\u6b21\uff0c\u6743\u91cd\u66f4\u65b0\u9700\u8981 FP32 \u526f\u672c\uff0c\u8fd9\u4ecd\u7136\u5360\u7528\u5927\u91cf GPU \u5185\u5b58\uff1b\u7b2c\u4e09\uff0c\u6765\u81ea Adam \u7b49\u4f18\u5316\u5668\u7684\u53c2\u6570\u5728\u8bad\u7ec3\u671f\u95f4\u5360\u7528\u5927\u91cf GPU \u5185\u5b58\uff0c\u800c\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u4f7f\u4f18\u5316\u5668\u53c2\u6570\u4fdd\u6301\u4e0d\u53d8\u3002\u4ece\u8fd9\u4e2a\u610f\u4e49\u4e0a\u8bb2\uff0c\u9700\u8981\u50cf DeepSpeed \u7684 ZERO \u7b97\u6cd5\u8fd9\u6837\u7684\u66f4\u5148\u8fdb\u7684\u6280\u672f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"264d\"><strong>\u53c2\u8003<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Micikevicius \u7b49\u4eba\uff0c\u6df7\u5408\u7cbe\u5ea6\u8bad\u7ec3\u3002ICLR 2018<\/li>\n\n\n\n<li>PyTorch AMP \u5e93\uff1a<a href=\"https:\/\/pytorch.org\/tutorials\/recipes\/recipes\/amp_recipe.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/pytorch.org\/tutorials\/recipes\/recipes\/amp_recipe.html<\/a><\/li>\n\n\n\n<li>Nvidia CUDA \u6d6e\u70b9\uff1a<a href=\"https:\/\/docs.nvidia.com\/cuda\/floating-point\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/docs.nvidia.com\/cuda\/floating-point\/index.html<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528\u4e09\u884c\u4ee3\u7801\u5c06\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6&#8230;<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI\" \/>\n<meta property=\"og:description\" content=\"\u5982\u4f55\u4f7f\u7528\u4e09\u884c\u4ee3\u7801\u5c06\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\/\" \/>\n<meta property=\"og:site_name\" content=\"OAIDO AI\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-18T02:24:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-18T03:34:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"518\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"oaido_ai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"oaido_ai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/\"},\"author\":{\"name\":\"oaido_ai\",\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"headline\":\"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\",\"datePublished\":\"2024-09-18T02:24:33+00:00\",\"dateModified\":\"2024-09-18T03:34:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/\"},\"wordCount\":277,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"image\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\",\"articleSection\":[\"\u5b66\u4e60\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/\",\"url\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/\",\"name\":\"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI\",\"isPartOf\":{\"@id\":\"https:\/\/ai.oaido.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\",\"datePublished\":\"2024-09-18T02:24:33+00:00\",\"dateModified\":\"2024-09-18T03:34:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage\",\"url\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\",\"contentUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png\",\"width\":700,\"height\":518},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ai.oaido.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ai.oaido.com\/#website\",\"url\":\"https:\/\/ai.oaido.com\/\",\"name\":\"OAIDO AI\",\"description\":\"AI\u6700\u65b0\u8d44\u8baf\u3001\u6280\u672f\u6587\u7ae0\u3001\u5de5\u5177\u63a8\u8350\u3001\u5b66\u4e60\u8d44\u6599\",\"publisher\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ai.oaido.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac\",\"name\":\"oaido_ai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg\",\"contentUrl\":\"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg\",\"width\":512,\"height\":512,\"caption\":\"oaido_ai\"},\"logo\":{\"@id\":\"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/ai.oaido.com\"],\"url\":\"https:\/\/ai.oaido.com\/index.php\/author\/adminai_oaido\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\/","og_locale":"zh_CN","og_type":"article","og_title":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI","og_description":"\u5982\u4f55\u4f7f\u7528\u4e09\u884c\u4ee3\u7801\u5c06\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6...","og_url":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-\u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6\/","og_site_name":"OAIDO AI","article_published_time":"2024-09-18T02:24:33+00:00","article_modified_time":"2024-09-18T03:34:00+00:00","og_image":[{"width":700,"height":518,"url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png","type":"image\/png"}],"author":"oaido_ai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"oaido_ai","Est. reading time":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#article","isPartOf":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/"},"author":{"name":"oaido_ai","@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"headline":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6","datePublished":"2024-09-18T02:24:33+00:00","dateModified":"2024-09-18T03:34:00+00:00","mainEntityOfPage":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/"},"wordCount":277,"commentCount":0,"publisher":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"image":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage"},"thumbnailUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png","articleSection":["\u5b66\u4e60"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/","url":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/","name":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6 - OAIDO AI","isPartOf":{"@id":"https:\/\/ai.oaido.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage"},"image":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage"},"thumbnailUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png","datePublished":"2024-09-18T02:24:33+00:00","dateModified":"2024-09-18T03:34:00+00:00","breadcrumb":{"@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#primaryimage","url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png","contentUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/image-10.png","width":700,"height":518},{"@type":"BreadcrumbList","@id":"https:\/\/ai.oaido.com\/index.php\/2024\/09\/18\/pytorch-%e8%87%aa%e5%8a%a8%e6%b7%b7%e5%90%88%e7%b2%be%e5%ba%a6%e5%ba%93%e8%83%8c%e5%90%8e%e7%9a%84%e7%a7%98%e5%af%86\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ai.oaido.com\/"},{"@type":"ListItem","position":2,"name":"PyTorch \u81ea\u52a8\u6df7\u5408\u7cbe\u5ea6\u5e93\u80cc\u540e\u7684\u79d8\u5bc6"}]},{"@type":"WebSite","@id":"https:\/\/ai.oaido.com\/#website","url":"https:\/\/ai.oaido.com\/","name":"OAIDO AI","description":"AI\u6700\u65b0\u8d44\u8baf\u3001\u6280\u672f\u6587\u7ae0\u3001\u5de5\u5177\u63a8\u8350\u3001\u5b66\u4e60\u8d44\u6599","publisher":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ai.oaido.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/984ba9574feb0b6e609ac8ef07488dac","name":"oaido_ai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/","url":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg","contentUrl":"https:\/\/ai.oaido.com\/wp-content\/uploads\/2024\/09\/\u5fae\u4fe1\u622a\u56fe_20240918174247.jpg","width":512,"height":512,"caption":"oaido_ai"},"logo":{"@id":"https:\/\/ai.oaido.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/ai.oaido.com"],"url":"https:\/\/ai.oaido.com\/index.php\/author\/adminai_oaido\/"}]}},"_links":{"self":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":2,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":173,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions\/173"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.oaido.com\/index.php\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}