Skip to content

Generating MLIR code with dynamic dimensions via Reactant? #2809

@oschulz

Description

@oschulz

Reactant may be an awesome way to export, share and preserve scientific models (not just ML, also simulation code, etc.) written in Julia, so they can be used beyond Julia.

One problem I've run into while exploring this is how to generate StableHLO code that doesn't hardcode batch size. For example, when doing a multi-particle simulation, the exported StableHLO shouldn't hardcode the number of particles - batch size should still be flexible depending on user need and target hardware.

StableHLO itself support things like tensor<?x128xf32> right? And maybe the ? could then even be rewritten to a fixed size at the point/time of use? I've read that JAX export supports emitting StableHLO with ? dimensions via polymorphic_shapes, but I'm not an expert. Can/could Reactant support this as well?

This could be very relevant for a new project that I'm part of.

Metadata

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