@@ -175,6 +175,7 @@ def check_events(llm,
175
175
else :
176
176
while events :
177
177
event = events .pop (0 )
178
+ assert "attention_dp_rank" in event
178
179
if event and event ["attention_dp_rank" ] == attention_dp_rank :
179
180
assert event ["event_id" ] in [0 , 1 ]
180
181
assert event ["data" ]["type" ] in ["created" , "stored" ]
@@ -192,8 +193,8 @@ def check_events(llm,
192
193
193
194
while events2 :
194
195
event = events2 .pop (0 )
195
- if event and (event [ " attention_dp_rank" ] == attention_dp_rank
196
- or attention_dp_rank is None ):
196
+ if event and (attention_dp_rank is None
197
+ or event . get ( " attention_dp_rank" ) == attention_dp_rank ):
197
198
if event ["event_id" ] == 2 :
198
199
# 2 removed events needed
199
200
# should be a removed event to make space for context block
@@ -215,8 +216,8 @@ def check_events(llm,
215
216
216
217
while events3 :
217
218
event = events3 .pop (0 )
218
- if event and (event [ " attention_dp_rank" ] == attention_dp_rank
219
- or attention_dp_rank is None ):
219
+ if event and (attention_dp_rank is None
220
+ or event . get ( " attention_dp_rank" ) == attention_dp_rank ):
220
221
if event ["event_id" ] == 5 :
221
222
assert event ["data" ]["type" ] == "removed"
222
223
assert event ["data" ]["block_hashes" ]
0 commit comments