Skip to content

Commit

Permalink
Query lds size for tune_gemm and tune_streamk (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAUT authored Dec 12, 2024
1 parent 83bd6b0 commit 40a9963
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python/perf-kernels/streamk/tune_streamk.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def prune_configs(M, N, K, configs, elemBytes_a, elemBytes_b):
else:
# Pipeline, we need (num_stages - 1) buffers for both A and B at the same time
LDS = (LDSA + LDSB) * (num_stages - 1)
if LDS > 65536:
driver = triton.runtime.driver.active
max_shared = driver.utils.get_device_properties(driver.get_current_device())["max_shared_mem"]
if LDS > max_shared:
continue
# Skip small block sizes and num_warps for large gemm
# For fp16 and f8, we want to only use BLOCK_SIZE >= 64
Expand Down
4 changes: 3 additions & 1 deletion python/perf-kernels/tools/tune_gemm/tune_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def prune_configs(M, N, K, configs, elemBytes_a, elemBytes_b):
else:
# Pipeline, we need (num_stages - 1) buffers for both A and B at the same time
LDS = (LDSA + LDSB) * (num_stages - 1)
if LDS > 65536:
driver = triton.runtime.driver.active
max_shared = driver.utils.get_device_properties(driver.get_current_device())["max_shared_mem"]
if LDS > max_shared:
continue
# Skip small block sizes and num_warps for large gemm
# For fp16 and f8, we want to only use BLOCK_SIZE >= 64
Expand Down

0 comments on commit 40a9963

Please sign in to comment.