Skip to content

Commit d6a384d

Browse files
committed
Only include attention_dp rank in event if not none
Signed-off-by: Patrice Castonguay <[email protected]>
1 parent 9b1592f commit d6a384d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tensorrt_llm/_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,15 @@ def to_json_str(cls, event):
10141014
if event_serialize_func is None:
10151015
raise ValueError(f"Unknown KVCache event data type: {event_type}")
10161016

1017-
return {
1017+
json_str = {
10181018
"event_id": event.event_id,
10191019
"data": event_serialize_func(event.data),
10201020
"window_size": event.window_size,
1021-
"attention_dp_rank": event.attention_dp_rank,
10221021
}
1022+
if event.attention_dp_rank is not None:
1023+
json_str["attention_dp_rank"] = event.attention_dp_rank
1024+
1025+
return json_str
10231026

10241027
@staticmethod
10251028
def _created_to_json(data):

0 commit comments

Comments
 (0)