From d51e39b7811e39c002e5e1570f16aa40e2275f52 Mon Sep 17 00:00:00 2001 From: zzb610 Date: Wed, 20 Nov 2024 04:53:45 +0000 Subject: [PATCH] Fix: add event sync in fsdp tutorial Signed-off-by: zzb610 --- intermediate_source/FSDP_tutorial.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/intermediate_source/FSDP_tutorial.rst b/intermediate_source/FSDP_tutorial.rst index 9b9845667f..ce10488986 100644 --- a/intermediate_source/FSDP_tutorial.rst +++ b/intermediate_source/FSDP_tutorial.rst @@ -251,6 +251,7 @@ We add the following code snippets to a python script “FSDP_mnist.py”. init_end_event.record() if rank == 0: + init_end_event.synchronize() print(f"CUDA event elapsed time: {init_start_event.elapsed_time(init_end_event) / 1000}sec") print(f"{model}")