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

[Thrust] Increase static workspace size #16937

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/tvm/relax/backend/dispatch_sort_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ def estimate_thrust_workspace_size(self, call: relax.Call) -> int:
int32_byte_per_elem = DataType("int32").bits // 8
num_elem = reduce(mul, input_shape, 1)
input_size = num_elem * input_byte_per_elem
# Most GPU algorithms take O(n) space or less, we choose 8N + 4MB as a safe estimation
# Most GPU algorithms take O(n) space or less, we choose 8N + 8MB as a safe estimation
# for algorithm workspace.
# The current thrust sort implementation may need extra int64 and int32 arrays
# for temporary data, so we further add this part to the workspace.
return (
8 * input_size
+ 4 * 1024 * 1024
+ 8 * 1024 * 1024
+ num_elem * (int64_byte_per_elem + int32_byte_per_elem)
)

Expand Down
Loading