forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7,016 changed files
with
5,655,688 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: a06a8034754b76e2f52e9b7d51eb4b56 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
14 changes: 14 additions & 0 deletions
14
releases/ant-2.41.0/_downloads/6adeb623647a7151ee6b7b6553dda299/tune-default.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cluster_name: tune-default | ||
provider: {type: aws, region: us-west-2} | ||
auth: {ssh_user: ubuntu} | ||
min_workers: 3 | ||
max_workers: 3 | ||
# Deep Learning AMI (Ubuntu) Version 21.0 | ||
available_node_types: | ||
head_node: | ||
node_config: {InstanceType: c5.xlarge, ImageId: ami-0b294f219d14e6a82} | ||
worker_nodes: | ||
node_config: {InstanceType: c5.xlarge, ImageId: ami-0b294f219d14e6a82} | ||
head_node_type: head_node | ||
setup_commands: # Set up each node. | ||
- pip install ray torch torchvision tensorboard |
98 changes: 98 additions & 0 deletions
98
releases/ant-2.41.0/_downloads/8515735d7ae45b272ee9ef78046d863d/mnist_pytorch_trainable.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Original Code here: | ||
# https://github.com/pytorch/examples/blob/master/mnist/main.py | ||
from __future__ import print_function | ||
|
||
import argparse | ||
import os | ||
|
||
import torch | ||
import torch.optim as optim | ||
|
||
import ray | ||
from ray import train, tune | ||
from ray.tune.examples.mnist_pytorch import ( | ||
ConvNet, | ||
get_data_loaders, | ||
test_func, | ||
train_func, | ||
) | ||
from ray.tune.schedulers import ASHAScheduler | ||
|
||
# Change these values if you want the training to run quicker or slower. | ||
EPOCH_SIZE = 512 | ||
TEST_SIZE = 256 | ||
|
||
# Training settings | ||
parser = argparse.ArgumentParser(description="PyTorch MNIST Example") | ||
parser.add_argument( | ||
"--use-gpu", action="store_true", default=False, help="enables CUDA training" | ||
) | ||
parser.add_argument("--ray-address", type=str, help="The Redis address of the cluster.") | ||
parser.add_argument( | ||
"--smoke-test", action="store_true", help="Finish quickly for testing" | ||
) | ||
|
||
|
||
# Below comments are for documentation purposes only. | ||
# fmt: off | ||
# __trainable_example_begin__ | ||
class TrainMNIST(tune.Trainable): | ||
def setup(self, config): | ||
use_cuda = config.get("use_gpu") and torch.cuda.is_available() | ||
self.device = torch.device("cuda" if use_cuda else "cpu") | ||
self.train_loader, self.test_loader = get_data_loaders() | ||
self.model = ConvNet().to(self.device) | ||
self.optimizer = optim.SGD( | ||
self.model.parameters(), | ||
lr=config.get("lr", 0.01), | ||
momentum=config.get("momentum", 0.9)) | ||
|
||
def step(self): | ||
train_func( | ||
self.model, self.optimizer, self.train_loader, device=self.device) | ||
acc = test_func(self.model, self.test_loader, self.device) | ||
return {"mean_accuracy": acc} | ||
|
||
def save_checkpoint(self, checkpoint_dir): | ||
checkpoint_path = os.path.join(checkpoint_dir, "model.pth") | ||
torch.save(self.model.state_dict(), checkpoint_path) | ||
|
||
def load_checkpoint(self, checkpoint_dir): | ||
checkpoint_path = os.path.join(checkpoint_dir, "model.pth") | ||
self.model.load_state_dict(torch.load(checkpoint_path)) | ||
|
||
|
||
# __trainable_example_end__ | ||
# fmt: on | ||
|
||
if __name__ == "__main__": | ||
args = parser.parse_args() | ||
ray.init(address=args.ray_address, num_cpus=6 if args.smoke_test else None) | ||
sched = ASHAScheduler() | ||
|
||
tuner = tune.Tuner( | ||
tune.with_resources(TrainMNIST, resources={"cpu": 3, "gpu": int(args.use_gpu)}), | ||
run_config=train.RunConfig( | ||
stop={ | ||
"mean_accuracy": 0.95, | ||
"training_iteration": 3 if args.smoke_test else 20, | ||
}, | ||
checkpoint_config=train.CheckpointConfig( | ||
checkpoint_at_end=True, checkpoint_frequency=3 | ||
), | ||
), | ||
tune_config=tune.TuneConfig( | ||
metric="mean_accuracy", | ||
mode="max", | ||
scheduler=sched, | ||
num_samples=1 if args.smoke_test else 20, | ||
), | ||
param_space={ | ||
"args": args, | ||
"lr": tune.uniform(0.001, 0.1), | ||
"momentum": tune.uniform(0.1, 0.9), | ||
}, | ||
) | ||
results = tuner.fit() | ||
|
||
print("Best config is:", results.get_best_result().config) |
Binary file added
BIN
+368 KB
....0/_images/08c7eb0f9b59c989f5e7f02e9eea8d18c4b13db5452f4ceffe3ed1465b230510.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+917 KB
....0/_images/1ca67d9fba8393b0e715685a6a935671381a74b032ffe1d786930e47a112e23f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+439 KB
....0/_images/1cba3d88b9c3288ca360a7d839074355008f6c58477fe9636d56fcbce9a88222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+343 KB
....0/_images/2108b6c6dc23e650b95a57d7c0b72a3082a10fb019aa771b04ca7148f5bf09e3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+77.5 KB
....0/_images/27e2bde8b6fafc0fd81ada9b3d7247536385326abf40395312b7cde33ad194dc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.7 KB
....0/_images/2e364ab27edad78af1772e1d8d3ff397febefec20d343ab5b449bad09fdefeef.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+447 KB
....0/_images/2f30d9f3363e427c330557e0e04df8cea24b9b91c5cedc69fa292288bc03901e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+375 KB
....0/_images/403e94115f2e439e5dca137c87944dedacde25057eb76bd711cb28b231d983e0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+325 KB
....0/_images/52b0e26b926834509d4a1ea8ee867a7940f9531464338a3bee3330617d456cf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+96.9 KB
....0/_images/53c6040ce843397a1cbd78696edc36cfb2ea7d4c44b5a0ebbd3503d89699ae9a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.89 KB
....0/_images/55afb00d1e20d980ce404aaae70714939e8f5bacdb431046bc59a42c4455d5e6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
....0/_images/5b1a113310c2fc8bd5fae12ab515bbb46bde7a8fd5215ab888560e335034bf09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+445 KB
....0/_images/5f1ba187d2025085cccbda577067ba972fd4bc2cd346ee06da5a880e385dcbf9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+95.1 KB
....0/_images/60e0d8726f400ee9d95b197738260f8989346ef4fe60d815b275d3d0b3c4b1f9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+425 KB
....0/_images/6bf6a8685ef6d620b2308cbcb538bc33d61a3c23081997531d643b39df4be5f0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+113 KB
....0/_images/6eeb09c68eafec5e2618a6c9485d8d03c0980af88139b9c100a0640f21c21def.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+217 KB
....0/_images/77cfc3f82d4b234e10ff5009448162cad5e338455a15617290cc08d8346efebd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+410 KB
....0/_images/8026ab2601a290f95530064a04ae0da37100193b5a5cbfce4de81debef54f89d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.2 KB
....0/_images/82e684fc9512d6186a43174eba0f92d64e36b9b625da83ec39f0709d3b7219a8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+285 KB
....0/_images/909c8d7115f0958365c79199fab05aa51eef2d1a23056af50179c11586c627a6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+182 KB
....0/_images/99cc48399ce119902a2f9aa3330108ac8973c60131f94325949177824d1145fe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+456 KB
....0/_images/9b7bb855d83f101a312765bb1d3b489ffea958fe5486e0fb9997c444f481099a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.8 KB
....0/_images/9db28a3d88c4f1c01592e695c2ac84d9bfcc889820774806e3f0210118cafa05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.3 KB
....0/_images/abfe55e4ed3702b63205d71227ac55bbf9b8e2f8a6736e61155876affd62e994.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+67.8 KB
....0/_images/af4a885945f6fb5a5c70732d19fc80d751f21ab7e1648680656bb5ab18cac6dd.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+306 KB
....0/_images/b73f2406c0823290221da22680043b5282b9e57c88def747a42db4bdfb392902.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.