-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😸
Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
Expected behavior
The OpenCL example in the cross-compilation and RPC tutorial should use the correct variable names and properly bind loops to GPU thread hierarchy. Specifically, after getting the loop variable x and splitting it into xo and xi, the code should use these variables correctly in subsequent operations.
Actual behavior
The tutorial code contains variable name errors and incorrect loop binding:
Line 237 uses an undefined variable i in sch.split(i, [None, 32]) instead of using the previously defined variable x.
Lines 238-239 incorrectly bind the same variable x to both "blockIdx.x" and "threadIdx.x", instead of binding the outer loop xo to "blockIdx.x" and the inner loop xi to "threadIdx.x".
Environment
TVM from GitHub repository (latest main branch)
Operating System: Linux
Steps to reproduce
Open the tutorial file at docs/how_to/tutorials/cross_compilation_and_rpc.py
Look at the run_opencl() function around line 236-239:
(x,) = sch.get_loops(block=sch.get_block("B"))
xo, xi = sch.split(i, [None, 32]) # Error: 'i' is undefined
sch.bind(x, "blockIdx.x") # Error: should use 'xo'
sch.bind(x, "threadIdx.x") # Error: should use 'xi'
Triage
Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).
- needs-triage