fix: migrate TVM API from tir to s_tir/tirx for apache-tvm 0.25#1
Open
WilliamOdinson wants to merge 1 commit into
Open
fix: migrate TVM API from tir to s_tir/tirx for apache-tvm 0.25#1WilliamOdinson wants to merge 1 commit into
WilliamOdinson wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
apache-tvm0.25 renamed/reorganized the TensorIR scheduling API. This PR migrates all assignment2 code to the new API so the assignment works with the current TVM release.The schedule in
schedule_example.ipynbwas verified on Google Colab with a T4 GPU.Note
My Colab install command is:
API changes
tvm<0.25)apache-tvm0.25)from tvm import tirfrom tvm import s_tirfrom tvm.script import tir as Tfrom tvm.script import tirx as Tfrom tvm.tir.schedule import BlockRVfrom tvm.s_tir.schedule import SBlockRVfrom tvm import meta_schedule as msfrom tvm.s_tir import meta_schedule as msfrom tvm.meta_schedule.space_generator import ScheduleFnfrom tvm.s_tir.meta_schedule.space_generator import ScheduleFntir.Schedule(...)s_tir.Schedule(...)@T.prim_func@T.prim_func(s_tir=True)T.alloc_buffer(...)T.sblock_alloc_buffer(...)T.block("name")T.sblock("name")sch.get_block("name")sch.get_sblock("name")T.thread_binding(N, "blockIdx.x")T.thread_binding(N, thread="blockIdx.x")tvm.nd.array(...)tvm.runtime.tensor(...)tvm.nd.empty(...)tvm.runtime.empty(...)tvm.cuda()tvm.runtime.cuda()(orfrom tvm.runtime import cuda)tvm.testing.assert_allclose(...)np.testing.assert_allclose(...)f.imported_modules[0].get_source()f.imports[0].inspect_source()Known limitation
reference.pyis not included in this PR. As a student I don't have the correct solution to regenerate it against the new API; this file should be updated by course staff.