Skip to content

Commit b9c740f

Browse files
Patch to address issue 14392 (#14398)
* fix Signed-off-by: Youngeun Kwon <[email protected]> * add assertion Signed-off-by: Youngeun Kwon <[email protected]> * Apply isort and black reformatting Signed-off-by: youngeunkwon0405 <[email protected]> --------- Signed-off-by: Youngeun Kwon <[email protected]> Signed-off-by: youngeunkwon0405 <[email protected]> Co-authored-by: youngeunkwon0405 <[email protected]>
1 parent c265a0c commit b9c740f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

scripts/performance/argument_parser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ def bool_arg(arg):
301301
required=False,
302302
default=None,
303303
)
304+
parser.add_argument(
305+
"-fsdp_db",
306+
"--use_fsdp_double_buffer",
307+
help="Enable FSDP double buffer. Disabled by default",
308+
type=bool_arg,
309+
required=False,
310+
default=None,
311+
)
304312
parser.add_argument(
305313
"-ubr",
306314
"--use_user_buffer_registration",

scripts/performance/helpers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ def set_perf_optimization_configs(
313313
if use_fsdp_double_buffer:
314314
assert use_mcore_fsdp == True, "use_fsdp_double_buffer requires use_mcore_fsdp to be True"
315315

316+
if use_user_buffer_registration:
317+
assert use_mcore_fsdp == True, "use_user_buffer_registration requires use_mcore_fsdp to be True"
318+
assert (
319+
use_fsdp_double_buffer is not False
320+
), "use_fsdp_double_buffer cannot be False when use_user_buffer_registration is True"
321+
316322
if use_mcore_fsdp and enable_cuda_graphs:
317323
logging.warning("Currently, cuda graphs are not supported with FSDP. Disabling cuda graphs.")
318324
enable_cuda_graphs = False
@@ -360,6 +366,7 @@ def set_primary_perf_configs(
360366
etp_size: Optional[int] = None,
361367
enable_cuda_graphs: bool = False,
362368
use_mcore_fsdp: bool = False,
369+
use_fsdp_double_buffer: bool = False,
363370
use_user_buffer_registration: bool = False,
364371
use_sharp: bool = False,
365372
recompute_layers: int = 0,

0 commit comments

Comments
 (0)