This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Expand Tanh operations in StdToLLVM conversion
AbandonedPublic

Authored by ezhulenev on Jan 31 2021, 5:31 AM.

Details

Diff Detail

Event Timeline

ezhulenev created this revision.Jan 31 2021, 5:31 AM
ezhulenev requested review of this revision.Jan 31 2021, 5:31 AM
ezhulenev updated this revision to Diff 320349.Jan 31 2021, 5:41 AM

Remove test-expand-tanh pass

ezhulenev retitled this revision from [mlir] Add ExpandTanh pass to [mlir] Add `expand-tanh` pass.Jan 31 2021, 5:43 AM
ezhulenev edited the summary of this revision. (Show Details)
ezhulenev added a reviewer: ftynse.
Harbormaster completed remote builds in B87302: Diff 320350.
mehdi_amini requested changes to this revision.Jan 31 2021, 10:49 PM

Why does it make sense as a standalone pass rather than as part of a pipeline? This seems a bit "targeted" to go beyond a testing pass.

This revision now requires changes to proceed.Jan 31 2021, 10:49 PM
ezhulenev updated this revision to Diff 320442.Feb 1 2021, 5:03 AM

Populate expand-tanh patterns in std-to-llvm lowering

ezhulenev retitled this revision from [mlir] Add `expand-tanh` pass to [mlir] Expand Tanh operations in StdToLLVM conversion.Feb 1 2021, 5:04 AM
ezhulenev edited the summary of this revision. (Show Details)
ezhulenev updated this revision to Diff 320443.Feb 1 2021, 5:05 AM

Update CMakeLists

ftynse requested changes to this revision.Feb 1 2021, 5:17 AM

Could you rather explain what are you trying to achieve? This doesn't necessary make sense in the standard-to-llvm pass either (and the dependency from a conversion on an in-dialect transform looks weird to me). When this conversion was introduced, there were concerns about doing it inside the conversion because not all targets actually want it. In particular, NVVM and ROCm have intrinsics that tanh should be lowered to instead. The solution was to have it in a separate populate* function that the client can call when necessary.

This revision now requires changes to proceed.Feb 1 2021, 5:17 AM
ftynse added a comment.Feb 1 2021, 5:20 AM

Slightly longer-term, I think tanh should move to the math that is being split out of the standard, at which point we can have this as either a pass on math dialect (when we need to expand, potentially along with other ops that can be expanded within the dialect) or as a conversion from the math dialect to target-specific intrinsics.

ezhulenev abandoned this revision.Feb 1 2021, 5:30 AM

The solution was to have it in a separate populate* function that the client can call when necessary.

Yes, I also felt weird about adding Transforms->Conversion dependency. I think I'll add a target specific (TFRT cpu jit compilation) pass then (FYI cl/354793665)