tvm_tirx.script.register_dialect

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> and tvm_tirx.script.parser.<name> expose module_path; tvm_tirx.script.ir_builder.<name> exposes builder_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 under tvm_tirx.script.ir_builder retain 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, use module_path + ".builder" to preserve existing out-of-tree registrations. No imports or aliases are created at registration time.

Return type:

None