tvm_tirx.script.register_dialect#
- tvm_tirx.script.register_dialect(name, module_path, *, builder_path=None)#
Register a dialect’s script namespace and canonical builder package.
Registration is lazy: it records paths without importing either package.
tvm_tirx.script.<name>andtvm_tirx.script.parser.<name>exposemodule_path;tvm_tirx.script.ir_builder.<name>exposesbuilder_path. Deep imports under these compatibility paths resolve to the same canonical modules, preserving their identity and avoiding repeated initialization. Existing physical out-of-tree packages undertvm_tirx.script.ir_builderretain normal package lookup precedence.Each dialect registers from its own package initialization:
import tvm_tirx.script tvm_tirx.script.register_dialect( "example", "example.script", builder_path="example.script.ir_builder" )
Out-of-tree dialects register the same way without editing shared TVMScript files. Re-registering the same name and paths is idempotent.
- Parameters:
name (str) – Short name exposed under
tvm_tirx.script.<name>.module_path (str) – Full dotted path of the dialect’s script package, which owns its public construction namespace.
builder_path (str, optional) – Full dotted path of the dialect-owned imperative builder package, normally
module_path + ".ir_builder". When omitted, usemodule_path + ".builder"to preserve existing out-of-tree registrations. No imports or aliases are created at registration time.
- Return type:
None