-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[TOPI] improve inclusive_scan for thrust #16652
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
Conversation
|
@tvm-bot rerun |
1 similar comment
|
@tvm-bot rerun |
python/tvm/topi/cuda/scan.py
Outdated
| data, output_dtype, exclusive=True, return_reduction=return_reduction, binop=binop | ||
| ) | ||
| if _can_use_scan_thrust(binop): | ||
| return scan_thrust(data, output_dtype, return_reduction=return_reduction, binop=binop) |
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.
let's pass exclusive=True explicitly here
|
With this example: The 'cuda_gpu_kern_sum' stats report w/ this change Time (%) Total Time (ns) Instances Avg (ns) Med (ns) Min (ns) Max (ns) StdDev (ns) Name
w/o this change
The execution perf numbers I got on NVIDIA GeForce RTX 3070: R.cumsum(x, axis=1)
R.cumsum(x, axis=0)
|
MasterJH5574
left a comment
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.
Thank you @yongwww!!
|
The failed test |
e1931c6 to
db50782
Compare
|
@tvm-bot rerun |
Fix comments
db50782 to
aa0b202
Compare
|
@tvm-bot rerun |
1 similar comment
|
@tvm-bot rerun |
The
topi.cuda.inclusive_scancurrently relies on performing anexclusive_scanfollowed by an add operation that adds the input data back in. To eliminate the overhead introduced by this extra addition, probably we should have an implementation specifically designed forinclusive_scan. As of now, the implementation ofinclusive_scanis limited toexclusive_scan_ir, developing aninclusive_scan_irwill be needed for performance in the future.In this pull request, we specifically address this efficiency for thrust by directly calling the inclusive function.
Co-authored-by: Wuwei Lin [email protected]