We can dump ir for each pass, can we do reload from dump files just like llvm?
if we want to do it, where can we get started?
unfortunately, the ir dump is not bidirectional.
However, TVM support direct saving any object as json file and load it back later, if we want to save things and load back, save it as json format instead of file dump.
One interesting thing would be implement a dumper that dumps a python script which uses ir_builder that creates the same ir
Thanks, what‘s api for json save and reload?
def test_const_saveload_json():
# save load json
x = tvm.const(1)
y = tvm.const(10)
z = x + y
z = z + z
json_str = tvm.save_json(z)
zz = tvm.load_json(json_str)
assert tvm.save_json(zz) == tvm.save_json(z)
thanks, I’ve found it
Hi, I am very interested in the ir you got. How can I get the entire IR of my code? Thank you very much.
Does the dumped json str is HalideIR, or just tvm object in json format?
Thanks.
the same thing here, both HalideIR and tvm object
Thanks for your reply,
How could I get the pure HalideIR in TVM C++ source?
I want to draw a HalideIR node diagram for user to easy visit every node with thier specific language.
THX