Skip to content

Commit

Permalink
torchtnt
Browse files Browse the repository at this point in the history
Differential Revision: D51846380
  • Loading branch information
CodemodService Bot authored and facebook-github-bot committed Dec 5, 2023
1 parent 80b4b0c commit 535654d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion examples/auto_unit_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def get_args() -> Namespace:
return parser.parse_args()


if __name__ == "__main__":
def invoke_main() -> None:
args: Namespace = get_args()
lc = pet.LaunchConfig(
min_nodes=1,
Expand All @@ -253,3 +253,7 @@ def get_args() -> Namespace:
)

pet.elastic_launch(lc, entrypoint=main)(args)


if __name__ == "__main__":
invoke_main() # pragma: no cover
6 changes: 5 additions & 1 deletion examples/torchdata_train_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,9 @@ def get_args(argv: List[str]) -> Namespace:
return parser.parse_args(argv)


if __name__ == "__main__":
def invoke_main() -> None:
main(sys.argv[1:])


if __name__ == "__main__":
invoke_main() # pragma: no cover
6 changes: 5 additions & 1 deletion examples/torchrec/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def main(argv: List[str]) -> None:
)


if __name__ == "__main__":
def invoke_main() -> None:
lc = launcher.LaunchConfig(
min_nodes=MIN_NODES,
max_nodes=MAX_NODES,
Expand All @@ -391,3 +391,7 @@ def main(argv: List[str]) -> None:
)

launcher.elastic_launch(config=lc, entrypoint=main)(sys.argv[1:])


if __name__ == "__main__":
invoke_main() # pragma: no cover
6 changes: 5 additions & 1 deletion examples/train_unit_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,9 @@ def get_args(argv: List[str]) -> Namespace:
return parser.parse_args(argv)


if __name__ == "__main__":
def invoke_main() -> None:
main(sys.argv[1:])


if __name__ == "__main__":
invoke_main() # pragma: no cover

0 comments on commit 535654d

Please sign in to comment.