This is an archive of the discontinued LLVM Phabricator instance.

[mlir][TOSA] Set default TOSA validation level to 'None' for TOSA -> linalg
ClosedPublic

Authored by benmxwl-arm on Aug 7 2023, 6:46 AM.

Details

Summary

Unless otherwise specified this pass should not assume a level, as this
rejects otherwise valid TOSA. This has caused build failures in IREE.

The level (and other validation options) have now been made configurable.

The pass options have been converted to enums to make them more type
safe in C++.

Diff Detail

Event Timeline

benmxwl-arm created this revision.Aug 7 2023, 6:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 6:46 AM
benmxwl-arm requested review of this revision.Aug 7 2023, 6:46 AM
benmxwl-arm retitled this revision from [mlir][TOSA] Set default TOSA validation level to 'None' for TOSA -> lingal to [mlir][TOSA] Set default TOSA validation level to 'None' for TOSA -> linalg.Aug 7 2023, 7:16 AM
This revision is now accepted and ready to land.Aug 7 2023, 12:00 PM
mamrami added a subscriber: mamrami.Aug 8 2023, 8:28 AM

Can you add tests that show the change?
Thanks!

Can you add tests that show the change?
Thanks!

Hey, for the purposes of LLVM this is a non-functional change.
It just now allows passing ValidationOptions to tosa::addTosaToLinalgPasses() (with a default of none picked to match IREE's expectations), this is an API that's used in IREE, though not LLVM itself.

This was due to D154273 which added these level checks, which now needed some option for configuration.

So, unfortunately, I can't think of an easy little test case to add here, though I'm welcome to suggestions :)

Thanks! Now that I understand the change, I see why there are no tests.

If we could run addTosaToLinalgPasses pipeline using mlir-opt, I believe you could add a lit test that fails without your change.
But I see that we don't use PassPipelineRegistration on addTosaToLinalgPasses so we can't run the pipeline from mlir-opt.

@amirBish is going to upload a patch that combines addTosaToLinalgPasses parameters to TosaToLinalgOptions.
Once this is done, we can use PassPipelineRegistration and create lit tests for the pipeline.

Meanwhile I agree that there's no simple test that can be added.