Skip to content

Commit 4c2f9e9

Browse files
committed
use is_symm_mem_tensor if the API is available
1 parent 5fb5b3a commit 4c2f9e9

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

helion/_dist_utils.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,9 @@ def is_master_rank() -> bool:
7575

7676

7777
def is_symm_mem_tensor(t: Tensor, process_group_name: str | None = None) -> bool:
78-
if not isinstance(t, Tensor) or not dist.is_initialized():
79-
return False
80-
81-
assert process_group_name is not None
82-
try:
83-
hdl = symm_mem.rendezvous(
84-
t,
85-
group=process_group_name, # pyrefly: ignore[bad-argument-type]
86-
)
87-
return hdl is not None
88-
except RuntimeError:
89-
# PyTorch right now throws a RuntimeError if the tensor passed
90-
# to rendezvious is not from symm-mem
78+
if not isinstance(t, Tensor):
9179
return False
80+
return symm_mem.is_symm_mem_tensor(t)
9281

9382

9483
def get_signal_pad_ptrs_dev(t: Tensor, process_group_name: str | None = None) -> int:

0 commit comments

Comments
 (0)