MagPy is a JIT compiler for PyTorch programs. It can extract the operator graph from PyTorch programs and optimize the graph with a wide range of deep learning graph compilers.
MagPy now supports Python 3.9. The support of other Python versions is working in progress.
pip install -r requirements.txt -f https://download.pytorch.org/whl/torch_stable.html
pip install -e .
cd scripts
./compile_longobj.sh
The following script compiles and runs a simple PyTorch program with MagPy.
LD_PRELOAD=build/ldlong.v3.9.12.so python test/example.py
If you find MagPy useful in your research, please consider citing the following paper:
MagPy: Effective Operator Graph Instantiation for Deep Learning by Execution State Monitoring; Chen Zhang, Rongchao Dong, Haojie Wang, Runxin Zhong, Jike Chen, and Jidong Zhai, Tsinghua University; will be appeared in USENIX ATC'24.