Skip to content

Commit

Permalink
slightly speedup kernel launching
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Jan 9, 2024
1 parent ad50984 commit fbd191b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pyjuice/utils/kernel_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ def wrapper(*args, **kwargs):
if isinstance(arg, torch.Tensor):
signature_list.append((i, id(arg)))

grid0 = grid[0]
grid1 = grid[1] if len(grid) > 1 else 1
grid2 = grid[2] if len(grid) > 2 else 1
grid_length = len(grid)
grid0, grid1, grid2 = grid[0], grid[1] if grid_length > 1 else 1, grid[2] if grid_length > 2 else 1

signature = tuple(signature_list)
if signature in self.cache:
Expand Down

0 comments on commit fbd191b

Please sign in to comment.