Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Aug 5, 2025

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format to ffi/extra/serialization to handle the serialization, see the json graph schema comment in ffi/extra/serialization.h for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable. We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single place that defines the reflection.

@tqchen
Copy link
Member Author

tqchen commented Aug 5, 2025

Notes for migration

  • For IR that are saved in json, the easiest way is to dump out tvmscript and parse back
  • node/reflection.h is no longer needed
  • Remove TVM_REGISTER_NODE_TYPE and TVM_OBJECT_TYPE as they are no longer needed
  • For very rare cases that needs special handling of save/load from json, need to overload attributes __data_from_json__ and __data_to_json__.

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format
to ffi/extra/serialization to handle the serialization,
see the json graph schema comment in ffi/extra/serialization.h
for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable.
We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single
place that defines the reflection.
@MasterJH5574 MasterJH5574 merged commit ba994d3 into apache:main Aug 5, 2025
12 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
…che#18188)

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format
to ffi/extra/serialization to handle the serialization,
see the json graph schema comment in ffi/extra/serialization.h
for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable.
We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single
place that defines the reflection.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…che#18188)

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format
to ffi/extra/serialization to handle the serialization,
see the json graph schema comment in ffi/extra/serialization.h
for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable.
We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single
place that defines the reflection.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…che#18188)

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format
to ffi/extra/serialization to handle the serialization,
see the json graph schema comment in ffi/extra/serialization.h
for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable.
We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single
place that defines the reflection.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
…che#18188)

This PR migrates the Save/Load JSON to the new reflection based mechanism.

This is a breaking change that updates the the JSON format
to ffi/extra/serialization to handle the serialization,
see the json graph schema comment in ffi/extra/serialization.h
for the format, which roughly aligns with the old style.

After this change, we no longer need node/reflection and reflection vtable.
We can also phase out TVM_REGISTER_NODE and TVM_REGISTER_OBJECT to have a single
place that defines the reflection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants