Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make multi gpu child processes finish right after evaluation #2033

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions otx/cli/tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ def train(exit_stack: Optional[ExitStack] = None): # pylint: disable=too-many-b
print("otx train time elapsed: ", total_time)
model_results = {"time elapsed": total_time, "score": performance, "model_path": str(model_path.absolute())}

if args.gpus and exit_stack is None:
multigpu_manager.finalize()
elif is_multigpu_child_process():
return

get_otx_report(
model_template=config_manager.template,
task_config=task.config,
Expand All @@ -297,8 +302,6 @@ def train(exit_stack: Optional[ExitStack] = None): # pylint: disable=too-many-b

if not is_multigpu_child_process():
task.cleanup()
elif args.gpus and exit_stack is None:
multigpu_manager.finalize()

return dict(retcode=0, template=template.name)

Expand Down