{"id":44238,"date":"2023-12-11T15:02:15","date_gmt":"2023-12-11T07:02:15","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=44238"},"modified":"2023-12-11T15:02:15","modified_gmt":"2023-12-11T07:02:15","slug":"depthwise-%e5%8d%b7%e7%a7%af%e5%ae%9e%e9%99%85%e9%80%9f%e5%ba%a6%e4%b8%8e%e7%90%86%e8%ae%ba%e9%80%9f%e5%ba%a6%e5%b7%ae%e8%b7%9d%e8%be%83%e5%a4%a7%ef%bc%8c%e8%a7%a3%e9%87%8a%e5%8e%9f%e5%9b%a0%e3%80%82","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/11\/depthwise-%e5%8d%b7%e7%a7%af%e5%ae%9e%e9%99%85%e9%80%9f%e5%ba%a6%e4%b8%8e%e7%90%86%e8%ae%ba%e9%80%9f%e5%ba%a6%e5%b7%ae%e8%b7%9d%e8%be%83%e5%a4%a7%ef%bc%8c%e8%a7%a3%e9%87%8a%e5%8e%9f%e5%9b%a0%e3%80%82\/","title":{"rendered":"Depthwise \u5377\u79ef\u5b9e\u9645\u901f\u5ea6\u4e0e\u7406\u8bba\u901f\u5ea6\u5dee\u8ddd\u8f83\u5927\uff0c\u89e3\u91ca\u539f\u56e0\u3002"},"content":{"rendered":"<p>&#8220;`&#8221;                    \u53c2\u8003\u56de\u7b54\uff1a<\/p>\n<p>\u9996\u5148\uff0ccaffe\u539f\u5148\u7684gpu\u5b9e\u73b0group convolution\u5f88\u7cdf\u7cd5\uff0c\u7528for\u5faa\u73af\u6bcf\u6b21\u7b97\u4e00\u4e2a\u5377\u79ef\uff0c\u901f\u5ea6\u6781\u6162\u3002\u7b2c\u4e8c\uff0ccudnn7.0\u53ca\u4e4b\u540e\u76f4\u63a5\u652f\u6301group convolution\uff0c\u4f46\u672c\u4eba\u5b9e\u6d4b\uff0c\u901f\u5ea6\u6bd4github\u4e0a\u51e0\u4e2a\u76f4\u63a5\u5199cuda kernel\u8ba1\u7b97\u7684dw convolution\u901f\u5ea6\u6162\u3002\u4f8b\u5982\u5bf9\u4e8en=128, c=512, h=32, w=32, group=512\u7684\u5377\u79ef\u8dd1100\u6b21\uff0ccudnn 7.0\u91cc\u7684group convolution\u9700\u89814\u79d2\u591a\uff0c\u800cDepthwiseConvolution\u5927\u6982\u53ea\u9700\u89811\u79d2\u3002<\/p>\n<p>\u5206\u6790\u4e86\u4e00\u4e0bdw convolution\u4e0e\u666e\u901aconvolution\u7684\u7406\u8bba\u8ba1\u7b97\u590d\u6742\u5ea6\uff0c\u4e3e\u4f8b\u5982\u4e0b\uff1a<\/p>\n<p>\u5377\u79ef1\uff1a\u666e\u901a\u5377\u79ef\uff0c\u8f93\u5165\u4e3a64&lt;em&gt;64&lt;\/em&gt;256\uff0c\u8f93\u51fa\u4e3a64&lt;em&gt;64&lt;\/em&gt;256\uff0c\u5377\u79ef\u6838\u5927\u5c0f\u4e3a3&lt;em&gt;3\u3002\u53c2\u6570\u4e3a3&lt;\/em&gt;3&lt;em&gt;256&lt;\/em&gt;256=590K\uff0c\u8ba1\u7b97\u91cf\u4e3a64&lt;em&gt;64&lt;\/em&gt;256&lt;em&gt;3&lt;\/em&gt;3&lt;em&gt;256=2.42G\uff0c\u8ba1\u7b97\u8fc7\u7a0b\u7684\u5de5\u4f5c\u96c6\u5185\u5b58\u603b\u91cf\uff08\u8f93\u5165\u8f93\u51fa\u6570\u636e+\u53c2\u6570\uff09\u4e3a64&lt;\/em&gt;64&lt;em&gt;256&lt;\/em&gt;2 + 3&lt;em&gt;3&lt;\/em&gt;256*256 = 2.69M\u3002<\/p>\n<p>\u5377\u79ef2\uff1adw\u5377\u79ef\uff0c\u8f93\u5165\u4e3a64&lt;em&gt;64&lt;\/em&gt;256\uff0c\u8f93\u51fa\u4e3a64&lt;em&gt;64&lt;\/em&gt;256\uff0c\u5377\u79ef\u6838\u5927\u5c0f\u4e3a3&lt;em&gt;3\u3002\u53c2\u6570\u4e3a3&lt;\/em&gt;3&lt;em&gt;256=2.3K\u4e2a\uff0c\u8ba1\u7b97\u91cf\u4e3a64&lt;\/em&gt;64&lt;em&gt;256&lt;\/em&gt;3&lt;em&gt;3=9.44M\uff0c\u8ba1\u7b97\u8fc7\u7a0b\u7684\u5de5\u4f5c\u96c6\u5185\u5b58\u603b\u91cf\u4e3a64&lt;\/em&gt;64&lt;em&gt;256&lt;\/em&gt;2 + 3&lt;em&gt;3&lt;\/em&gt;256=2.10M\u3002<\/p>\n<p>\u5377\u79ef3\uff1a\u666e\u901a\u5377\u79ef\uff0c\u8f93\u5165\u4e3a64&lt;em&gt;64&lt;\/em&gt;16\uff0c\u8f93\u51fa\u4e3a64&lt;em&gt;64&lt;\/em&gt;16\uff0c\u5377\u79ef\u6838\u5927\u5c0f\u4e3a3&lt;em&gt;3\u3002\u53c2\u6570\u4e3a3&lt;\/em&gt;3&lt;em&gt;16&lt;\/em&gt;16=2.3K\u4e2a\uff0c\u8ba1\u7b97\u91cf\u4e3a64&lt;em&gt;64&lt;\/em&gt;16&lt;em&gt;3&lt;\/em&gt;3&lt;em&gt;16=9.44M\uff0c\u8ba1\u7b97\u8fc7\u7a0b\u7684\u5de5\u4f5c\u96c6\u5185\u5b58\u603b\u91cf\u4e3a64&lt;\/em&gt;64&lt;em&gt;16&lt;\/em&gt;2 + 3&lt;em&gt;3&lt;\/em&gt;16*16=133K\u3002<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u5377\u79ef2\u80af\u5b9a\u6bd4\u5377\u79ef1\u5feb\uff0c\u56e0\u4e3a\u8ba1\u7b97\u91cf\u4e0b\u964d\u52301\/256\u4e86\uff0c\u4f46\u5377\u79ef2\u5b9e\u9645\u4e0a\u65e0\u6cd5\u8fbe\u5230\u5377\u79ef1\u7684256\u500d\u901f\u5ea6\uff08\u6211\u8bb0\u5f97\u6211\u6d4b\u5f97\u7ed3\u679c\u5927\u6982\u662f\u5feb10\u500d\u5de6\u53f3\uff09\uff0c\u56e0\u4e3a\u5de5\u4f5c\u96c6\u5185\u5b58\u5927\u5c0f\u5e76\u6ca1\u6709\u663e\u8457\u964d\u4f4e\u3002\u5377\u79ef2\u4e5f\u65e0\u6cd5\u8fbe\u5230\u5377\u79ef3\u7684\u901f\u5ea6\uff0c\u56e0\u4e3a\u867d\u7136FLOPS\u76f8\u540c\uff0c\u4f46\u5de5\u4f5c\u96c6\u5185\u5b58\u5927\u5c0f\u76f8\u5dee\u4e86\u5f88\u591a\u500d\uff0c\u56e0\u6b64\u5355\u4f4d\u6570\u636e\u7684\u8ba1\u7b97\u5bc6\u5ea6\u5c0f\u5f88\u591a\uff0c\u5f88\u96be\u5145\u5206\u5229\u7528GPU\u4e0a\u7684\u8ba1\u7b97\u5355\u5143\u3002<\/p>\n<p>&lt;pre&gt;&lt;code&gt;            &quot;&#8220;`<br \/>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`&#8221; \u53c2\u8003\u56de\u7b54\uff1a \u9996\u5148\uff0ccaffe\u539f\u5148\u7684gpu\u5b9e\u73b0group convolution [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-44238","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/44238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=44238"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/44238\/revisions"}],"predecessor-version":[{"id":44239,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/44238\/revisions\/44239"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=44238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=44238"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=44238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}