Galaxy: A Resource-Efficient Collaborative Edge AI System for In-situ Transformer Inference

Shengyuan Ye, Jiangsu Du, Liekang Zeng, Wenzhong Ou, Xiaowen Chu, Yutong Lu, Xu Chen

Introduction

Transformer-based models like BERT and GPT have set new standards for AI performance, yet their deployment remains largely centralized in massive cloud data centers. This reliance on the cloud for edge applications—such as smart home assistants or mobile robots—introduces significant challenges regarding data privacy, network latency, and the sheer resource constraints of individual edge devices.

Smart-home Voice Assistant scenario using Galaxy for collaborative inference across multiple devices.

Galaxy is a resource-efficient collaborative system designed to address these hurdles. By pooling the idle resources of nearby gadgets (e.g., tablets, smart TVs, and speakers), Galaxy enables low-latency Transformer inference directly at the edge. This "in-situ" approach keeps sensitive data local while overcoming the memory and compute limitations of single devices.

The Challenge of Edge Inference

Current edge AI often offloads processing to the cloud because a single smart speaker lacks the RAM to store billions of parameters. While parallelization across multiple local devices is a potential solution, traditional methods fall short for the "single-shot" requests typical of voice assistants:

  • Data Parallelism: Efficient for large batches but adds no benefit for a single command, as it requires multiple data samples to be processed simultaneously to gain speed.
  • Pipeline Parallelism: Introduces "bubbles" or idle periods where devices wait for sequential stages to complete, leading to underutilization of hardware.
Data Parallelism, which requires multiple input samples to distribute work, making it unsuitable for single-shot edge commands.

The Galaxy Architecture

Galaxy introduces three core innovations to optimize collaborative inference on heterogeneous edge hardware:

1. Hybrid Model Parallelism (HMP)

Galaxy employs a novel hybrid approach that alternates between Tensor Parallelism (TP) and Sequence Parallelism (SP). By splitting both weight matrices and input sequences strategically, the system minimizes redundant computations and reduces the frequency of inter-device communication, which is often the primary bottleneck in home Wi-Fi environments.

2. Heterogeneity-Aware Workload Planning

Edge environments are inherently diverse. Galaxy’s "Planner" uses a two-step heuristic to assign workloads based on each device's specific compute capacity. Crucially, it incorporates memory-aware constraints to prevent Out-of-Memory (OOM) errors, allowing the system to run large models like GPT2-L on devices with as little as 1.5GB of RAM.

3. Tile-based Fine-grained Overlapping

To mitigate the impact of slow edge networks, Galaxy breaks down matrix multiplications into smaller "tiles." This allows devices to overlap computation and communication: while a device calculates the next tile, it simultaneously transmits the results of the previous one. This technique effectively "hides" communication latency behind useful work.

Evaluation and Results

The researchers evaluated Galaxy using five Transformer models ranging from 66 million to 2.7 billion parameters (including DistilBert, GPT2-L, and OPT-XL) on the QNLI corpus.

Key findings include:

  • Performance: Galaxy achieved up to a 2.5× speedup in end-to-end latency compared to state-of-the-art methods like Megatron-LM.
  • Scaling Efficiency: In a four-device configuration, the system maintained an 86% scaling efficiency, demonstrating minimal overhead.
  • Feasibility: Galaxy successfully executed the OPT-XL (2.7B parameters) model across four edge devices—a task impossible for any of the devices to handle individually due to memory constraints.

Conclusion and Future Directions

Galaxy demonstrates that collaborative edge AI is a viable path toward private, low-latency, and resource-efficient smart environments. By turning idle household electronics into a temporary ad-hoc supercomputer, it breaks the "memory wall" of individual devices. Future research will focus on handling dynamic device entry/exit (stragglers), enhancing security protocols between collaborating nodes, and optimizing the total energy footprint of distributed inference.

Summary updated

BibTeX
@inproceedings{ye2024galaxy,
  author = {Shengyuan Ye and Jiangsu Du and Liekang Zeng and Wenzhong Ou and Xiaowen Chu and Yutong Lu and Xu Chen},
  title = {{Galaxy: A Resource-Efficient Collaborative Edge AI System for In-situ Transformer Inference}},
  booktitle = {INFOCOM},
  year = {2024},
  doi = {10.1109/infocom52122.2024.10621342},
}
Figure