[PATCH] D124565: [mlgo] Support exposing more features than those supported by models

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 15:34:02 PDT 2022


mtrofin created this revision.
mtrofin added reviewers: yundiqian, davidxl.
Herald added subscribers: hiraditya, mgorny, qcolombet, MatzeB.
Herald added a project: All.
mtrofin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This allows the compiler to support more features than those supported by a
model. The only requirement is that the new features must be appended
at the end of the list of features requested from the model. The support
is transparent to compiler code: for unsupported features, we provide a
valid buffer to copy their values; it's just that this buffer is
disconnected from the model, so insofar as the model is concerned (AOT
or development mode), these features don't exist. The buffers are
allocated at setup - meaning, at steady state, there is no extra allocation
(maintaining the current invariant). These buffers has 2 roles: one,
keep the compiler code simple. Second, allow logging their values in
development mode. The latter allows retraining a model supporting the
larger feature set starting from traces produced with the old model.

For release mode (AOT-ed models), this decouples compiler evolution from
model evolution, which we want in scenarios where the toolchain is
frequently rebuilt and redeployed: we can first deploy the new features,
and continue working with the older model, until a new model is made
available, which can then be picked up the next time the compiler is built.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124565

Files:
  llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
  llvm/include/llvm/Analysis/MLModelRunner.h
  llvm/include/llvm/Analysis/ModelUnderTrainingRunner.h
  llvm/include/llvm/Analysis/NoInferenceModelRunner.h
  llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
  llvm/include/llvm/Analysis/TensorSpec.h
  llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
  llvm/lib/Analysis/MLInlineAdvisor.cpp
  llvm/lib/Analysis/ModelUnderTrainingRunner.cpp
  llvm/lib/Analysis/NoInferenceModelRunner.cpp
  llvm/lib/Analysis/TFUtils.cpp
  llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
  llvm/unittests/Analysis/CMakeLists.txt
  llvm/unittests/Analysis/MLModelRunnerTest.cpp
  llvm/unittests/Analysis/TFUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124565.425630.patch
Type: text/x-patch
Size: 23878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220427/34b8cd40/attachment.bin>


More information about the llvm-commits mailing list