Skip to content

Commit

Permalink
best no need alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
Caozhou1995 committed Jul 11, 2023
1 parent 953282a commit 89c8823
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/paddle/distributed/launch/controllers/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ def __init__(self, ctx):
signal.signal(signal.SIGTERM, self.signal_handler)
signal.signal(signal.SIGABRT, self.signal_handler)
signal.signal(signal.SIGINT, self.signal_handler)
if ctx.is_auto_tuner_mode() and not ctx.run_best:
# set per task timeout
signal.signal(signal.SIGALRM, self.not_exit_signal_handler)
signal.alarm(ctx.max_time_per_task)
if ctx.is_auto_tuner_mode():
if not ctx.run_best:
# set per task timeout
signal.signal(signal.SIGALRM, self.not_exit_signal_handler)
signal.alarm(ctx.max_time_per_task)
else:
signal.alarm(0)

self.ctx = ctx
self.master = Master.factory(self.ctx)
Expand Down
1 change: 1 addition & 0 deletions python/paddle/distributed/launch/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def launch():
ctx.args.job_id = "best_cfg"
ctx.logger.info(f"Launch best cfg from auto tuner: {best_cfg}")
ctx.args.log_dir = "best_cfg"
# run best cfg
c = controllers.init(ctx)
c.run()
c.finalize(exit=True)
Expand Down

0 comments on commit 89c8823

Please sign in to comment.