Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LHY-24/AwareCompiler

Repository files navigation

AwareCompiler: Agentic Context-Aware Compiler Optimization

Official resources of "AwareCompiler: Agentic Context-Aware Compiler Optimization via a Synergistic Knowledge-Data Driven Framework". Hongyu Lin*, Haolin Pan*, Haoran Luo, Kaichun Yao, Yuchen Li, Libo Zhang, Mingjie Xing, Yanjun Wu. [paper]

License


Overview

Compiler optimization involves selecting and ordering optimization passes from a vast, structured space while preserving program correctness.
Although LLM-based agents show promise, existing approaches often suffer from:

  1. Semantic misalignment between abstract program features and concrete optimization passes
  2. Brute-force exploration with weak interaction between agents and compilers
  3. Sparse and delayed rewards in long-horizon optimization sequences

AwareCompiler addresses these challenges through a synergistic knowledge–data-driven framework, enabling context-aware, valid, and efficient optimization.

Framework

Experimental Setup

# Create and activate conda environment
conda create -n Aware-Compiler python==3.10
conda activate Aware-Compiler

# Initialize and update submodules
git submodule update --init --recursive

# Install verl and other dependencies
cd verl
pip3 install -e .
cd .. 
pip3 install vllm
pip3 install flash-attn --no-build-isolation
pip3 install FlagEmbedding
pip3 install faiss-cpu

Training

To run Experiment 1 and 2, follow these steps:

# dataset perparation
cd examples/data_preprocess
PYTHONPTYH="../../" python3 compiler_autotuning_sft.py
PYTHONPTYH="../../" python3 compiler_autotuning_rl.py
bash train_sft.sh
bash train_rl.sh

Inference

After training your models, follow these steps for inference:

  1. Merge model weights:
bash infer_model_merge.sh
  1. Deploy the vLLM Service:
bash infer_vllm_serve.sh
  1. Run inference:
bash infer_run.sh

📚 Citation

If you use AwareCompiler in your research, please cite:

@misc{lin2025awarecompileragenticcontextawarecompiler,
      title={AwareCompiler: Agentic Context-Aware Compiler Optimization via a Synergistic Knowledge-Data Driven Framework}, 
      author={Hongyu Lin and Haolin Pan and Haoran Luo and Yuchen Li and Kaichun Yao and Libo Zhang and Mingjie Xing and Yanjun Wu},
      year={2025},
      eprint={2510.11759},
      archivePrefix={arXiv},
      primaryClass={cs.PL},
      url={https://arxiv.org/abs/2510.11759}, 
}

Feedback

Contributions and feedback are greatly appreciated! Whether you've found a bug, have a question, or want to suggest improvements, please open an issue. Your input helps make AwareCompiler better for everyone.

For further questions, please contact: [email protected], [email protected], [email protected].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •