Skip to content

Commit 60ab7b8

Browse files
authored
[fix] fix ticksync arguments passing in transformer layer. (#144)
1 parent 9a6697f commit 60ab7b8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

distca/runtime/megatron/ping_pong/transformer_layer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def ping_pong_forward(
224224
query_0, key_0, value_0, packed_seq_params_0
225225
)
226226
signal_0, hidden_states_1 = TickSync.apply(
227-
compute_stream, comm_stream, signal_0, hidden_states_1
227+
compute_stream, comm_stream, 'pre_mlp_to_attn', 'pre-communicate-0', signal_0, hidden_states_1
228228
)
229229

230230
# 3. pre-attention forward of microbatch 1, mlp2attn all2all of microbatch 0
@@ -250,7 +250,7 @@ def ping_pong_forward(
250250
query_1, key_1, value_1, packed_seq_params_1
251251
)
252252
signal_0, signal_1 = TickSync.apply(
253-
compute_stream, comm_stream, signal_0, signal_1
253+
compute_stream, comm_stream, 'pre_mlp_to_attn', 'pre-communicate-1', signal_0, signal_1
254254
)
255255
# NOTE: do not remove this debug tensor. see above.
256256
debug_tensors = (query_1, key_1, value_1)
@@ -279,7 +279,7 @@ def ping_pong_forward(
279279
# pre-communicate,0
280280
signal_0 = self._pre_attn_to_mlp(core_attn_out_0, packed_seq_params_0)
281281
signal_1, signal_0 = TickSync.apply(
282-
compute_stream, comm_stream, signal_1, signal_0
282+
compute_stream, comm_stream, 'pre_attn_to_mlp', 'pre-communicate-0', signal_1, signal_0
283283
)
284284
# NOTE: do not remove this debug tensor. see above.
285285
debug_tensors = core_attn_out_0
@@ -305,7 +305,7 @@ def ping_pong_forward(
305305
torch.cuda.nvtx.range_pop()
306306
# pre-communicate,1
307307
signal_1 = self._pre_attn_to_mlp(core_attn_out_1, packed_seq_params_1)
308-
signal_0, signal_1 = TickSync.apply(compute_stream, comm_stream, signal_0, signal_1)
308+
signal_0, signal_1 = TickSync.apply(compute_stream, comm_stream, 'pre_attn_to_mlp', 'pre-communicate-1', signal_0, signal_1)
309309
# NOTE: do not remove this debug tensor. see above.
310310
debug_tensors = core_attn_out_1
311311

@@ -324,7 +324,7 @@ def ping_pong_forward(
324324
)
325325
torch.cuda.nvtx.range_pop()
326326
# no pre-communicate for 0 now.
327-
signal_1, mlp_output_0 = TickSync.apply(compute_stream, comm_stream, signal_1, mlp_output_0)
327+
signal_1, mlp_output_0 = TickSync.apply(compute_stream, comm_stream, "forward_post_core_attn", "no-pre-communicate-0", signal_1, mlp_output_0)
328328
# NOTE: do not remove this debug tensor. see above.
329329
debug_tensors = None
330330

0 commit comments

Comments
 (0)