LIFT: LLM-Based Pragma Insertion for HLS via GNN Supervised Fine-Tuning
Neha Prakriya, Zijian Ding, Yizhou Sun, Jason Cong
TL;DR
LIFT tackles the challenge of automatic pragma insertion in HLS by marrying an LLM with graph-based structural supervision to capture the semantic and microarchitectural effects of pragmas. The method uses Infilling by Language Modeling to predict missing pragma factors, and supervises the LLM with a lightweight GNN via ProGraML-encoded program graphs, combining a token-level loss with a graph-embedding loss and latency-aware weighting. Training on the HLSyn dataset with intelligent resampling and a 3-epoch workflow on 8 GPUs yields large QoR gains, achieving up to $3.52\times$ faster latency than AutoDSE-24h, $2.16\times$ faster than HARP, and $66\times$ faster than GPT-4o, while maintaining high validity across designs. LIFT also demonstrates robustness to tool-version shifts, outperforming prior GNN-based approaches by about $2.74\times$ under Vitis 2021.1, indicating strong generalization. Overall, LIFT advances LLM-guided hardware design by integrating structural semantics, failure-aware learning, and latency optimization into a single, scalable framework.
Abstract
FPGAs are increasingly adopted in datacenter environments for their reconfigurability and energy efficiency. High-Level Synthesis (HLS) tools have eased FPGA programming by raising the abstraction level from RTL to untimed C/C++, yet attaining high performance still demands expert knowledge and iterative manual insertion of optimization pragmas to modify the microarchitecture. To address this challenge, we propose LIFT, a large language model (LLM)-based coding assistant for HLS that automatically generates performance-critical pragmas given a C/C++ design. We fine-tune the LLM by tightly integrating and supervising the training process with a graph neural network (GNN), combining the sequential modeling capabilities of LLMs with the structural and semantic understanding of GNNs necessary for reasoning over code and its control/data dependencies. On average, LIFT produces designs that improve performance by 3.52x and 2.16x than prior state-of the art AutoDSE and HARP respectively, and 66x than GPT-4o.
