Skip to content

(Re-land) Update ray to 2.7.2 #2791

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

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions beginner_source/hyperparameter_tuning_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,21 @@
from torch.utils.data import random_split
import torchvision
import torchvision.transforms as transforms
# sphinx_gallery_start_ignore
# Fixes ``AttributeError: '_LoggingTee' object has no attribute 'fileno'``.
# This is only needed to run with sphinx-build.
import sys
if not hasattr(sys.stdout, "encoding"):
sys.stdout.encoding = "latin1"
sys.stdout.fileno = lambda: 0
# sphinx_gallery_end_ignore
from ray import tune
from ray.air import Checkpoint, session
from ray.tune.schedulers import ASHAScheduler

# TODO: Migrate to ray.train.Checkpoint and remove following line
os.environ["RAY_AIR_NEW_PERSISTENCE_MODE"]="0"

######################################################################
# Most of the imports are needed for building the PyTorch model. Only the last three
# imports are for Ray Tune.
Expand Down Expand Up @@ -448,13 +459,6 @@ def main(num_samples=10, max_num_epochs=10, gpus_per_trial=2):


if __name__ == "__main__":
# sphinx_gallery_start_ignore
# Fixes ``AttributeError: '_LoggingTee' object has no attribute 'fileno'``.
# This is only needed to run with sphinx-build.
import sys

sys.stdout.fileno = lambda: False
# sphinx_gallery_end_ignore
# You can change the number of GPUs per trial here:
main(num_samples=10, max_num_epochs=10, gpus_per_trial=0)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bs4
awscliv2==2.1.1
flask
spacy==3.4.1
ray[tune]==2.4.0
ray[tune]==2.7.2
tensorboard
jinja2==3.1.3
pytorch-lightning
Expand Down