Skip to content
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
7 changes: 7 additions & 0 deletions tritonparse/reproducer/templates/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def load_tensor(tensor_file_path: Union[str, Path], device: str = None) -> torch
RuntimeError: If the tensor cannot be loaded
ValueError: If the computed hash doesn't match the filename hash
"""
# Normalize cuda device to cuda:0
if device is not None and isinstance(device, str) and device.startswith("cuda"):
device = "cuda:0"

blob_path = Path(tensor_file_path)

if not blob_path.exists():
Expand Down Expand Up @@ -210,6 +214,9 @@ def _create_base_tensor(arg_info) -> torch.Tensor:

shape = arg_info.get("shape", [])
device = arg_info.get("device", "cpu")
# Normalize cuda device to cuda:0
if isinstance(device, str) and device.startswith("cuda"):
device = "cuda:0"

# Extract statistical information if available
mean = arg_info.get("mean")
Expand Down