6 Commits

Author SHA1 Message Date
Junru Shao e77a6d1a05 [TVMScript] Introduce PrinterConfig (#13831)
This PR introduces `PrinterConfig`, a systematic way to configure
TVMScript printer without having to set global flags.

This PR enables more customization of printer behavior. More
specifically, now any TVM’s object in python, as long as it
inherits from `Scriptable`, it automatically gains two methods:
- `.script(tir_prefix=...)`
- `.show(...)`
2023-01-24 06:54:29 -08:00
Junru Shao da99e9d1b5 [TVMScript] Use TVMScript for all TIR Printing (#13795) 2023-01-18 08:42:24 -05:00
Junru Shao c452e6966c [TVMScript] IR Fragment Printing (#13742)
This PR introduces support for TIR fragment printing.
Fragment printing makes it possible to print TIR fragments in the text
format consistency with TVMScript PrimFunc/IRModule printing.

This PR still preserves the legacy ReprPrinter format by introducing an
API `LegacyTIRPrint` for TIR PrimExpr. This method is used in
AutoScheduler and TIR CSE for full backward compatibility.
2023-01-13 22:36:47 -05:00
Junru Shao a99f0c1545 [TVMScript] Refactor IRDocsifier (#13593)
This PR refactors the TVMScript printer and includes the following
changes:
- Consolidate the logics of VarTable into IRDocsifier
- Decouple TracedObject into Object and ObjectPath for less syntactic
  noise
- Restructure the folder to ensure logics and consistency

Some tests removed because the APIs do not exist any more due to the
consolidation.
2023-01-08 13:57:33 -05:00
Lite Ye cc769fdc95 [TVMScript] Printer entry point (#12462)
This PR:

- Adds an entry point for the TVMScript Unified Printer
- Adds a helper object class `RootNodeContainer` to provide an injection point for the actual printer implementation to add specialized logic on the root node to print.

Tracking issue: https://github.com/apache/tvm/issues/11912
2022-08-20 20:41:42 -07:00
Lite Ye 9f4bf38b57 [TVMScript] Doc Base Class & DocPrinter Scaffolding (#11971)
This PR addes:
- Doc base class
- DocPrinter base class
- PythonDocPrinter
- LiteralDoc and its support in DocPrinter

Tracking issue: #11912
2022-07-06 22:11:10 -07:00