Skip to content

Commit 34b04ae

Browse files
LucasLLCfacebook-github-bot
authored andcommitted
Avoid splitting files if num_threads is 1 (#787)
Summary: Pull Request resolved: #787 Splitting files only provides performance gains in the threaded case, additionally it's been noted that splitting files increases likelihood of hitting manifold quotas ghstack-source-id: 222855206 exported-using-ghexport Reviewed By: JKSenthil Differential Revision: D56065261 fbshipit-source-id: 65d037286a7ced0f2f968ae6ed095e360c6c435c
1 parent 428cffd commit 34b04ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchtnt/framework/callbacks/dcp_saver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ def default_writer_options(self) -> Dict[str, Any]:
272272
dcp_options = {
273273
"thread_count": self._knob_options.max_per_rank_io_concurrency or 16,
274274
"sync_files": False,
275-
"single_file_per_rank": False,
276275
}
276+
if dcp_options["thread_count"] > 1:
277+
dcp_options["single_file_per_rank"] = False
277278

278279
return dcp_options

0 commit comments

Comments
 (0)