File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
analyzer/habitat/analysis/wave_scaling Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from habitat .analysis .kernels import PredictedKernel
4
4
from habitat .analysis .wave_scaling .common import calculate_wave_info
5
-
5
+ import logging
6
+ logger = logging .getLogger (__name__ )
6
7
7
8
def resimplified_wave_scaling (
8
9
kernel ,
@@ -23,8 +24,9 @@ def resimplified_wave_scaling(
23
24
# Check if the kernel is too "small" - if it doesn't fill a single wave
24
25
# on the current device AND if it doesn't fill a single wave on the
25
26
# destination device
26
- if (kernel .num_blocks // origin_wave_size == 0 and
27
- kernel .num_blocks // dest_wave_size == 0 ):
27
+ if (origin_wave_size == 0 or dest_wave_size == 0 ):
28
+ logger .warn (f"One or more invalid wave sizes: kernel: { kernel .name } origin: { origin_wave_size } , dest: { dest_wave_size } " )
29
+ if ((origin_wave_size == 0 or dest_wave_size == 0 ) or (kernel .num_blocks // origin_wave_size == 0 and kernel .num_blocks // dest_wave_size == 0 )):
28
30
# We scale the run time by the compute factor only
29
31
origin_max_occupancy = math .ceil (
30
32
kernel .num_blocks / origin_device .num_sms
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ def roofline_wave_scaling(
26
26
# 1. Check if the kernel is too "small" - if it doesn't fill a single wave
27
27
# on the current device AND if it doesn't fill a single wave on the
28
28
# destination device
29
- if (kernel .num_blocks // origin_wave_size == 0 and
30
- kernel .num_blocks // dest_wave_size == 0 ):
29
+ if (( origin_wave_size == 0 or dest_wave_size == 0 ) or ( kernel .num_blocks // origin_wave_size == 0 and
30
+ kernel .num_blocks // dest_wave_size == 0 )) :
31
31
# We scale the run time by the compute factor only
32
32
origin_max_occupancy = math .ceil (
33
33
kernel .num_blocks / origin_device .num_sms
You can’t perform that action at this time.
0 commit comments