Repository navigation
Fix GridSampler crashing on enqueued trials with one grid remaining - #6844
Conversation
|
This is by design. |
|
Thanks for linking #6073! I understand that enqueued trials intentionally have no This PR aims to preserve that behavior while fixing a The reproduction in this PR uses a single-point grid and enqueues the trial before optimization starts. The proposed change allows the enqueued trial to finish, then evaluates the remaining grid point normally. Could you clarify whether the exception itself is also intended, or whether this case can be considered separately from the duplication behavior in #6073? |
|
This pull request has not seen any recent activity. |
|
This seems like behavior that needs to be fixed. Once this PR is ready for review, we will perform the review. |
|
This pull request has not seen any recent activity. |
|
This pull request has not seen any recent activity. |
|
@not522 @kAIto47802 Could you review this PR? |
Motivation
GridSamplerraisesKeyError("grid_id")after an enqueued trial when exactly one grid point remains. Enqueued trials intentionally have no grid ID, butafter_trialassumes the ID exists when deciding whether to stop optimization.This interrupts optimization before the remaining grid point is evaluated:
The expected evaluations are
a=100followed bya=0, after which optimization stops. The same error occurs when an enqueued trial follows a normal trial in a two-point grid.Description of the changes
Both added cases failed before the fix; all three cases pass afterward.
Checklist