yobx.tensorflow.ops.xla_call_module_parsing#
StableHLO MLIR → layer-dict parser for the XlaCallModule converter.
parse_mlir() is the public entry point. Low-level extraction utilities
that have no dependency on parsing state live in xla_call_module_helper.
- yobx.tensorflow.ops.xla_call_module_parsing.parse_ir_module(mlir_module) List[XlaLayer][source]#
Parses an MLIR
ir.Moduleusing Python bindings (JAX 0.10+).Walks MLIR operations directly without converting the module to a text string, so
loc(...)annotations are not required. Returns the same list ofXlaLayerobjects asparse_mlir().Must be called while an active MLIR context is open (e.g., inside a
with make_ir_context():block).- Parameters:
mlir_module – an
ir.Moduleobtained fromjax.extend.mlir.deserialize_portable_artifact.- Returns:
List of
XlaLayerobjects in the same format asparse_mlir().
- yobx.tensorflow.ops.xla_call_module_parsing.parse_mlir(mlir_string: str) List[XlaLayer][source]#
Parse a StableHLO MLIR module text into a list of
XlaLayerobjects.Each
XlaLayerhas at minimum the fields id, op, operands, shape, and loc. Recognisedopvalues include:"Input"– a function argument (tensor input)."return"– function return."constant"–stablehlo.constant; has extra keydense_content."dot_general"– matrix multiply; haslhs_contracting/rhs_contracting."broadcast_in_dim"/"dynamic_broadcast_in_dim"– pass-through broadcast (ONNX handles implicit broadcasting)."call"– call to a private helper function; has extra keyfunc."reduce_max"/"reduce_sum"– reduction with keepdims; hasaxes."skip"– shape-only op (reshape of integer tensors, concatenate of integer tensors, get_dimension_size); should be ignored by the converter."convert"–stablehlo.convert; type cast; hasshapeset to the target tensor type string (e.g."tensor<f32>").Any other name – direct StableHLO→ONNX op name (e.g.
"sine","add","compare_GT").