https://github.com/knight-x/rlens
https://github.com/knight-x/rlens
compiler-optimization-pass llvm machine-learning register-allocation reinforcement-learning
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/knight-x/rlens
- Owner: Knight-X
- Created: 2018-02-22T02:48:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-19T06:45:10.000Z (over 7 years ago)
- Last Synced: 2025-04-01T21:15:24.685Z (12 months ago)
- Topics: compiler-optimization-pass, llvm, machine-learning, register-allocation, reinforcement-learning
- Language: Python
- Size: 97.7 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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:
1. allocate virtual register to physical register
2. traditionally, it was np-complete problem with graph-color strategy
purpose:
1. reduce data dependency
2. target-dependent allocation strategy
usage:
1. cd llvm && git checkout rpc && build [LLVM BUILD](https://llvm.org/docs/GettingStarted.html#compiling-the-llvm-suite-source-code)
2. llc -emit-llvm -S targetfile
3. mv targetfile program/
4. modify src field of rlcofnig to targetfile name
5. 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