Skip to content

Not ready for review #148

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion tests/test_uvm_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# pyre-ignore-all-errors[56]

import os

import pytest
import torch
from torchsnapshot.uvm_tensor import (
Expand All @@ -19,11 +21,16 @@

@pytest.mark.cpu_and_gpu
def test_uvm_tensor() -> None:
os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
os.environ["TORCH_SHOW_CPP_STACKTRACES"] = "1"
if torch.cuda.is_available() and _UVM_TENSOR_AVAILABLE:
print("_UVM_TENSOR_AVAILABLE", _UVM_TENSOR_AVAILABLE)
print("torch.cuda.device_count(): ", torch.cuda.device_count())
print("torch.cuda.current_device(): ", torch.cuda.current_device())
uvm_tensor = torch.rand(
(64, 64),
out=new_managed_tensor(
torch.empty(0, dtype=torch.float32, device="cuda:0"),
torch.empty(0, dtype=torch.float32, device=torch.device("cuda:0")),
[64, 64],
),
)
Expand Down