iree-org / iree-org/fusilli

Custom op & shape handling

Open
#233 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
25
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Custom ops are opaque blobs of MLIR asm that Fusilli gets from the user and feeds through to the IREE compiler as is. To make authoring these custom ops easy, certain things (like shapes, types) maybe left unmaterialized for Fusilli to materialize.

For shapes, there are a few options at our disposal:

- Option 1: Custom MLIR with full static shapes
- Option 2: Custom MLIR with full dynamic shapes + user provided shape replacement dict
- Option 3: Custom MLIR with full dynamic shapes + torch shape inference

We currently support option 3 in Fusilli.

Option 2 (with user provided shape dict) is not desirable for two reasons:
a) If user goes the extra mile to specify shape replacements, why not just do the shape replacement themselves and give Fusilli a static MLIR (option 1) to begin with?
b) Verifying that the user provided shape replacements match the actual shapes from TensorAttr at runtime

Option 1 is doable but won't work OOTB today due to the dynamic shape casts. But probably easy to fix by taking a bool attr on the custom op `isDynamic` or something.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.