Skip to content

Render JIT compile/verify errors as Python-native tracebacks #671

@sjfeng1999

Description

@sjfeng1999

The result reads nothing like a Python error: no clickable jump, no caret, no
hint. A user hits

  MLIRError: error: ".../gemm.py":612:16: 'arith.uitofp' op operand #0 must be
  signless-fixed-width-integer-like, but got 'index'

and has to mentally map it back to their code, with the real call site hidden in
framework noise.

We expected

Traceback (most recent kernel call):
  File ".../gemm.py", line 612, in kernel_mxscale_gemm
    scale = float(idx) / 2.0
            ^^^^^^^^^^
CompileError: 'arith.uitofp' operand #0 must be signless integer, got 'index'

Wrap verify() and render the diagnostic's structured
location into a Python-style traceback

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions