-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a JSON converter for 0.7 -> 0.8 and 0.8 -> 0.9 #9874
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @electriclilies , one minor nit and it LGTM
python/tvm/ir/json_compact.py
Outdated
""" | ||
|
||
def _initialize_virtual_device(item, _): | ||
if "virtual_device_" not in item["attrs"].keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"virtual_device_" not in item["attrs"]
is better so it do ont have to instantiate keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks for the review
* Add default to serialization * revert changes in serialization.cc * update 0.6 converter * json updater working, except for cycles * clean up code * Fix tests * formatting * format : * nit
* Add default to serialization * revert changes in serialization.cc * update 0.6 converter * json updater working, except for cycles * clean up code * Fix tests * formatting * format : * nit
In this PR, I add some JSON converters. The motivation for this change is #9826-- I need to visit the virtual_device_ field in the AttrVisitor of many Relay nodes. Unfortunately, this breaks importing models serialized with TVM v 0.8. This change allows us to import those models.
I also changed the behavior of the upgrade_json function to update 0.6 to current (0.9), 0.7 to current (0.9) and 0.8 to current (0.9).
@mbs-octoml @tqchen @mbrookhart @mikepapadim PTAL if you are interested! Thanks