Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CGO'22 Tutorial Outro

CGO'22 Tutorial Outro

Chris Cummins

April 01, 2022
Tweet

More Decks by Chris Cummins

Other Decks in Research

Transcript

  1. 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 ... ...
  2. 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)
  3. 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<ActionSpace> getActionSpaces() {...} vector<ObservationSpace> 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<MyCompilationSession>(argc, argv, "My compiler service"); }
  4. 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