[all-commits] [llvm/llvm-project] c35ad9: [mlgo] Support exposing more features than those s...

Mircea Trofin via All-commits all-commits at lists.llvm.org
Mon May 9 18:01:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c35ad9ee4f21c03baaea65e2479e9d08c4b4acd2
      https://github.com/llvm/llvm-project/commit/c35ad9ee4f21c03baaea65e2479e9d08c4b4acd2
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2022-05-09 (Mon, 09 May 2022)

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

  Log Message:
  -----------
  [mlgo] Support exposing more features than those supported by models

This allows the compiler to support more features than those supported by a
model. The only requirement (development mode only) 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.

Differential Revision: https://reviews.llvm.org/D124565




More information about the All-commits mailing list