Slide 1

Slide 1 text

Further Reading https://compilergym.ai

Slide 2

Slide 2 text

Public Leaderboard https://compilergym.ai Submit your results here! https://github.com/facebookresearch/ CompilerGym#leaderboards

Slide 3

Slide 3 text

Adding a New Compiler https://compilergym.ai Your compiler here! CUDA Compiler Service LLVM Compiler Service Compiler APIs Feature Extractors Compiler APIs Feature Extractors Compiler Service Interface Frontend Library User-facing APIs Error handling and recovery Command Line Tools ... ...

Slide 4

Slide 4 text

Adding a New Compiler https://compilergym.ai from compiler_gym.service import CompilationSession from compiler_gym.service.runtime import create_and_run_compiler_gym_service class MyCompilationSession(CompilationSession): """Class representing a compilation session.""" # what your compiler can do: action_spaces: List[ActionSpace] = [] # what features your compiler provides: observation_spaces: List[ObservationSpace] = [] def __init__(self, action_space, benchmark): pass # start a new compilation session def apply_action(self, action): pass # apply an action def get_observation(self, observation_space): pass # compute and return an observation if __name__ == "__main__": create_and_run_compiler_gym_service(MyCompilationSession)

Slide 5

Slide 5 text

Adding a New Compiler https://compilergym.ai Feature Extractors #include "compiler_gym/service/CompilationSession.h" #include "compiler_gym/service/runtime/Runtime.h" using namespace compiler_gym; struct MyCompilationSession: public CompilationSession{ vector getActionSpaces() {...} vector getObservationSpaces() {...} Status init( const ActionSpace& actionSpace, const Benchmark& benchmark) {...} Status applyAction( const Action& action, bool& endOfEpisode, bool& actionSpaceChanged) {...} Status setObservation( const ObservationSpace& observationSpace, Observation& observation) {...} }; int main(int argc, char** argv) { runtime::createAndRunService(argc, argv, "My compiler service"); }

Slide 6

Slide 6 text

The Future https://compilergym.ai Scaling Search Space Size Today 6-12 months 1-5 years Phase ordering: 10200, Command line: 104000 Loop level: 1010 Instruction level, all opts: 1010 10 5