Skip to content

Commit

Permalink
Add string representation for AttrsDescriptor (#4888)
Browse files Browse the repository at this point in the history
The string representation allows PyTorch Inductor to
serialize/derserialize the `AttrsDescriptor` to the `@triton.heuristics`
block in the generated code.
  • Loading branch information
alexbaden authored Oct 29, 2024
1 parent bf6bd0b commit ebce7f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/triton/backends/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def get_property_key(val, align):
return "1"
return "N"

def __repr__(self):
return f"AttrsDescriptor.from_dict({self.to_dict()!r})"


@dataclass(frozen=True)
class GPUTarget(object):
Expand Down

0 comments on commit ebce7f3

Please sign in to comment.