openxla / stablehlo

Backward compatible ML compute opset inspired by HLO/MHLO
Apache License 2.0
415 stars 113 forks source link

Respect --mlir-print-op-generic in attribute prettyprinters #610

Open burmako opened 2 years ago

burmako commented 2 years ago

Attributes like ConvDimensionNumbers always prettyprint at the moment, regardless of --mlir-print-op-generic.

GleasonK commented 1 year ago

Two possible options:

  1. Don't have custom attribute printers, and handle this at the op pretty-print level. I.e. for ConvDimensionNumbers, don't specify custom mnemonic, or custom assembly for the attr, and instead on ops that use it, add custom assembly with custom<ConvolutionDimensions>
  2. Have an attr verifier. Attrs that use custom assembly that fail verification can get printed with a raw_ prefix.