rlens: compiler optimization framework
Introduction
rLens is an compiler optimization framework via reinforcement learning. The project could optimize register allocation for graph computing like problem in different environment, such as compiler, deep learning framework.
Register Allocation:
- allocate virtual register to physical register
- traditionally, it was np-complete problem with graph-color strategy
purpose:
- reduce data dependency
- target-dependent allocation strategy
usage:
- cd llvm && git checkout rpc && build LLVM BUILD
- llc -emit-llvm -S targetfile
- mv targetfile program/
- modify src field of rlcofnig to targetfile name
- python train_pg.py CartPole-v0 -n 50000 -b 5000 -e 1 -rtg -dna --exp_name test_compiler_softmax_falut_test_norandom python train_pg.py -h for more information
Result:
reference:
https://github.com/berkeleydeeprlcourse/homework