tree: 4110a82a6738d7cead15c97c36dc6a42b07f82b7
  1. build_clang_for_corpus.sh
  2. build_clang_for_training.sh
  3. Dockerfile
  4. extract_corpus.sh
  5. generate_default_trace.sh
  6. generate_vocab.sh
  7. init.sh
  8. README.md
  9. run_everything.sh
  10. train_bc.sh
  11. train_with_es.sh
docs/llvm/README.md

LLVM MLGO Inliner Demo

1. Build the Docker Image

From the repository root, build the demo environment container:

docker build -t ml-compiler-opt-llvm docs/llvm/

2. Run the Container

Run the container with volume mounts to persist corpus data, training logs, and checkpoints locally. This enables running TensorBoard on the host to monitor training.

docker run -it \
  -v "$(pwd):/work/ml-compiler-opt" \
  -v "$(pwd)/local_logs:/work/corpus/" \
  ml-compiler-opt-llvm /bin/bash

3. Run the Training Pipeline

Inside the container, execute the entire end-to-end pipeline:

./docs/llvm/run_everything.sh

4. Monitor Training Progress

To monitor the training progress using TensorBoard, run the following command on your host machine pointing to the mounted logs directory:

tensorboard --logdir local_logs

5. Script Flags Documentation

If you want to understand or customize the flags used in the training pipeline scripts (like train_bc.py), you can:

  • Run with --help: Use the --help flag with any of the Python scripts to print all available command-line flags and their descriptions:
    PYTHONPATH=. python3 compiler_opt/rl/train_bc.py --help
    
  • View Source Code Definitions: The flags are defined inline within their respective Python files (such as train_bc.py).