[PATCH] D76912: [MLIR] Add simple runner utilities for timing

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 02:42:51 PDT 2020


bondhugula marked 4 inline comments as done.
bondhugula added a comment.

Thanks for the review.



================
Comment at: mlir/lib/ExecutionEngine/RunnerUtils.cpp:113
+extern "C" void print_flops(double flops) {
+  std::cerr << flops / 1.0E9 << " GFLOPS" << std::endl;
+}
----------------
ftynse wrote:
> Ultra-nit: the code below uses C-style I/O, let's be consistent here.
Thanks - changed to C style.


================
Comment at: mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir:1
+// RUN: mlir-opt -convert-linalg-to-loops -lower-affine -convert-loop-to-std -convert-std-to-llvm %s | mlir-cpu-runner -O3 -e main -entry-point-result=void -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext | FileCheck %s
+
----------------
ftynse wrote:
> Do we actually need the entire sgemm with non-trivial pipeline to test the flops printing utility?
This is for both - flops printing and timing. We don't need sgemm in particular; could have used say sdot as something minimal where the FLOPS would still be meaningful. But I reduced the problem size to something really small - so it shouldn't matter (exec time is 0.002s), and this could be an additional integration test for mlir-cpu-runner.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76912





More information about the llvm-commits mailing list