面向圖神經網路策略模型之強化學習訓練加速
Accelerating Reinforcement Learning Training for Graph Neural Network–Based Policies
摘要
圖神經網路(Graph Neural Network, GNN)策略模型適用於具有圖結構觀測的強化學習問題,但其不規則資料表示與稀疏張量操作可能產生顯著的系統開銷。當以 CPU 執行的環境與以 GPU 執行的 GNN 策略模型互動時,訓練效能可能受限於環境執行、 圖資料傳輸、CPU–GPU 同步、圖批次建構及模型運算。
本論文提出一套單機 PPO 訓練加速框架,包含以多執行緒平行執行 C++ 環境的 ThreadVecEnv、GPU-resident rollout buffer、CPU–GPU 傳輸與同步最佳化,以及選擇性模型編譯。實驗以圖結構迷宮環境與圖注意力策略模型進行。結果顯示,完整框架相較於基準實作可提升 4.47 倍至 5.31 倍的端對端 PPO 訓練吞吐量,並降低約 10.7% 至11.2% 的峰值 GPU 記憶體使用量。上述方法保留原始 PPO 的最佳化目標、同步式rollout 與更新流程,以及 rollout 資料使用方式,在不改變演算法定義的前提下提升訓練效率。
本論文提出一套單機 PPO 訓練加速框架,包含以多執行緒平行執行 C++ 環境的 ThreadVecEnv、GPU-resident rollout buffer、CPU–GPU 傳輸與同步最佳化,以及選擇性模型編譯。實驗以圖結構迷宮環境與圖注意力策略模型進行。結果顯示,完整框架相較於基準實作可提升 4.47 倍至 5.31 倍的端對端 PPO 訓練吞吐量,並降低約 10.7% 至11.2% 的峰值 GPU 記憶體使用量。上述方法保留原始 PPO 的最佳化目標、同步式rollout 與更新流程,以及 rollout 資料使用方式,在不改變演算法定義的前提下提升訓練效率。
Graph neural network (GNN) policies are suitable for reinforcement learning problems with graph-structured observations, but their irregular data representations and sparse tensor operations can introduce substantial system overhead. When CPU-based environments interact with a GPU-based GNN policy, training performance may be limited by environment execution, graph-data transfer, CPU–GPU synchronization, graph-batch construction, and inefficient model execution.
This thesis presents a single-machine PPO acceleration framework that combines ThreadVecEnv for parallel C++ environment execution, a GPU-resident rollout buffer, CPU–GPU transfer and synchronization optimizations, and selective model compilation. Experiments using graph-based maze environments and a graph-attention policy model show that the complete framework improves end-to-end PPO training throughput by 4.47× to 5.31× while reducing peak GPU-memory usage by approximately 10.7% to 11.2%. The proposed methods preserve the original PPO optimization objective, synchronous rollout-and-update procedure, and rollout-data usage, thereby improving training efficiency without changing the algorithmic formulation.
This thesis presents a single-machine PPO acceleration framework that combines ThreadVecEnv for parallel C++ environment execution, a GPU-resident rollout buffer, CPU–GPU transfer and synchronization optimizations, and selective model compilation. Experiments using graph-based maze environments and a graph-attention policy model show that the complete framework improves end-to-end PPO training throughput by 4.47× to 5.31× while reducing peak GPU-memory usage by approximately 10.7% to 11.2%. The proposed methods preserve the original PPO optimization objective, synchronous rollout-and-update procedure, and rollout-data usage, thereby improving training efficiency without changing the algorithmic formulation.