[Fix] Account for captured inputs in DeepGEMM masked workspace budget (#43563)
This commit is contained in:
@@ -159,10 +159,15 @@ def _estimate_masked_standard_layout_peak_bytes(
|
||||
input_scale_row_bytes = ceil_div(hidden_size, block_k) * scale_item_bytes
|
||||
down_scale_row_bytes = ceil_div(gateup_size // 2, block_k) * scale_item_bytes
|
||||
|
||||
peak_row_bytes = max(
|
||||
input_row_bytes + input_scale_row_bytes + gateup_row_bytes,
|
||||
gateup_row_bytes + down_input_row_bytes + down_scale_row_bytes,
|
||||
down_input_row_bytes + down_scale_row_bytes + down_output_row_bytes,
|
||||
# Graph capture skips dispose_tensor, so the runner input remains live
|
||||
# through activation and the down GEMM. Use the same bound during warmup
|
||||
# and capture to keep layout selection consistent.
|
||||
peak_row_bytes = (
|
||||
input_row_bytes
|
||||
+ input_scale_row_bytes
|
||||
+ down_input_row_bytes
|
||||
+ down_scale_row_bytes
|
||||
+ max(gateup_row_bytes, down_output_row_bytes)
|
||||
)
|
||||
return runner_config.num_local_experts * padded_m * peak_row_bytes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user