Skip to content

fix(#30): phase-aware concurrency control for Sobol vs BO phases#32

Open
blttkgl wants to merge 1 commit into
mainfrom
fix/issue-30-phase-aware-concurrency
Open

fix(#30): phase-aware concurrency control for Sobol vs BO phases#32
blttkgl wants to merge 1 commit into
mainfrom
fix/issue-30-phase-aware-concurrency

Conversation

@blttkgl
Copy link
Copy Markdown
Collaborator

@blttkgl blttkgl commented May 13, 2026

Title: fix(#30): phase-aware concurrency control for Sobol vs BO phases


Description:

Fixes #30.

max_parallelism was never linked to manager.job_limit, so Ax silently capped concurrent trial generation at 3 regardless of the scheduler's actual capacity.

What changed

  • Session._apply_backend_preferences() now wires manager.job_limitbackend.max_parallelism, allowing the Sobol initialization phase to fill all available scheduler slots.
  • New Session(bo_concurrency=N) parameter caps concurrent acquisition during the BO phase independently of job_limit. Defaults to None (uncapped).
  • _is_bo_phase() checks Ax's actual experiment trial count to match Ax's internal Sobol→BO transition (counting pending trials, not just finished ones).
  • bo_concurrency persists/restores through session config.
  • 6 new tests; example updated with bo_concurrency=2, job_limit=10.

Behaviour

Phase Concurrency
Sobol job_limit (full scheduler capacity)
BO bo_concurrency if set, else job_limit

Fully backward-compatible — existing sessions without bo_concurrency behave as before, except Sobol now uses all available slots.

Resolves #30

Previously, backend.max_parallelism was never linked to manager.job_limit,
so Ax silently capped concurrent trial generation at DEFAULT_BO_CONCURRENCY=3
regardless of the scheduler's actual capacity.

Changes:
- Session._apply_backend_preferences() wires manager.job_limit to
  backend.max_parallelism so the Sobol initialization phase can fill all
  available scheduler slots
- Add Session.bo_concurrency parameter (Optional[int]) to cap concurrent
  acquisitions during the BO phase independently of job_limit
- Phase detection in _is_bo_phase() checks Ax's actual experiment trial
  count (not just finished cases) to match Ax's internal Sobol→BO transition
- _validate_bo_concurrency() enforces type correctness at construction time
- Persist/restore bo_concurrency through session config
- 6 new tests covering Sobol-phase pass-through, BO-phase capping,
  max_parallelism sync on start() and restore()
- Update aerofoilNACA0012Steady example with bo_concurrency=2, job_limit=10

Signed-off-by: blttkgl <buluttekgul@gmail.com>
@blttkgl blttkgl requested a review from 499602D2 May 13, 2026 10:59
@499602D2 499602D2 added type: bug Something broken domain: optimizer Ax backend, objectives, search space labels May 16, 2026
@499602D2
Copy link
Copy Markdown
Owner

499602D2 commented May 18, 2026

Hey @blttkgl, I reviewed the PR yesterday and had some findings; I can address those tonight on this branch if you'd want to. Main nits have to do with the _is_bo_phase mechanism; Ax can generate Sobol trials also in the middle of optimization trials after the initial seeding is complete. I assume this would only result in full compute capacity not being utilized when job_limit < bo_concurrency, so it's not like it's a big deal. Local and offloaded acquisition also don't seem to use the same logic for the job limits. Or just prompt Copilot/Claude ;) Your call

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: optimizer Ax backend, objectives, search space type: bug Something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

max_parallelism not linked to Manager.job_limit — BO concurrency silently capped at 3

2 participants