Skip to content

Validate optimization hint values against Tile IR constraints #208

Description

@elibol

Optimization hints are forwarded to the backend without value validation. The Tile IR spec constrains each hint, but cutile only checks that the value is an integer, so an out of range value becomes a late tileiras verifier error instead of an early cutile error with a source location.

Constraints per the Tile IR attribute definitions:

Hint Constraint
num_cta_in_cga power of 2 in [1, 16]
occupancy integer in [1, 32]
num_worker_warps_per_cta power of 2 in [1, 32]
latency (op level) integer in [1, 10]

We should validate at both entry points: the optimization_hints macro path (SMHints setters) and the runtime CompileOptions builder. Each should reject out of range values with an error that states the valid range. The book and host-api reference should document the ranges next to each hint.

Came up in #206, where the forwarding test used values the backend verifier rejects. Version compatibility is already enforced (the 13.3 gate for num_worker_warps_per_cta); this issue is about value constraints only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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