A Structure-Aware Framework for Learning Device Placements on Computation Graphs

Shukai Duan, Heng Ping, Nikos Kanakaris, Xiongye Xiao, Panagiotis Kyriakis, Nesreen K. Ahmed, Peiyu Zhang, Guixiang Ma, Mihai Capotă, Shahin Nazarian, Theodore L. Willke, Paul Bogdan

Abstract

As neural network architectures grow in complexity and scale, the challenge of efficiently distributing computational workloads across heterogeneous hardware—comprising CPUs, integrated GPUs (iGPUs), and discrete GPUs (dGPUs)—becomes increasingly critical. This paper presents HSDAG (Hierarchical Structure-Aware Device Assignment Graph), a reinforcement learning (RL) framework designed to optimize device placement. By integrating structure-aware features, such as fractal dimensions and topological encodings, with a Graph Parsing Network (GPN), HSDAG jointly learns to group operations and assign them to hardware. Experimental results on BERT, ResNet-50, and Inception-V3 demonstrate significant performance gains, including up to a 58.2% speedup in inference time compared to CPU-only execution.

1. Introduction

The deployment of massive AI models, such as Large Language Models (LLMs) and Foundation Models, often exceeds the capacity of a single hardware device. Modern computing environments typically feature a mix of processing units, yet the "device placement problem"—determining which specific mathematical operation should run on which piece of hardware to minimize latency—remains a bottleneck. Traditional manual heuristics are often suboptimal, while existing automated solutions frequently fail to account for the intrinsic Directed Acyclic Graph (DAG) nature of computation or struggle with the massive search space of fine-grained graphs.

2. The HSDAG Framework

HSDAG addresses these challenges through a five-step pipeline that emphasizes structural awareness and search-space efficiency.

2.1 Graph Construction and Coarsening

To manage the complexity of raw computation graphs (e.g., from TensorFlow or PyTorch), HSDAG utilizes the OpenVINO toolkit to generate coarsened representations. This step applies co-location heuristics to group operations that must remain together, significantly reducing the number of nodes the RL agent must process.

2.2 Structure-Aware Feature Extraction

A core innovation of HSDAG is its "secret sauce" of feature extraction, which captures the graph's geometry at multiple scales:

  • Local Features: Standard metrics such as in-degree and out-degree of nodes.
  • Global Features: Multifractal analysis is employed to describe the hierarchical, repeating structures inherent in neural networks. This allows the agent to understand computational density and complexity better than simple connectivity metrics.
  • Positional Features: Sine and cosine encodings, similar to those used in Transformer architectures, are applied to represent the topological order of operations.

2.3 Joint Learning and Policy Optimization

Unlike prior "grouper" methods that rely on fixed clusters, HSDAG uses a Graph Parsing Network (GPN) to learn node embeddings and graph partitioning simultaneously. This allows the framework to discover the optimal number of clusters dynamically. These learned clusters are then fed into a Multi-Layer Perceptron (MLP) "placer," which assigns them to available hardware devices.

2.4 Reinforcement Learning

The entire pipeline is trained end-to-end using the REINFORCE algorithm. The reward signal is defined as the inverse of the actual execution time on real hardware, ensuring the model optimizes for real-world performance rather than proxy metrics.

3. Experimental Evaluation

3.1 Setup

The framework was benchmarked using three diverse architectures:

  • Inception-V3: A CNN characterized by parallel branches.
  • ResNet-50: A standard image classification model utilizing residual connections.
  • BERT-base (uncased): A transformer-based language model.

The hardware environment consisted of an Intel i9-12900K CPU, an Intel UHD 770 iGPU, and an Intel Data Center GPU Flex 170.

3.2 Results

HSDAG consistently outperformed CPU-only, GPU-only, and existing AI-driven placers like Placeto:

  • BERT: Achieved a 58.2% speedup over CPU-only execution, notably outperforming the GPU-only baseline (56.5%).
  • ResNet-50: Delivered a 52.1% speedup over CPU-only execution.
  • Inception-V3: Showed a 17.9% improvement over baseline.

3.3 Ablation and Efficiency

Ablation studies confirmed that removing topological data (node IDs) or output shape features led to significant performance degradation, proving that the model successfully leverages structural data. Furthermore, HSDAG demonstrated higher training and execution efficiency than RNN-based placers, largely due to its effective graph coarsening strategy.

4. Discussion and Future Work

While HSDAG represents a significant step forward, several areas for improvement remain. Current measurements do not account for environmental factors like thermal throttling, which can impact long-running tasks. Additionally, while the framework excels on Intel hardware, future research should explore its generalizability to NVIDIA/AMD GPUs and specialized accelerators like TPUs. The ultimate goal remains a "zero-shot" placer capable of optimizing brand-new architectures without requiring retraining.

5. Conclusion

HSDAG demonstrates that by treating computation graphs as structured, fractal entities rather than simple lists of operations, reinforcement learning agents can achieve superior device placement. By bridging the gap between graph encoders and operation groupers, HSDAG provides a robust, automated path toward maximizing the potential of heterogeneous hardware for modern AI workloads.

Summary updated

BibTeX
@inproceedings{duan2024structure,
  author = {Shukai Duan and Heng Ping and Nikos Kanakaris and Xiongye Xiao and Panagiotis Kyriakis and Nesreen K. Ahmed and Peiyu Zhang and Guixiang Ma and Mihai Capotă and Shahin Nazarian and Theodore L. Willke and Paul Bogdan},
  title = {{A Structure-Aware Framework for Learning Device Placements on Computation Graphs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=Kzno1r3Xef},
}
Figure