Skip to content

Commit b382256

Browse files
FindHaofacebook-github-bot
authored andcommitted
Fix wrong reverting
Summary: D78130587 mistakenly reverted a previous change. this diff takes it back. Reviewed By: Sibylau Differential Revision: D78182104 fbshipit-source-id: e0264e1849a7677192d4750a82c93f77002d9c5a
1 parent 9c77d2b commit b382256

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tritonparse/structured_logging.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ def convert(obj):
142142
Returns:
143143
A serializable version of the input object where dataclasses are converted to dictionaries
144144
"""
145+
from triton.language.core import dtype
146+
145147
# 1. primitives that JSON already supports -------------------------------
146148
if obj is None or isinstance(obj, (bool, int, str)):
147149
return obj
@@ -176,6 +178,10 @@ def convert(obj):
176178
return convert(
177179
asdict(obj)
178180
) # Convert dataclass to dict and then process that dict
181+
182+
# 4. Common Triton constexpr objects
183+
if isinstance(obj, dtype):
184+
return f"triton.language.core.dtype('{str(obj)}')"
179185
log.warning(f"Unknown type: {type(obj)}")
180186
return str(obj) # Return primitive types as-is
181187

0 commit comments

Comments
 (0)