[PATCH] D115306: [NFC][mlgo] Generalize model runner interface

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 7 16:29:14 PST 2021


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

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115306

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115306.392593.patch
Type: text/x-patch
Size: 19692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211208/77273d28/attachment.bin>


More information about the llvm-commits mailing list