Skip to content

Evaluate numba-mlir and related passes for a more principled frontend #1394

Open
@j2kun

Description

In a pair programming session today, we discovered numba-mlir https://github.com/numba/numba-mlir a proof of concept to replace numba's current LLVM backend with an MLIR-based backend. This is not necessarily usable as-is, but it's interesting because they have MLIR passes that we might one day be able to adapt to our purposes, some of which have been upstreamed.

For example, lift-cf-to-scf and the underlying CFGtoSCF could be something we use to avoid having to recognize and emit loops in the frontend. I.e., we could emit cf dialect ops to MLIR, and then call that pass to lift to scf, and then call a polygeist-inspired pass to lift scf to affine, or else support scf in our pipelines directly.

I think that would be a nice way to do it in the long term, though it would take some extra infrastructure to manage since the lift-cf-to-scf doesn't seem to recognize static loop bounds, which is critical for us in FHE.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions