arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.08199cs.CLcs.LG
收藏

用于嵌入式设备上高效机器翻译的动态Transformer

Dynamic Transformer for Efficient Machine Translation on Embedded Devices

University of Southampton(南安普顿大学)

Hishan Parry, Lei Xun, Amin Sabet, Jia Bi, Jonathon Hare, Geoff V. Merrett

摘要:

Transformer架构广泛用于机器翻译任务。然而,其资源密集型的性质使得它具有挑战性的约束嵌入式设备上实现,特别是在可用的硬件资源可以在运行时变化。我们提出了一个动态的机器翻译模型,根据任何特定时间的可用资源来扩展Transformer架构。所提出的方法,“动态HAT”,使用一个HAT超级变压器作为骨干搜索SubTransformers与不同的精度延迟权衡在设计时。最佳SubTransformer在运行时从SuperTransformer中采样,这取决于延迟约束。动态HAT在Jetson Nano上进行了测试,该方法使用直接从SuperTransformer采样的继承SubTransformers,切换时间<1 s。使用继承的SubTransformers会导致BLEU分数损失<1.5%,因为SubTransformer配置在采样后没有从头开始重新训练。然而,为了恢复这种性能损失,可以减小设计空间的尺寸以将其定制为目标硬件系列。新的设计空间减少导致次优模型的BLEU分数从原始设计空间增加约1%,GPU的性能扩展范围为0.356s - 1.526s,CPU的性能扩展范围为2.9s - 7.31s。

英文摘要:

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 <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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑