Skip to content

Commit

Permalink
Apply final nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Riasanovsky committed Feb 28, 2025
1 parent ca6fc11 commit 79e0902
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import subprocess
import functools
from pathlib import Path
import torch


def min_dot_size(target: GPUTarget):
Expand Down Expand Up @@ -141,6 +140,8 @@ def use_buffer_ops():

@staticmethod
def is_within_2gb(arg):
import torch

MAX_INT_32 = 2**31 - 1
if hasattr(arg, "ptr_range"):
return arg.ptr_range() <= MAX_INT_32
Expand All @@ -160,7 +161,7 @@ def get_arg_specialization(arg, ty, **kwargs):
ret = BaseBackend.get_arg_specialization(arg, ty, **kwargs)
# Only attempt to do buffer ops specialization if buffer ops are enabled.
# Otherwise the is_within_2gb check is unnecessary overhead.
if (HIPBackend.use_buffer_ops() and ty == "tensor" and HIPBackend.is_within_2gb(arg)):
if HIPBackend.use_buffer_ops() and ty == "tensor" and HIPBackend.is_within_2gb(arg):
ret += "S"
return ret

Expand Down

0 comments on commit 79e0902

Please sign in to comment.