Skip to content

Investigate infer_shape database #2137

@ricardoV94

Description

@ricardoV94

Description

This includes some rewrites that get called to figure out static shape for ops whose shapes depend on numerical values (not just their shapes), like Alloc / RandomVariable(size=...), and likely some more. They serve to figure out static shape and (more critical) broadcastability.

However the rewrites are chosen semi-hazardly. We should do a proper investigation of the minimum subset needed. I suspect we sometimes end up doing more work to arrive at the same solution. Or ordering may be suboptimal, like if we have shape(x) where x has static shape, we should run the rewrite that replaces it by static shape first, and not spend cycles rewriting x.

Then the question of including or excluding "shape_unsafe" rewrites.

This is important to get right, because when rewriting graphs with these operations, the inner rewrite pass will be called every time we create such nodes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions