tvm_tirx.ir.transform.instrument.DumpIR

Contents

tvm_tirx.ir.transform.instrument.DumpIR#

class tvm_tirx.ir.transform.instrument.DumpIR(dump_dir, refresh=False)#

Bases: DumpIR, PassInstrument

Write each pass’s output TVMScript to a numbered file.

Files are named 000_<pass_name>.py, 001_<pass_name>.py, and so on, with unsafe filename characters replaced by underscores. This instrument observes the module without changing it.

Parameters:
  • dump_dir (pathlib.Path or str) – Output directory, created when the first pass finishes.

  • refresh (bool) – If true, remove an existing directory only when all of its entries match the numbered dump-file pattern; otherwise preserve it.

Examples

with tvm_tirx.ir.transform.PassContext(instruments=[DumpIR("pass_ir")]):
    after = tvm_tirx.tirx.transform.StmtSimplify()(mod)