Skip to content

Wave scaling patch #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 25, 2023
Merged
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
8 changes: 5 additions & 3 deletions analyzer/habitat/analysis/wave_scaling/resimplified.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from habitat.analysis.kernels import PredictedKernel
from habitat.analysis.wave_scaling.common import calculate_wave_info

import logging
logger = logging.getLogger(__name__)

def resimplified_wave_scaling(
kernel,
Expand All @@ -23,8 +24,9 @@ def resimplified_wave_scaling(
# Check if the kernel is too "small" - if it doesn't fill a single wave
# on the current device AND if it doesn't fill a single wave on the
# destination device
if (kernel.num_blocks // origin_wave_size == 0 and
kernel.num_blocks // dest_wave_size == 0):
if (origin_wave_size == 0 or dest_wave_size == 0):
logger.warn(f"One or more invalid wave sizes: kernel: {kernel.name} origin: {origin_wave_size}, dest: {dest_wave_size}")
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)):
# We scale the run time by the compute factor only
origin_max_occupancy = math.ceil(
kernel.num_blocks / origin_device.num_sms
Expand Down
4 changes: 2 additions & 2 deletions analyzer/habitat/analysis/wave_scaling/roofline.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def roofline_wave_scaling(
# 1. Check if the kernel is too "small" - if it doesn't fill a single wave
# on the current device AND if it doesn't fill a single wave on the
# destination device
if (kernel.num_blocks // origin_wave_size == 0 and
kernel.num_blocks // dest_wave_size == 0):
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)):
# We scale the run time by the compute factor only
origin_max_occupancy = math.ceil(
kernel.num_blocks / origin_device.num_sms
Expand Down