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

Fix aiaccel/hpo/apps/optimize.py . #414

Merged
merged 17 commits into from
Feb 3, 2025
Merged

Conversation

KanaiYuma-aist
Copy link
Collaborator

@KanaiYuma-aist KanaiYuma-aist commented Dec 25, 2024

  • n_running_jobs を非同期処理で処理中のジョブ数を参照していた都合で、tests/hpo/apps/main/test_resume.py がたまに failed になることがあった現象を修正しました
    • n_running_jobs を非同期処理を参照している都合、while finished_job_count < config.n_trials を通過した直後に実行中のジョブが終了した場合に、config.n_trials よりも多くのジョブが生成されることがあるのが、原因だと思われます
      • 例えば、 config.n_trials = 30 の時に、while finished_job_count < config.n_trials を通過した直後に 30 個目のジョブが終了した場合、len(jobs.get_running_jobs()) の結果が 0 となるため、31 個目のジョブが生成されます
    • これを解消するために、 n_running_jobs を非同期処理を参照するのではなく、即値で管理するように変更しました

close #412

@yoshipon
Copy link
Collaborator

yoshipon commented Jan 5, 2025

修正ありがとうございます.
勘違いしていたらすみません,こちらですが,出来る限り自前で状態を持たないようにお願いできますか?
これはapiの設計を見直した方が良いように感じています.

@KanaiYuma-aist
Copy link
Collaborator Author

開発者会議メモ

  • base_job_executor.py に n_running_jobs, finished_job_count に相当する機能を追加し、そちらを参照する形に改修する

@KanaiYuma-aist
Copy link
Collaborator Author

KanaiYuma-aist commented Jan 7, 2025

BaseJobExecutor に submitted_job_count, finished_job_count を追加する形で改修しました。

  • submitted_job_count は submit 実行時にカウントするのが適切と考えて、ひとまず submit_wrapper を作成して submit_wrapper の呼び出し毎にカウントするように改修しました。
  • finished_job_count は collect_finished の処理中にカウントするように改修しました。
    • それぞれ getter を追加しました(Docstringを書く?)

@KanaiYuma-aist
Copy link
Collaborator Author

  • getter を削除しました
  • submit, submit_wrapper の関数名を変更しました

Copy link
Collaborator

@yoshipon yoshipon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます.

@KanaiYuma-aist KanaiYuma-aist removed the request for review from aramoto99 January 30, 2025 05:20
@yoshipon yoshipon merged commit 021fe06 into develop/v2 Feb 3, 2025
10 checks passed
@yoshipon yoshipon deleted the feature/fix_ci_failed branch February 3, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants