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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 18:15:29 PST 2021


mtrofin added inline comments.


================
Comment at: llvm/include/llvm/Analysis/MLModelRunner.h:41-45
+  virtual void *evaluateUntyped() = 0;
+  virtual void *getTensorUntyped(size_t Index) = 0;
+  const void *getTensorUntyped(size_t Index) const {
+    return (const_cast<MLModelRunner *>(this))->getTensorUntyped(Index);
+  }
----------------
yundiqian wrote:
> do they need to be public?
I think I may need them in a subsequent patch, but I can move them to public then.


================
Comment at: llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:269
 /// sacrificed for ease of use while training.
 class ModelUnderTrainingRunner final : public MLModelRunner {
 public:
----------------
yundiqian wrote:
> will part of it get re-factored out of inline to common lib?
I'd like to, yes. Same with the log population from the evaluator - it's pretty generic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115306/new/

https://reviews.llvm.org/D115306



More information about the llvm-commits mailing list