Skip to content

Commit 50eb74b

Browse files
alexbadenliuyunqi20
authored andcommitted
Add string representation for AttrsDescriptor (#4888)
The string representation allows PyTorch Inductor to serialize/derserialize the `AttrsDescriptor` to the `@triton.heuristics` block in the generated code.
1 parent d7c1bc5 commit 50eb74b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/triton/backends/compiler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ def get_property_key(val, align):
210210
return "1"
211211
return "N"
212212

213+
def __repr__(self):
214+
return f"AttrsDescriptor.from_dict({self.to_dict()!r})"
215+
213216

214217
@dataclass(frozen=True)
215218
class GPUTarget(object):

0 commit comments

Comments
 (0)