Skip to content
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

[TOPI] Minor perf improvement for GPU scatter #7233

Merged
merged 16 commits into from
Jan 19, 2021
Prev Previous commit
Next Next commit
do not use hard coded num threads
  • Loading branch information
masahi committed Jan 18, 2021
commit 1b7610932cc25d1aa00c7d40033911229221d4b4
3 changes: 2 additions & 1 deletion python/tvm/topi/cuda/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@ def gen_ir_4d(data, indices, updates, axis, out, update_func):
data_ptr = ib.buffer_ptr(data)
with ib.new_scope():
fused = n * c * h * w
num_thread = 1024
num_thread = int(tvm.target.Target.current(allow_none=False).max_num_threads)
num_blocks = ceil_div(fused, num_thread)

bx = te.thread_axis("blockIdx.x")
ib.scope_attr(bx, "thread_extent", num_blocks)
tx = te.thread_axis("threadIdx.x")
Expand Down