Skip to content

Commit 0951602

Browse files
kundaMwizapytorchmergebot
authored andcommitted
[inductor][heuristics] Update total tiling score when it is zero (#176423)
- When the total score is zero, it should be updated otherwise there will be a division by zero error - Trying to create a repro proved difficult. Example state that produces this is: ```python size_hints = {"y": 4096, "x": 64, "r0_": 128} inductor_meta = { "tiling_scores": {"y": 134217728, "x": 2097152, "r0_": 0}, "num_load": 1, } triton_meta = { "signature": { "in_ptr0": "*fp32", "out_ptr0": "*fp32", "ynumel": "i32", "xnumel": "i32", "r0_numel": "i32", "YBLOCK": "constexpr", "XBLOCK": "constexpr", "R0_BLOCK": "constexpr", } } persistent_reduction=False ``` Pull Request resolved: #176423 Approved by: https://github.com/jansel
1 parent eee7a9d commit 0951602

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

torch/_inductor/runtime/triton_heuristics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,6 +3389,7 @@ def match_target_block_product(
33893389
# just assume even score with no minimum block size
33903390
min_block_size = 1
33913391
tiling_scores = dict.fromkeys(tiling_scores.keys(), target_block_product)
3392+
total_score = target_block_product * len(tiling_scores)
33923393

33933394
# First, give each coalescing dimension at least min_block_size
33943395
block_sizes = {}

0 commit comments

Comments
 (0)