Dynamic Transformer for Efficient Machine Translation on Embedded Devices

Hishan Parry, Lei Xun, Amin Sabet, Jia Bi, Jonathon S. Hare, G. Merrett
{"title":"Dynamic Transformer for Efficient Machine Translation on Embedded Devices","authors":"Hishan Parry, Lei Xun, Amin Sabet, Jia Bi, Jonathon S. Hare, G. Merrett","doi":"10.1109/MLCAD52597.2021.9531281","DOIUrl":null,"url":null,"abstract":"The Transformer architecture is widely used for machine translation tasks. However, its resource-intensive nature makes it challenging to implement on constrained embedded devices, particularly where available hardware resources can vary at run-time. We propose a dynamic machine translation model that scales the Transformer architecture based on the available resources at any particular time. The proposed approach, ‘Dynamic-HAT’, uses a HAT SuperTransformer as the backbone to search for SubTransformers with different accuracy-latency trade-offs at design time. The optimal SubTransformers are sampled from the SuperTransformer at run-time, depending on latency constraints. The Dynamic-HAT is tested on the Jetson Nano and the approach uses inherited SubTransformers sampled directly from the SuperTransformer with a switching time of <1s. Using inherited SubTransformers results in a BLEU score loss of 6 1.5% because the SubTransformer configuration is not retrained from scratch after sampling. However, to recover this loss in performance, the dimensions of the design space can be reduced to tailor it to a family of target hardware. The new reduced design space results in a BLEU score increase of approximately 1% for sub-optimal models from the original design space, with a wide range for performance scaling between 0.356s - 1.526s for the GPU and 2.9s - 7.31s for the CPU.","PeriodicalId":210763,"journal":{"name":"2021 ACM/IEEE 3rd Workshop on Machine Learning for CAD (MLCAD)","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2021-07-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 ACM/IEEE 3rd Workshop on Machine Learning for CAD (MLCAD)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/MLCAD52597.2021.9531281","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

The Transformer architecture is widely used for machine translation tasks. However, its resource-intensive nature makes it challenging to implement on constrained embedded devices, particularly where available hardware resources can vary at run-time. We propose a dynamic machine translation model that scales the Transformer architecture based on the available resources at any particular time. The proposed approach, ‘Dynamic-HAT’, uses a HAT SuperTransformer as the backbone to search for SubTransformers with different accuracy-latency trade-offs at design time. The optimal SubTransformers are sampled from the SuperTransformer at run-time, depending on latency constraints. The Dynamic-HAT is tested on the Jetson Nano and the approach uses inherited SubTransformers sampled directly from the SuperTransformer with a switching time of <1s. Using inherited SubTransformers results in a BLEU score loss of 6 1.5% because the SubTransformer configuration is not retrained from scratch after sampling. However, to recover this loss in performance, the dimensions of the design space can be reduced to tailor it to a family of target hardware. The new reduced design space results in a BLEU score increase of approximately 1% for sub-optimal models from the original design space, with a wide range for performance scaling between 0.356s - 1.526s for the GPU and 2.9s - 7.31s for the CPU.
嵌入式设备上高效机器翻译的动态变压器
Transformer架构广泛用于机器翻译任务。然而,它的资源密集型特性使得在受限的嵌入式设备上实现具有挑战性,特别是在可用硬件资源在运行时可能变化的情况下。我们提出了一个动态机器翻译模型,该模型可以根据任何特定时间的可用资源来扩展Transformer体系结构。提出的方法“Dynamic-HAT”使用HAT超级变压器作为骨干,在设计时搜索具有不同精度-延迟权衡的子变压器。根据延迟限制,在运行时从SuperTransformer中采样最佳subtransformer。Dynamic-HAT在Jetson Nano上进行了测试,该方法使用直接从SuperTransformer采样的继承子变压器,开关时间<1s。使用继承的SubTransformer会导致BLEU分数损失61.5%,因为SubTransformer配置在采样后没有重新训练。然而,为了弥补这种性能损失,可以减少设计空间的尺寸,使其适合目标硬件系列。与原始设计空间相比,新的减小的设计空间使次优模型的BLEU分数增加了约1%,GPU的性能扩展范围在0.356秒- 1.526秒之间,CPU的性能扩展范围在2.9秒- 7.31秒之间。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信