This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Specify cuda-runner pass pipeline as command line options.
ClosedPublic

Authored by csigg on Feb 19 2021, 2:32 PM.

Details

Summary

The cuda-runner registers two pass pipelines for nested passes,
so that we don't have to use verbose textual pass pipeline specification.

Diff Detail

Event Timeline

csigg created this revision.Feb 19 2021, 2:32 PM
csigg requested review of this revision.Feb 19 2021, 2:32 PM
mehdi_amini added inline comments.Feb 19 2021, 4:05 PM
mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
175

I'm not fond of exposing arbitrary pipeline to the runner, can we leave this to mlir-opt and pipe it to the runner instead? There is value in keeping the tools focused in the Unix-style, without loss of generality I think.

csigg added inline comments.Feb 20 2021, 7:27 AM
mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
175

I see your point, and this was intended as a step in that direction, at least allowing textual pass pipeline specification on the command line instead of hardcoding it in the cuda-runner.

  • I added gpu-to-async because I didn't know about PassManager::Nesting::Implicit. I can removed that again.
  • I added gpu-to-cuda-runtime because -gpu-to-llvm=nvvm.cubin looks pretty arbitrary (to be fair, nvvm.cubin is arbitraty too, but it needs to match the name used in gpu-to-cubin -- that pass pipeline should probably have the name as an option).

We will presumably need a cuda-opt though which runs or provides the gpu-to-cubin pipeline added here, because mlir-opt would not want to depend on CUDA.

I will make the above two changes here and leave the cuda-opt > mlir-opt > cpu-runner piping as a follow-up.

As a side note, the downside of tests piping code through tools is that it's harder to setup IDEs for debugging. When I debug an mlir-opt > cpu-runner test, I think twice before setting up proper debugging, add some printfs, waste time, and then do it anyway ;-)

csigg updated this revision to Diff 325236.Feb 20 2021, 1:17 PM

Only register the one required pass pipeline.

herhut accepted this revision.Feb 24 2021, 12:51 AM

lgtm for a first step in making the pass pipeline more configurable.

This revision is now accepted and ready to land.Feb 24 2021, 12:51 AM
This revision was landed with ongoing or failed builds.Feb 24 2021, 5:37 AM
This revision was automatically updated to reflect the committed changes.