aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2023-01-26 07:58:17 -0800
committerMircea Trofin <mtrofin@google.com>2023-01-27 17:03:28 -0800
commit5b8dc7c8a55269aa438c6639a7ce22e6b99b1844 (patch)
tree6accb8da451f881cdb652cfbd2046b1f81e1004d /clang/lib/Basic/SourceManager.cpp
parentaad5984b56280d7dc71a43c258c5ed349c9a239f (diff)
downloadllvm-5b8dc7c8a55269aa438c6639a7ce22e6b99b1844.zip
llvm-5b8dc7c8a55269aa438c6639a7ce22e6b99b1844.tar.gz
llvm-5b8dc7c8a55269aa438c6639a7ce22e6b99b1844.tar.bz2
[mlgo] Introduce an "InteractiveModelRunner"
This is a model runner for ML researchers using environments like CompilerGym. In such environments, researchers host the compiler and want to be able to observe the problem space (features) at each decision step of some optimization pass, at which point the compiler is stopped, waiting for the host makes a decision and provide an advice back to the compiler, which then continues its normal operation, and so on. The InteractiveModelRunner supports this scenario for the feature set exposed by the compiler at a given time. It uses 2 files - ideally FIFO pipes - one to pass data to the host, the other to get advices back from the host. This means this scenario is supported with no special dependencies. The file creation and deletion is the responsibility of the host. Hooking up this model evaluator to a MLGO-ed pass is the responsibilty of the pass author, and subsequent patches will do so for the current set of mlgo passes, and offer an API to easily "just opt in" by default when mlgo-ing a new pass. The data protocol is that of the training logger: the host sees a training log doled out observation by observation by reading from one of the files, and passes back its advice as a serialized tensor (i.e. tensor value memory dump) via the other file. There are some differences wrt the log seen during training: the interactive model doesn't currently include the outcome (because it should be identical to the decision, and it's also not present in the "release" mode); and partial rewards aren't currently communicated back. The assumption - just like with the training logger - is that the host is co-located, thus avoiding any endianness concerns. In a distributed environment, it is up to the hosting infrastructure to intermediate that. Differential Revision: https://reviews.llvm.org/D142642
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions