[all-commits] [llvm/llvm-project] 059e03: [NFC][mlgo] Generalize model runner interface

Mircea Trofin via All-commits all-commits at lists.llvm.org
Wed Dec 8 20:11:17 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 059e03476cbbb7349b75fa9cc26bc9da0d491529
      https://github.com/llvm/llvm-project/commit/059e03476cbbb7349b75fa9cc26bc9da0d491529
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2021-12-08 (Wed, 08 Dec 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/MLModelRunner.h
    A llvm/include/llvm/Analysis/NoInferenceModelRunner.h
    M llvm/include/llvm/Analysis/Utils/TFUtils.h
    M llvm/lib/Analysis/CMakeLists.txt
    M llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
    M llvm/lib/Analysis/MLInlineAdvisor.cpp
    A llvm/lib/Analysis/NoInferenceModelRunner.cpp
    M llvm/lib/Analysis/ReleaseModeModelRunner.cpp
    M llvm/unittests/Analysis/CMakeLists.txt
    A llvm/unittests/Analysis/MLModelRunnerTest.cpp

  Log Message:
  -----------
  [NFC][mlgo] Generalize model runner interface

This prepares it for the regalloc work. Part of it is making model
evaluation accross 'development' and 'release' scenarios more reusable.
This patch:
- extends support to tensors of any shape (not just scalars, like we had
in the inliner -Oz case). While the tensor shape can be anything, we
assume row-major layout and expose the tensor as a buffer.
- exposes the NoInferenceModelRunner, which we use in the 'development'
mode to keep the evaluation code path consistent and simplify logging,
as we'll want to reuse it in the regalloc case.

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




More information about the All-commits mailing list