Skip to content

[AUTOGENERATED] [release/2.7] [release/2.6] NAVI32 specific fixes #2465

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

Closed
Closed
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
17 changes: 17 additions & 0 deletions torch/testing/_internal/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,9 +1894,26 @@ def dec_fn(fn):
@wraps(fn)
def wrap_fn(self, *args, **kwargs):
if TEST_WITH_ROCM:
<<<<<<< HEAD
prop = torch.cuda.get_device_properties(0)
if prop.gcnArchName.split(":")[0] in arch:
reason = f"skipIfRocm: test skipped on {arch}"
=======
device = torch.cuda.current_device()
props = torch.cuda.get_device_properties(device)

total = props.total_memory / (1024 ** 3) # in GB
# This will probably return 0 because it only counts tensors
# and doesn't take into account any small supporting allocations
allocated = torch.cuda.memory_allocated(device) / (1024 ** 3)
free_global = total - allocated

result = free_global > required_amount

if not result:
reason = f"skipIfRocm: Not enough free VRAM on current ROCm device. " \
f"Available: {free_global:.2f} GB | Required: {required_amount:.2f} GB."
>>>>>>> f78730679a1 (Formatting code style)
raise unittest.SkipTest(reason)
return fn(self, *args, **kwargs)
return wrap_fn
Expand Down