Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Mar 21, 2024
1 parent 2ec88ad commit ff15a02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion triton_viz/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def store_load(
tensor, tensor_id = tensor_table[x.ptr]
# inp = base_tensor(tensor.shape, DEFAULT)
color = ACTIVE[tensor_id]
invalid = x.invalid_access_masks.any()
invalid = (x.invalid_access_masks).any()
if invalid:
color = Color("red")
inp = cover(tensor.shape, tensor.dtype, x.original_offsets, x.original_masks, color)
Expand Down
2 changes: 1 addition & 1 deletion triton_viz/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def check_out_of_bounds_access(ptrs, masks):
offsets = ptrs.data - tensor_ptr.ptr
max_valid_offset = np.prod(tensor_ptr.shape) * tensor_ptr.element_size
valid_access_masks = (offsets >= 0) & (offsets < max_valid_offset)
invalid_access_masks = (~valid_access_masks) & (~masks.data)
invalid_access_masks = (~valid_access_masks) & masks.data
corrected_offsets = np.where(valid_access_masks, offsets, 0)
return (
tensor_ptr,
Expand Down

0 comments on commit ff15a02

Please sign in to comment.