You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Importers should print generic op form by default/exclusively #4441
Currently, the importers print custom op asm form, which limits the ability to interface to/from systems that may not have the dialects linked in, making the pipeline far less hackable.
Example:
from pyiree.compiler2 import xla as xlac
from jaxlib import xla_client
ops = xla_client.ops
builder = xla_client.XlaBuilder("testbuilder")
in_shape = np.array([4, 2, 3], dtype=np.float32)
in_feed = ops.Parameter(builder, 0, xla_client.shape_from_pyval(in_shape))
result = ops.Add(in_feed, ops.Constant(builder, np.float32(1.0)))
xla_computation = builder.Build(result)
# TODO: Should be printing generic op form.
mhlo_text = xlac.compile_str(xla_computation.as_serialized_hlo_module_proto(), import_only=True).decode('utf-8')
print(mhlo_text)
Since the importer is intended to be part of systematic pipelines, it should be operating in a mode that is the most efficient and accessible. Currently, that means bridging through ASM, but in the future, it will likely involve a more efficient binary IR representation. There is no reason to be going through custom op forms for such tools.
Activity
Importers should print the generic op form.