병렬 스케줄링 자기주의 메커니즘: 일반화 및 최적화
Parallel Scheduling Self-attention Mechanism: Generalization and Optimization
Parallel Scheduling Self-attention Mechanism: Generalization and Optimization
@misc{yu2020parallel,
title = {Parallel Scheduling Self-attention Mechanism: Generalization and Optimization},
author = {Mingfei Yu and Masahiro Fujita},
year = {2020},
eprint = {2012.01114},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2012.01114}
}
Yu, M., & Fujita, M. (2020). Parallel Scheduling Self-attention Mechanism: Generalization and Optimization [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2012.01114
YU M, FUJITA M. Parallel Scheduling Self-attention Mechanism: Generalization and Optimization[EB/OL]. (2020-12-02)[2026-11-29]. https://arxiv.org/abs/2012.01114.
초록
최근 몇 년간 자기주의 (self-attention) 는 딥러닝, 특히 자연어 처리 (NLP) 분야에서 빛을 발하고 있다. 그 놀라운 효과와 보편적인 구현은 자기주의에 기반한 계산의 데이터 흐름을 다수의 계산 단위를 가진 아키텍처에 효율적으로 스케줄링하여 병렬 계산을 실현하는 것에 대한 관심을 불러일으켰다. 본 논문에서는 자기주의 메커니즘의 이론과 언어 모델에서의 최첨단 자기주의 구현을 기반으로, 만족도 검사 (SAT) 솔버로 해결된 소규모 인스턴스의 최적 스케줄링에서 유도된 일반적인 스케줄링 알고리즘을 제안한다. 이 알고리즘은 자기주의의 전형적인 계산을 병렬화한다. 또한 불필요한 계산을 건너뛰는 추가 최적화를 위한 전략을 제시하며, 이를 통해 두 가지 널리 채택된 자기주의 적용 스키마에서 원래 계산을 약 25% 와 50% 감소시키는 성과를 달성했다. 제안된 최적화를 적용하여 두 가지 추가적인 스케줄링 알고리즘을 도출했다. 제안된 알고리즘은 아키텍처에 제공 가능한 계산 단위의 수로 입력 벡터의 수가 나누어떨어질 경우 문제 크기와 무관하게 적용 가능하다. 일반적인 경우에서 알고리즘의 수학적 정확성을 증명하는 복잡성 때문에, 우리는 특정 인스턴스를 대상으로 SAT 문제를 해결함으로써 알고리즘의 유효성과 제공되는 해의 우수한 품질을 실험을 통해 입증했다.
Over the past few years, self-attention is shining in the field of deep learning, especially in the domain of natural language processing(NLP). Its impressive effectiveness, along with ubiquitous implementations, have aroused our interest in efficiently scheduling the data-flow of corresponding computations onto architectures with many computing units to realize parallel computing. In this paper, based on the theory of self-attention mechanism and state-of-the-art realization of self-attention in language models, we propose a general scheduling algorithm, which is derived from the optimum scheduling for small instances solved by a satisfiability checking(SAT) solver, to parallelize typical computations of self-attention. Strategies for further optimization on skipping redundant computations are put forward as well, with which reductions of almost 25% and 50% of the original computations are respectively achieved for two widely-adopted application schemes of self-attention. With the proposed optimization adopted, we have correspondingly come up with another two scheduling algorithms. The proposed algorithms are applicable regardless of problem sizes, as long as the number of input vectors is divisible to the number of computing units available in the architecture. Due to the complexity of proving the correctness of the algorithms mathematically for general cases, we have conducted experiments to reveal their validity, together with the superior quality of the solutions provided by which, by solving SAT problems for particular instances.