[Update] Update MLC course materials to TVM latest API #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates the MLC course materials to be compatible with TVM latest API changes. This is the first step in modernizing the course content, focusing on API updates. Additional content updates will follow in subsequent PRs.
Changes
API Updates
Compilation API
tvm.build()→tvm.compile()for TIR modulesrelax.build()→tvm.compile()for Relax moduleslib.time_evaluator()→lib.mod.time_evaluator()(tvm.compile returns Executable with mod attribute)Runtime API
tvm.nd.array()→tvm.runtime.tensor()tvm.nd.empty()→tvm.runtime.tensor(np.empty(...))tvm.nd.NDArray→tvm.runtime.TensorFunction Registration
@tvm.register_func()→@tvm.register_global_func()Code Fixes
mlc-ai-nightly→mlc-ai-nightly-cpu)Next Steps
In the following PR, I will update repo
mlc-znas well and then include updating outdated usage(like
PyTorch FX->exported_program).