{"id":145970,"date":"2022-09-09T01:24:26","date_gmt":"2022-09-09T06:24:26","guid":{"rendered":"https:\/\/lifeboat.com\/blog\/2022\/09\/automatically-optimizing-execution-of-unfamiliar-tensor-operations"},"modified":"2022-09-09T01:24:26","modified_gmt":"2022-09-09T06:24:26","slug":"automatically-optimizing-execution-of-unfamiliar-tensor-operations","status":"publish","type":"post","link":"https:\/\/lifeboat.com\/blog\/2022\/09\/automatically-optimizing-execution-of-unfamiliar-tensor-operations","title":{"rendered":"Automatically optimizing execution of unfamiliar tensor operations"},"content":{"rendered":"<p><a class=\"aligncenter blog-photo\" href=\"https:\/\/lifeboat.com\/blog.images\/automatically-optimizing-execution-of-unfamiliar-tensor-operations3.jpg\"><\/a><\/p>\n<p>At this year\u2019s Conference on Machine Learning and Systems (<a class=\"\" href=\"https:\/\/www.amazon.science\/conferences-and-events\/mlsys-2022\" data-cms-ai=\"0\" >MLSys<\/a>), we and our colleagues presented a new auto-scheduler called <a class=\"\" href=\"https:\/\/www.amazon.science\/publications\/dietcode-automatic-optimization-for-dynamic-tensor-program\" data-cms-ai=\"0\" >DietCode<\/a>, which handles dynamic-shape workloads much more efficiently than its predecessors. Where existing auto-encoders have to optimize each possible shape individually, DietCode constructs a <i>shape-generic search space<\/i> that enables it to optimize all possible shapes simultaneously.<\/p>\n<p>We tested our approach on a natural-language-processing (NLP) task that could take inputs ranging in size from 1 to 128 tokens. When we use a random sampling of input sizes that reflects a plausible real-world distribution, we speed up the optimization process almost sixfold relative to the best prior auto-scheduler. That speedup increases to more than 94-fold when we consider all possible shapes.<\/p>\n<p>Despite being much faster, DietCode also improves the performance of the resulting code, by up to 70% relative to prior auto-schedulers and up to 19% relative to hand-optimized code in existing tensor operation libraries. It thus promises to speed up our customers\u2019 dynamic-shaped machine learning workloads.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At this year\u2019s Conference on Machine Learning and Systems (MLSys), we and our colleagues presented a new auto-scheduler called DietCode, which handles dynamic-shape workloads much more efficiently than its predecessors. Where existing auto-encoders have to optimize each possible shape individually, DietCode constructs a shape-generic search space that enables it to optimize all possible shapes simultaneously. [\u2026]<\/p>\n","protected":false},"author":359,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,1491],"tags":[],"class_list":["post-145970","post","type-post","status-publish","format-standard","hentry","category-robotics-ai","category-transportation"],"_links":{"self":[{"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/posts\/145970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/users\/359"}],"replies":[{"embeddable":true,"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/comments?post=145970"}],"version-history":[{"count":0,"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/posts\/145970\/revisions"}],"wp:attachment":[{"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/media?parent=145970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/categories?post=145970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lifeboat.com\/blog\/wp-json\/wp\/v2\/tags?post=145970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}