Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion helion/_compiler/generate_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_rng_seed_buffer_statements(self) -> list[ast.AST]:

# Create host-side seed buffer with the required number of seeds
seed_buffer_stmt = statement_from_string(
f"_rng_seed_buffer = inductor_prims.seeds({self.device_function.rng_seed_count}, torch.device('cuda'))"
f"_rng_seed_buffer = inductor_prims.seeds({self.device_function.rng_seed_count}, torch.accelerator.current_accelerator())"
)

return [import_stmt, seed_buffer_stmt]
Expand Down
2 changes: 1 addition & 1 deletion test/test_rng.expected
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _helion_multiple_rng_ops_kernel(rand1, rand2, uniform, normal, randn_a, rand

def multiple_rng_ops_kernel(x: torch.Tensor, *, _launcher=_default_launcher):
from torch._inductor import inductor_prims
_rng_seed_buffer = inductor_prims.seeds(7, torch.device('cuda'))
_rng_seed_buffer = inductor_prims.seeds(7, torch.accelerator.current_accelerator())
rand1 = torch.zeros_like(x)
rand2 = torch.zeros_like(x)
uniform = torch.zeros_like(x)
Expand Down
Loading