8000 disable persistent kernel by HIT-cwh · Pull Request #1 · InternLM/AdaptiveGEMM · GitHub
[go: up one dir, main page]

Skip to content
Open
Show file tree
Hide file tree
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: 3 additions & 1 deletion adaptive_gemm/jit_kernels/gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ def gemm_fp8_fp8_bf16_nt(lhs: List[torch.Tensor],

# Auto-tuning with compilation
global includes, template
num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count - 24
# When communication overlaps with computing, both operations compete for SM resources.
# Disable persistent kernel can lead to better performance.
num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count * 10
num_sms, block_m, block_n, num_stages, num_tma_multicast, smem_size = get_best_configs(m, n, k, 1, num_sms)
args = (lhs, lhs_scales, rhs, rhs_scales, out, m, torch.cuda.current_stream(), num_sms, smem_size)
runtime = jit_tuner.compile_and_tune(
Expand Down
4 changes: 3 additions & 1 deletion adaptive_gemm/jit_kernels/k_grouped_gemm_dw.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ def k_grouped_gemm_dw_fp8_fp8_bf16_tn_contiguous(

# Auto-tuning with compilation
global includes, template
num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count - 24
# When communication overlaps with computing, both operations compete for SM resources.
# Disable persistent kernel can lead to better performance.
num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count * 10
block_m, block_n, num_stages, num_tma_multicast, smem_size = get_best_configs(m, n, k, num_groups, num_sms,
is_grouped_contiguous=True)
args = (lhs, lhs_scales, rhs, rhs_scales, out,
Expand Down
4 changes: 3 additions & 1 deletion adaptive_gemm/jit_kernels/m_grouped_gemm_varlen.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def m_grouped_varlen_gemm_fp8_fp8_bf16_nt_contiguous(lhs: Tuple[torch.Tensor, to
# Auto-tuning with compilation
# global includes, template

num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count - 24
# When communication overlaps with computing, both operations compete for SM resources.
# Disable persistent kernel can lead to better performance.
num_sms = torch.cuda.get_device_properties(device='cuda').multi_processor_count * 10

num_sms, block_m, block_n, num_stages, num_tma_multicast, smem_size = get_best_configs(m, n, k, 1, num_sms)

Expand Down
0