[Paper Review] M$^3$ViT: Mixture-of-Experts Vision Transformer for Efficient Multi-task Learning with Model-Accelerator Co-design
M3ViT integrates mixture-of-experts layers into a Vision Transformer for efficient multi-task learning, enabling task-specific sparse routing during training and inference, with FPGA-based hardware co-design for memory- and energy-efficient on-device deployment.
Multi-task learning (MTL) encapsulates multiple learned tasks in a single model and often lets those tasks learn better jointly. However, when deploying MTL onto those real-world systems that are often resource-constrained or latency-sensitive, two prominent challenges arise: (i) during training, simultaneously optimizing all tasks is often difficult due to gradient conflicts across tasks; (ii) at inference, current MTL regimes have to activate nearly the entire model even to just execute a single task. Yet most real systems demand only one or two tasks at each moment, and switch between tasks as needed: therefore such all tasks activated inference is also highly inefficient and non-scalable. In this paper, we present a model-accelerator co-design framework to enable efficient on-device MTL. Our framework, dubbed M$^3$ViT, customizes mixture-of-experts (MoE) layers into a vision transformer (ViT) backbone for MTL, and sparsely activates task-specific experts during training. Then at inference with any task of interest, the same design allows for activating only the task-corresponding sparse expert pathway, instead of the full model. Our new model design is further enhanced by hardware-level innovations, in particular, a novel computation reordering scheme tailored for memory-constrained MTL that achieves zero-overhead switching between tasks and can scale to any number of experts. When executing single-task inference, M$^{3}$ViT achieves higher accuracies than encoder-focused MTL methods, while significantly reducing 88% inference FLOPs. When implemented on a hardware platform of one Xilinx ZCU104 FPGA, our co-design framework reduces the memory requirement by 2.4 times, while achieving energy efficiency up to 9.23 times higher than a comparable FPGA baseline. Code is available at: https://github.com/VITA-Group/M3ViT.
Motivation & Objective
- Address training gradient conflicts in multi-task learning within compact models.
- Enable efficient one-task-at-a-time inference by sparsely activating task-specific experts.
- Develop hardware-aware MoE-ViT design to minimize memory and energy costs on edge devices.
Proposed method
- Replace dense MLPs in ViT with sparsely activated Mixture-of-Experts layers.
- Use a task-dependent router to select a subset of experts per input token.
- Introduce task-conditioned and multi-gate MoE variants for MTL routing.
- Apply a memory-efficient computation reordering on FPGA to enable expert-by-expert processing.
- Demonstrate zero-overhead task switching with the hardware design.
Experimental results
Research questions
- RQ1Can MoE layers mitigate cross-task gradient conflicts in dense vision transformers for MTL?
- RQ2Does task-specific sparse routing improve single-task inference efficiency without sacrificing accuracy?
- RQ3How can hardware co-design (memory-aware computation) scale MoE for multiple experts and tasks on FPGA?
- RQ4What are the comparative gains in accuracy, FLOPs, memory, and energy for M3ViT vs encoder-focused MTL models on standard dense-prediction benchmarks?
Key findings
- M3ViT achieves higher accuracy than encoder-focused MTL methods on assessed tasks.
- Single-task inference with M3ViT reduces inference FLOPs by 88%.
- On FPGA, memory usage drops by 2.40× and energy efficiency improves up to 9.23× over FPGA baselines and up to 10.79× over GPU baselines.
- MoE-based variants (Single, Multi, Task-conditioned) show that task-dependent MoE design improves MTL performance, especially as task count increases.
- Hardware-aware computation reordering enables zero-overhead task/frame switching and scales with any number of experts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.