McGill University
Low-Latency BERT Inference for heterogeneous multi-processor edge devices
Abstract
dc:description.abstractPopular transformer-based DNNs such as BERT have achieved state-of-the-art accuracy in NLP tasks. However, these models often have high compute and memory requirements, resulting in high inference latency. This is especially problematic when targeting edge deployment, as edge devices have limited computational resources compared to cloud servers.Therefore, we aim to improve edge inference latency of BERT and other DNNs, which may enable improved user experience in many AI enhanced applications. In this work, we propose a heterogeneous mapping optimizer called DNN-SMO, with the goal of utilizing multiple processing elements in parallel to accelerate inference.This leads to the challenge of efficiently mapping DNN operations to heterogeneous processing elements. For a large neural network, the number of potential mappings of DNN operations to processing elements scales exponentially, necessitating the use of heuristic algorithms. DNN-SMO is based on genetic algorithms. Through intelligent initialization and a customized mutation operation, DNN-SMO is able to evaluate 20x fewer generations while finding superior CPU-GPU mapping configurations compared with a baseline GA. Using DNN-SMO, we find device placement configurations that achieve 15\%, 24\%, and 31\% inference speed-up for BERT, SqueezeBERT, and InceptionV3, respectively compared to unpartitioned execution. Furthermore, while DNN-SMO assumes 32-bit floating point data, we also propose a second optimizer which optimizes both the mapping to processing elements and quantization of DNN operations. Because quantization results in accuracy drops compared to fp32, this is a multi-objective optimization problem, resulting in an accuracy-latency Pareto optimal set of models, rather than a single optimal configuration. Using this method, we find that BERT can be accelerated by over 60\% compared to fp32 inference on the CPU. Furthermore, we find up to 20\% acceleration over int8 quantization while maintaining accuracy comparable to fp32. Additionally, due to limitations in existing edge inference frameworks, especially with respect to quantization support, we developed a BERT implementation based on ARM Compute Library (ARMCL), which we call ARMCL BERT. Using ARMCL BERT, we are able to measure the performance and energy consumption of BERT models on different ARM based edge devices, on both the CPU and GPU, and at fp32, fp16, and int8 precisions. We also explore the performance of popular BERT variations, most importantly I-BERT. However, the main point of developing ARMCL BERT is to enable the multi-objective optimization of both quantization and device assignment, which was not possible using existing frameworks
Degree
thesis:*- Name thesis:degree_name
- Master of Science
- Grantor dc:publisher
- McGill University
- Year dc:date.issued
- 2023
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Kornelsen, Murray
- Advisor dc:contributor.advisor
-
- Gross, Warren (Supervisor)
Subjects
dc:subject × 1Rights
dc:rights- Statement dc:rights
-
- All items in eScholarship@McGill are protected by copyright with all rights reserved unless otherwise indicated.
- Language dc:language.iso
- en
Identifiers
dc:identifier.*- OCLC
- 1432025609
- Identifier URI
- https://hdl.handle.net/20.500.14905/107923
- Dc Identifier Other
- hyrax:gf06g783t