[Tune] Fix Tune search for python 3.14#63575
Merged
matthewdeng merged 2 commits intoMay 22, 2026
Merged
Conversation
Signed-off-by: Mark Towers <mark@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the state serialization and restoration logic in python/ray/tune/search/basic_variant.py by excluding _trial_iter from the saved state and resetting it to None in set_state. Feedback was provided regarding set_state, suggesting that _trial_generator should be explicitly cleared before reconstructing the iterator chain to avoid redundant trials and deep nesting of itertools.chain objects when an object is reused.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 438c278. Configure here.
Signed-off-by: Mark Towers <mark@anyscale.com>
TimothySeah
approved these changes
May 22, 2026
TimothySeah
left a comment
Contributor
There was a problem hiding this comment.
LGTM, also ran the release test on this PR.
Neelansh-Khare
pushed a commit
to Neelansh-Khare/ray-clone
that referenced
this pull request
Jun 5, 2026
Signed-off-by: Neelansh Khare <kharen@uci.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
In updating the release tests to check Python 3.14, I found
Reviewing python 3.14 release notes, https://docs.python.org/3/whatsnew/3.14.html#itertools,
picklesupport has been explicitly removed from all itertool functions.To resolve this problem, we can just lazily evaluate
_trial_iteras it is updated innext_trialbased on_trial_generatorRelated
#63270