Page MenuHomePhabricator

[mlir] AsyncRuntime: use LLVM ThreadPool to run async tasks

Authored by ezhulenev on Dec 29 2020, 10:20 AM.




Can't reproduce the failures anymore. The original problem was the LLVM thread pool library was unloaded before the async runtime, but seems to be working now.

Diff Detail

Unit TestsFailed

140 msx64 debian > MLIR.mlir-cpu-runner::async-group.mlir
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/mlir-opt /mnt/disks/ssd0/agent/llvm-project/mlir/test/mlir-cpu-runner/async-group.mlir -async-ref-counting -convert-async-to-llvm -convert-std-to-llvm | mlir-cpu-runner -e main -entry-point-result=void -O0 -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/mlir/test/mlir-cpu-runner/async-group.mlir
170 msx64 debian > MLIR.mlir-cpu-runner::async.mlir
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/mlir-opt /mnt/disks/ssd0/agent/llvm-project/mlir/test/mlir-cpu-runner/async.mlir -async-ref-counting -convert-async-to-llvm -convert-linalg-to-loops -convert-linalg-to-llvm -convert-std-to-llvm | mlir-cpu-runner -e main -entry-point-result=void -O0 -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ -shared-libs=/mnt/disks/ssd0/agent/llvm-project/build/lib/ | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/mlir/test/mlir-cpu-runner/async.mlir

Event Timeline

ezhulenev created this revision.Dec 29 2020, 10:20 AM
ezhulenev requested review of this revision.Dec 29 2020, 10:20 AM
ezhulenev edited the summary of this revision. (Show Details)Dec 29 2020, 10:23 AM
ezhulenev added a reviewer: mehdi_amini.
mehdi_amini accepted this revision.Jan 4 2021, 9:43 AM

I'd still like to see the global ctor/dtor removed, this is incredibly fragile and known to cause issues. The solution of having a well-known interface to initialize/deinitialize mlir-cpu-runner plugins seems more robust (and portable) to me.

This revision is now accepted and ready to land.Jan 4 2021, 9:43 AM
ezhulenev abandoned this revision.Jan 6 2021, 1:55 AM

Judging by the build failures this still does not work. Will work on a "mlir-cpu-runner dylib unloading" in a separate PR.