file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
python/ray/tests/test_projects.py | Python | import jsonschema
import os
import pytest
import subprocess
import yaml
from click.testing import CliRunner
import sys
from unittest.mock import patch, DEFAULT
from contextlib import contextmanager
from ray.projects.scripts import (session_start, session_commands,
session_execute)
im... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_queue.py | Python | import pytest
import time
import ray
from ray.experimental.queue import Queue, Empty, Full
def test_queue(ray_start_regular):
@ray.remote
def get_async(queue, block, timeout, sleep):
time.sleep(sleep)
return queue.get(block, timeout)
@ray.remote
def put_async(queue, item, block, time... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_ray_init.py | Python | import os
import pytest
import redis
import ray
from ray.cluster_utils import Cluster
@pytest.fixture
def password():
random_bytes = os.urandom(128)
if hasattr(random_bytes, "hex"):
return random_bytes.hex() # Python 3
return random_bytes.encode("hex") # Python 2
class TestRedisPassword:
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_reference_counting.py | Python | # coding: utf-8
import os
import json
import copy
import tempfile
import numpy as np
import time
import pytest
import logging
import uuid
import ray
import ray.cluster_utils
import ray.test_utils
logger = logging.getLogger(__name__)
def _check_refcounts(expected):
actual = ray.worker.global_worker.core_worker.g... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_signal.py | Python | import pytest
import time
import ray
import ray.experimental.signal as signal
class UserSignal(signal.Signal):
def __init__(self, value):
self.value = value
def receive_all_signals(sources, timeout):
# Get all signals from sources, until there is no signal for a time
# period of timeout.
r... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_stress.py | Python | import numpy as np
import pytest
import time
import ray
from ray.cluster_utils import Cluster
@pytest.fixture(params=[(1, 4), (4, 4)])
def ray_start_combination(request):
num_nodes = request.param[0]
num_workers_per_scheduler = request.param[1]
# Start the Ray processes.
cluster = Cluster(
in... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_stress_failure.py | Python | import json
import numpy as np
import os
import pytest
import sys
import time
import ray
from ray.cluster_utils import Cluster
from ray.test_utils import flat_errors
import ray.ray_constants as ray_constants
@pytest.fixture(params=[1, 4])
def ray_start_reconstruction(request):
num_nodes = request.param
plas... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_stress_sharded.py | Python | import numpy as np
import os
import pytest
import ray
@pytest.fixture(params=[1, 4])
def ray_start_sharded(request):
num_redis_shards = request.param
if os.environ.get("RAY_USE_NEW_GCS") == "on":
num_redis_shards = 1
# For now, RAY_USE_NEW_GCS supports 1 shard, and credis supports
# ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_tempfile.py | Python | import os
import shutil
import time
import pytest
import ray
from ray.cluster_utils import Cluster
def test_conn_cluster():
# plasma_store_socket_name
with pytest.raises(Exception) as exc_info:
ray.init(
address="127.0.0.1:6379",
plasma_store_socket_name="/tmp/this_should_fail"... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_tensorflow.py | Python | from numpy.testing import assert_almost_equal
import tensorflow.compat.v1 as tf
import ray
import ray.experimental.tf_utils
def make_linear_network(w_name=None, b_name=None):
# Define the inputs.
x_data = tf.placeholder(tf.float32, shape=[100])
y_data = tf.placeholder(tf.float32, shape=[100])
# Defin... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_unreconstructable_errors.py | Python | import numpy as np
import unittest
import ray
from ray import ray_constants
class TestUnreconstructableErrors(unittest.TestCase):
def setUp(self):
ray.init(
num_cpus=1,
object_store_memory=150 * 1024 * 1024,
redis_max_memory=10000000)
def tearDown(self):
r... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tests/test_webui.py | Python | import re
import sys
import time
import pytest
import requests
import ray
@pytest.mark.skipif(
sys.version_info < (3, 5, 3), reason="requires python3.5.3 or higher")
def test_get_webui(shutdown_only):
addresses = ray.init(include_webui=True, num_cpus=1)
webui_url = addresses["webui_url"]
assert ray.... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/__init__.py | Python | from ray.tune.error import TuneError
from ray.tune.tune import run_experiments, run
from ray.tune.experiment import Experiment
from ray.tune.analysis import ExperimentAnalysis, Analysis
from ray.tune.registry import register_env, register_trainable
from ray.tune.trainable import Trainable
from ray.tune.durable_trainabl... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/analysis/__init__.py | Python | from ray.tune.analysis.experiment_analysis import ExperimentAnalysis, Analysis
__all__ = ["ExperimentAnalysis", "Analysis"]
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/analysis/experiment_analysis.py | Python | import json
import logging
import os
try:
import pandas as pd
except ImportError:
pd = None
from ray.tune.checkpoint_manager import Checkpoint
from ray.tune.error import TuneError
from ray.tune.result import EXPR_PROGRESS_FILE, EXPR_PARAM_FILE,\
CONFIG_PREFIX, TRAINING_ITERATION
from ray.tune.trial import... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automl/__init__.py | Python | from ray.tune.automl.genetic_searcher import GeneticSearch
from ray.tune.automl.search_policy import GridSearch, RandomSearch
from ray.tune.automl.search_space import SearchSpace, \
ContinuousSpace, DiscreteSpace
__all__ = [
"ContinuousSpace",
"DiscreteSpace",
"SearchSpace",
"GridSearch",
"Rand... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automl/genetic_searcher.py | Python | import logging
import numpy as np
from ray.tune.automl.search_policy import AutoMLSearcher
logger = logging.getLogger(__name__)
LOGGING_PREFIX = "[GENETIC SEARCH] "
class GeneticSearch(AutoMLSearcher):
"""Implement the genetic search.
Keep a collection of top-K parameter permutations as base genes,
the... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automl/search_policy.py | Python | import time
import copy
import logging
from ray.tune.trial import Trial
from ray.tune.suggest import SearchAlgorithm
from ray.tune.experiment import convert_to_experiment_list
from ray.tune.suggest.variant_generator import generate_variants
from ray.tune.config_parser import make_parser, create_trial_from_spec
logger... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automl/search_space.py | Python | import random
import logging
import numpy as np
from ray.tune import grid_search
logger = logging.getLogger(__name__)
class ParameterSpace:
"""Base class of a single parameter's search space.
"""
def __init__(self, name):
"""Initialize ParameterSpace.
Arguments:
name (str):... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/backend/collector.py | Python | import logging
import os
import time
from threading import Thread
from ray.tune.automlboard.common.exception import CollectorError
from ray.tune.automlboard.common.utils import parse_json, \
parse_multiple_json, timestamp2date
from ray.tune.automlboard.models.models import JobRecord, \
TrialRecord, ResultReco... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/common/exception.py | Python | class CollectorError(Exception):
"""Error raised from the collector service."""
pass
class DatabaseError(Exception):
"""Error raised from the database manager."""
pass
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/common/utils.py | Python | import logging
import json
import os
import time
def dump_json(json_info, json_file, overwrite=True):
"""Dump a whole json record into the given file.
Overwrite the file if the overwrite flag set.
Args:
json_info (dict): Information dict to be dumped.
json_file (str): File path to be dum... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/frontend/query.py | Python | from django.shortcuts import HttpResponse
from ray.tune.automlboard.models.models import JobRecord, TrialRecord
from ray.tune.trial import Trial
import json
def query_job(request):
"""Rest API to query the job info, with the given job_id.
The url pattern should be like this:
curl http://<server>:<port... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/frontend/urls.py | Python | """
Monitor URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/frontend/view.py | Python | from django.shortcuts import render
from ray.tune.automlboard.settings import AUTOMLBOARD_RELOAD_INTERVAL, \
AUTOMLBOARD_LOG_DIR
from ray.tune.automlboard.models.models import JobRecord, \
TrialRecord, ResultRecord
from ray.tune.trial import Trial
import datetime
def index(request):
"""View for the home... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/frontend/wsgi.py | Python | """
WSGI config for monitor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
from django.core.wsgi import get_wsgi_application
import os
os.environ.setdefault("DJANGO_SETT... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/manage.py | Python | #!/usr/bin/env python
from django.core.management import execute_from_command_line
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"ray.tune.automlboard.settings")
execute_from_command_line(sys.argv)
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/models/__init__.py | Python | default_app_config = "ray.tune.automlboard.models.apps.ModelConfig"
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/models/apps.py | Python | from django.apps import AppConfig
class ModelConfig(AppConfig):
"""Model Congig for models."""
name = "ray.tune.automlboard.models"
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/models/models.py | Python | from django.db import models
class JobRecord(models.Model):
"""Information of an AutoML Job."""
job_id = models.CharField(max_length=50)
name = models.CharField(max_length=20)
user = models.CharField(max_length=20)
type = models.CharField(max_length=20)
start_time = models.CharField(max_lengt... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/run.py | Python | import logging
import os
import re
import django
import argparse
from django.core.management import execute_from_command_line
from common.exception import DatabaseError
root_path = os.path.dirname(os.path.abspath(__file__))
logger = logging.getLogger(__name__)
def run_board(args):
"""
Run main entry for Aut... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/settings.py | Python | """
Django settings for monitor project.
Generated by 'django-admin startproject' using Django 1.11.14.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/App.css | CSS | body {
font-size: 14px;
}
input[type=text], textarea {
font-size: 14px;
padding: 5px 10px;
border-radius: 4px;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
}
::-webkit-input-placeholder {
opacity: 0.6;
}
:-... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/ExperimentList.css | CSS | .experiment-list-outer-container {
padding-left: 64px;
}
.experiment-list-container {
overflow-y: scroll;
overflow-x: hidden;
width: 236px;
min-height: 100%;
}
.active-experiment-list-item {
background: rgba(67, 199, 234, 0.1);
font-weight: bold;
}
.experiment-list-item {
overflow:hid... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/ExperimentView.css | CSS | .ExperimentView input[type=checkbox] {
width: auto;
}
.ExperimentView th {
background-color: #fafafa;
color: #888888;
font-weight: 500;
}
.ExperimentView td, .ExperimentView th {
border-top: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
}
.ExperimentView th.top-row {
text-align: ce... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/HomePage.css | CSS | .outer-container {
display: -ms-flexbox;
display: flex;
}
.HomePage-experiment-list-container {
width: 10%;
min-width: 333px;
}
.experiment-view-container {
width: 80%;
}
.experiment-view-right {
width: 10%;
}
/* BEGIN css for when experiment list collapsed */
.experiment-page-container {
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/bootstrap.min.css | CSS | /*!
* Bootswatch v4.1.3
* Homepage: https://bootswatch.com
* Copyright 2012-2018 Thomas Park
* Licensed under MIT
* Based on Bootstrap
*//*!
* Bootstrap v4.1.3 (https://getbootstrap.com/)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/tw... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/css/index.css | CSS | body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.fa-chevron-left:before {
content: "\f053";
} | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/static/js/ExperimentList.js | JavaScript | function collapse_experiment_list() {
$("#sidebar").toggleClass("collapsed");
$("#content").toggleClass("col-md-8");
$(".collapser").toggleClass("fa-chevron-left fa-chevron-right");
var over_flow_attr = $(".experiment-list-container").css("overflow-y");
if (over_flow_attr == "scroll") {
$(".experiment-lis... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/templates/index.html | HTML | <html>
<head>
<title>AutoMLBoard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% load staticfiles %}
<!-- jquery and bootstrap dependency -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/templates/job.html | HTML | <html>
<head>
<title>AutoMLBoard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% load staticfiles %}
<!-- jquery and bootstrap dependency -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/automlboard/templates/trial.html | HTML | <html>
<head>
<title>AutoMLBoard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% load staticfiles %}
<!-- jquery and bootstrap dependency -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/checkpoint_manager.py | Python | # coding: utf-8
import heapq
import logging
logger = logging.getLogger(__name__)
class Checkpoint:
"""Describes a checkpoint of trial state.
Checkpoint may be saved in different storage.
Attributes:
storage (str): Storage type.
value (str): If storage==MEMORY, it is a Python object.
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/cluster_info.py | Python | import getpass
import os
def get_ssh_user():
"""Returns ssh username for connecting to cluster workers."""
return getpass.getuser()
def get_ssh_key():
"""Returns ssh key to connecting to cluster workers.
If the env var TUNE_CLUSTER_SSH_KEY is provided, then this key
will be used for syncing ac... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/commands.py | Python | import click
import logging
import os
import subprocess
import operator
from datetime import datetime
import pandas as pd
from pandas.api.types import is_string_dtype, is_numeric_dtype
from ray.tune.result import (DEFAULT_EXPERIMENT_INFO_KEYS, DEFAULT_RESULT_KEYS,
CONFIG_PREFIX)
from ray.t... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/config_parser.py | Python | import argparse
import json
import os
# For compatibility under py2 to consider unicode as str
from six import string_types
from ray.tune import TuneError
from ray.tune.trial import Trial
from ray.tune.resources import json_to_resources
from ray.tune.logger import _SafeFallbackEncoder
def make_parser(parser_creator... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/durable_trainable.py | Python | import os
from ray.tune.trainable import Trainable, TrainableUtil
from ray.tune.syncer import get_cloud_sync_client
class DurableTrainable(Trainable):
"""Abstract class for a remote-storage backed fault-tolerant Trainable.
Supports checkpointing to and restoring from remote storage. To use this
class, i... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/error.py | Python | class TuneError(Exception):
"""General error class raised by ray.tune."""
pass
class AbortTrialExecution(TuneError):
"""Error that indicates a trial should not be retried."""
pass
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/async_hyperband_example.py | Python | #!/usr/bin/env python
import argparse
import json
import os
import random
import numpy as np
import ray
from ray.tune import Trainable, run, sample_from
from ray.tune.schedulers import AsyncHyperBandScheduler
class MyTrainableClass(Trainable):
"""Example agent whose learning curve is a random sigmoid.
The... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/ax_example.py | Python | """This test checks that AxSearch is functional.
It also checks that it is usable with a separate scheduler.
"""
import numpy as np
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.ax import AxSearch
def hartmann6(x):
alpha = np.array([1.0, 1.2, 3... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/bayesopt_example.py | Python | """This test checks that BayesOpt is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.bayesopt import BayesOptSearch
def easy_objective(config, reporter):
import time
t... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/bohb_example.py | Python | #!/usr/bin/env python
import argparse
import json
import os
import numpy as np
import ray
from ray.tune import Trainable, run
from ray.tune.schedulers.hb_bohb import HyperBandForBOHB
from ray.tune.suggest.bohb import TuneBOHB
parser = argparse.ArgumentParser()
parser.add_argument(
"--smoke-test", action="store_... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/durable_trainable_example.py | Python | import argparse
import numpy as np
import time
import logging
import os
import ray
from ray import tune
from ray.tune import DurableTrainable
from ray.tune.sync_client import get_sync_client
import cloudpickle
logger = logging.getLogger(__name__)
class MockDurableTrainable(DurableTrainable):
"""Mocks the storag... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/genetic_example.py | Python | """This test checks that GeneticSearch is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.automl import GeneticSearch
from ray.tune.automl import ContinuousSpace, DiscreteSpace, SearchS... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/hyperband_example.py | Python | #!/usr/bin/env python
import argparse
import json
import os
import random
import numpy as np
import ray
from ray.tune import Trainable, run, Experiment, sample_from
from ray.tune.schedulers import HyperBandScheduler
class MyTrainableClass(Trainable):
"""Example agent whose learning curve is a random sigmoid.
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/hyperopt_example.py | Python | """This test checks that HyperOpt is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.hyperopt import HyperOptSearch
def easy_objective(config, reporter):
import time
t... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/lightgbm_example.py | Python | import lightgbm as lgb
import numpy as np
import sklearn.datasets
import sklearn.metrics
from sklearn.model_selection import train_test_split
from ray import tune
def LightGBMCallback(env):
"""Assumes that `valid_0` is the target validation score."""
_, metric, score, _ = env.evaluation_result_list[0]
tu... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/logging_example.py | Python | #!/usr/bin/env python
import argparse
import json
import os
import random
import numpy as np
from ray import tune
from ray.tune import Trainable, run
class TestLogger(tune.logger.Logger):
def on_result(self, result):
print("TestLogger", result)
def trial_str_creator(trial):
return "{}_{}_123".for... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/mlflow_example.py | Python | #!/usr/bin/env python
"""Simple MLFLow Logger example.
This uses a simple MLFlow logger. One limitation of this is that there is
no artifact support; to save artifacts with Tune and MLFlow, you will need to
start a MLFlow run inside the Trainable function/class.
"""
import mlflow
from mlflow.tracking import MlflowCli... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/mnist_pytorch.py | Python | # Original Code here:
# https://github.com/pytorch/examples/blob/master/mnist/main.py
import os
import numpy as np
import argparse
from filelock import FileLock
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import ray
from ra... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/mnist_pytorch_trainable.py | Python | # 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 tune
from ray.tune.schedulers import ASHAScheduler
from ray.tune.examples.mnist_pytorch import (trai... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/nevergrad_example.py | Python | """This test checks that Nevergrad is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.nevergrad import NevergradSearch
def easy_objective(config, reporter):
import time
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_convnet_example.py | Python | #!/usr/bin/env python
# __tutorial_imports_begin__
import argparse
import os
import numpy as np
import torch
import torch.optim as optim
from torchvision import datasets
from ray.tune.examples.mnist_pytorch import train, test, ConvNet,\
get_data_loaders
import ray
from ray import tune
from ray.tune.schedulers imp... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_dcgan_mnist/pbt_dcgan_mnist.py | Python | #!/usr/bin/env python
import ray
from ray import tune
from ray.tune.schedulers import PopulationBasedTraining
from ray.tune.trial import ExportFormat
import argparse
import os
from filelock import FileLock
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import tor... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_example.py | Python | #!/usr/bin/env python
import numpy as np
import argparse
import random
import ray
from ray.tune import Trainable, run
from ray.tune.schedulers import PopulationBasedTraining
class PBTBenchmarkExample(Trainable):
"""Toy PBT problem for benchmarking adaptive learning rate.
The goal is to optimize this traina... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_memnn_example.py | Python | """Example training a memory neural net on the bAbI dataset.
References Keras and is based off of https://keras.io/examples/babi_memnn/.
"""
from __future__ import print_function
from tensorflow.keras.models import Sequential, Model, load_model
from tensorflow.keras.layers import Embedding
from tensorflow.keras.laye... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_ppo_example.py | Python | #!/usr/bin/env python
"""Example of using PBT with RLlib.
Note that this requires a cluster with at least 8 GPUs in order for all trials
to run concurrently, otherwise PBT will round-robin train the trials which
is less efficient (or you can set {"gpu": 0} to use CPUs for SGD instead).
Note that Tune in general does ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/pbt_tune_cifar10_with_keras.py | Python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Train keras CNN on the CIFAR10 small images dataset.
The model comes from: https://zhuanlan.zhihu.com/p/29214791,
and it gets to about 87% validation accuracy in 100 epochs.
Note that the script requires a machine with 4 GPUs. You
can set {"gpu": 0} to use CPUs for tra... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/sigopt_example.py | Python | """This test checks that SigOpt is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.sigopt import SigOptSearch
def easy_objective(config, reporter):
import time
time.sl... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/skopt_example.py | Python | """This test checks that Skopt is functional.
It also checks that it is usable with a separate scheduler.
"""
import ray
from ray.tune import run
from ray.tune.schedulers import AsyncHyperBandScheduler
from ray.tune.suggest.skopt import SkOptSearch
def easy_objective(config, reporter):
import time
time.sleep... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/tf_mnist_example.py | Python | #!/usr/bin/env python
# coding: utf-8
#
# This example showcases how to use TF2.0 APIs with Tune.
# Original code: https://www.tensorflow.org/tutorials/quickstart/advanced
#
# As of 10/12/2019: One caveat of using TF2.0 is that TF AutoGraph
# functionality does not interact nicely with Ray actors. One way to get around... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/track_example.py | Python | import argparse
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.datasets import mnist
from ray.tune import track
from ray.tune.integration.keras import TuneReporterCallback
parser = argparse.ArgumentParser()
parser.add_argument(
"--smoke-test", action="store_true", help="Finish quickly ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/tune_cifar10_gluon.py | Python | from __future__ import print_function
import argparse
import random
import mxnet as mx
import numpy as np
from mxnet import gluon, init
from mxnet import autograd as ag
from mxnet.gluon import nn
from mxnet.gluon.data.vision import transforms
from gluoncv.model_zoo import get_model
from gluoncv.data import transform... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/tune_mnist_keras.py | Python | import argparse
import numpy as np
from tensorflow.keras.datasets import mnist
from ray.tune.integration.keras import TuneReporterCallback
parser = argparse.ArgumentParser()
parser.add_argument(
"--smoke-test", action="store_true", help="Finish quickly for testing")
args, _ = parser.parse_known_args()
def train... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/utils.py | Python | import tensorflow as tf
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
def get_iris_data(test_size=0.2):
iris_data = load_iris()
x = iris_data.data
y = iris_data.target.reshape(-1, 1)
encoder = OneHotEncoder(s... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/examples/xgboost_example.py | Python | import xgboost as xgb
import numpy as np
import sklearn.datasets
import sklearn.metrics
from sklearn.model_selection import train_test_split
from ray import tune
def XGBCallback(env):
tune.track.log(**dict(env.evaluation_result_list))
def train_breast_cancer(config):
data, target = sklearn.datasets.load_br... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/experiment.py | Python | import copy
import inspect
import logging
import os
import six
import types
from ray.tune.error import TuneError
from ray.tune.registry import register_trainable, get_trainable_cls
from ray.tune.result import DEFAULT_RESULTS_DIR
from ray.tune.sample import sample_from
logger = logging.getLogger(__name__)
def _raise... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/function_runner.py | Python | import logging
import time
import inspect
import threading
import traceback
from six.moves import queue
from ray.tune import track
from ray.tune import TuneError
from ray.tune.trainable import Trainable
from ray.tune.result import TIME_THIS_ITER_S, RESULT_DUPLICATE
logger = logging.getLogger(__name__)
# Time between... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/integration/keras.py | Python | from tensorflow import keras
from ray.tune import track
class TuneReporterCallback(keras.callbacks.Callback):
"""Tune Callback for Keras."""
def __init__(self, reporter=None, freq="batch", logs={}):
"""Initializer.
Args:
reporter (StatusReporter|tune.track.log|None): Tune object ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/logger.py | Python | import csv
import json
import logging
import os
import yaml
import distutils.version
import numbers
import numpy as np
import ray.cloudpickle as cloudpickle
from ray.tune.result import (NODE_IP, TRAINING_ITERATION, TIME_TOTAL_S,
TIMESTEPS_TOTAL, EXPR_PARAM_FILE,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/progress_reporter.py | Python | from __future__ import print_function
import collections
from ray.tune.result import (DEFAULT_RESULT_KEYS, CONFIG_PREFIX,
EPISODE_REWARD_MEAN, MEAN_ACCURACY, MEAN_LOSS,
TRAINING_ITERATION, TIME_TOTAL_S, TIMESTEPS_TOTAL)
from ray.tune.utils import flatten_dict
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/ray_trial_executor.py | Python | # coding: utf-8
import logging
import os
import random
import time
import traceback
from contextlib import contextmanager
import ray
from ray.exceptions import RayTimeoutError
from ray import ray_constants
from ray.resource_spec import ResourceSpec
from ray.tune.durable_trainable import DurableTrainable
from ray.tune.... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/registry.py | Python | import logging
from types import FunctionType
import ray
import ray.cloudpickle as pickle
from ray.experimental.internal_kv import _internal_kv_initialized, \
_internal_kv_get, _internal_kv_put
TRAINABLE_CLASS = "trainable_class"
ENV_CREATOR = "env_creator"
RLLIB_MODEL = "rllib_model"
RLLIB_PREPROCESSOR = "rllib... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/resources.py | Python | from collections import namedtuple
import logging
import json
from numbers import Number
# For compatibility under py2 to consider unicode as str
from six import string_types
import ray
from ray.tune import TuneError
logger = logging.getLogger(__name__)
class Resources(
namedtuple("Resources", [
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/result.py | Python | import os
# yapf: disable
# __sphinx_doc_begin__
# (Optional/Auto-filled) training is terminated. Filled only if not provided.
DONE = "done"
# (Optional) Enum for user controlled checkpoint
SHOULD_CHECKPOINT = "should_checkpoint"
# (Auto-filled) The hostname of the machine hosting the training process.
HOSTNAME = "h... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/sample.py | Python | import logging
import numpy as np
logger = logging.getLogger(__name__)
class sample_from:
"""Specify that tune should sample configuration values from this function.
Arguments:
func: An callable function to draw a sample from.
"""
def __init__(self, func):
self.func = func
def ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/__init__.py | Python | from ray.tune.schedulers.trial_scheduler import TrialScheduler, FIFOScheduler
from ray.tune.schedulers.hyperband import HyperBandScheduler
from ray.tune.schedulers.hb_bohb import HyperBandForBOHB
from ray.tune.schedulers.async_hyperband import (AsyncHyperBandScheduler,
A... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/async_hyperband.py | Python | import logging
import numpy as np
from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler
logger = logging.getLogger(__name__)
class AsyncHyperBandScheduler(FIFOScheduler):
"""Implements the Async Successive Halving.
This should provide similar theoretical performance as HyperBand but... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/hb_bohb.py | Python | import logging
from ray.tune.schedulers.trial_scheduler import TrialScheduler
from ray.tune.schedulers.hyperband import HyperBandScheduler, Bracket
from ray.tune.trial import Trial
logger = logging.getLogger(__name__)
class HyperBandForBOHB(HyperBandScheduler):
"""Extends HyperBand early stopping algorithm for ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/hyperband.py | Python | import collections
import numpy as np
import logging
from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler
from ray.tune.trial import Trial
from ray.tune.error import TuneError
logger = logging.getLogger(__name__)
# Implementation notes:
# This implementation contains 3 logical levels.
# ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/median_stopping_rule.py | Python | import collections
import logging
import numpy as np
from ray.tune.trial import Trial
from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler
logger = logging.getLogger(__name__)
class MedianStoppingRule(FIFOScheduler):
"""Implements the median stopping rule as described in the Vizier pape... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/pbt.py | Python | import copy
import itertools
import logging
import json
import math
import os
import random
import shutil
from ray.tune.error import TuneError
from ray.tune.result import TRAINING_ITERATION
from ray.tune.logger import _SafeFallbackEncoder
from ray.tune.schedulers import FIFOScheduler, TrialScheduler
from ray.tune.sugg... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/schedulers/trial_scheduler.py | Python | from ray.tune.trial import Trial
class TrialScheduler:
"""Interface for implementing a Trial Scheduler class."""
CONTINUE = "CONTINUE" #: Status for continuing trial execution
PAUSE = "PAUSE" #: Status for pausing trial execution
STOP = "STOP" #: Status for stopping trial execution
def on_tri... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/scripts.py | Python | import click
import ray.tune.commands as commands
@click.group()
def cli():
pass
@cli.command()
@click.argument("experiment_path", required=True, type=str)
@click.option(
"--sort", default=None, type=str, help="Select which column to sort on.")
@click.option(
"--output",
"-o",
default=None,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/__init__.py | Python | from ray.tune.suggest.search import SearchAlgorithm
from ray.tune.suggest.basic_variant import BasicVariantGenerator
from ray.tune.suggest.suggestion import SuggestionAlgorithm
from ray.tune.suggest.variant_generator import grid_search
from ray.tune.suggest.bohb import TuneBOHB
__all__ = [
"SearchAlgorithm", "Basi... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/ax.py | Python | try:
import ax
except ImportError:
ax = None
import logging
from ray.tune.suggest.suggestion import SuggestionAlgorithm
logger = logging.getLogger(__name__)
class AxSearch(SuggestionAlgorithm):
"""A wrapper around Ax to provide trial suggestions.
Requires Ax to be installed. Ax is an open source to... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/basic_variant.py | Python | import itertools
import random
from ray.tune.error import TuneError
from ray.tune.experiment import convert_to_experiment_list
from ray.tune.config_parser import make_parser, create_trial_from_spec
from ray.tune.suggest.variant_generator import (generate_variants, format_vars,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/bayesopt.py | Python | import copy
import logging
import pickle
try: # Python 3 only -- needed for lint test.
import bayes_opt as byo
except ImportError:
byo = None
from ray.tune.suggest.suggestion import SuggestionAlgorithm
logger = logging.getLogger(__name__)
class BayesOptSearch(SuggestionAlgorithm):
"""A wrapper around B... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/bohb.py | Python | """BOHB (Bayesian Optimization with HyperBand)"""
import copy
import logging
from ray.tune.suggest import SuggestionAlgorithm
logger = logging.getLogger(__name__)
class _BOHBJobWrapper():
"""Mock object for HpBandSter to process."""
def __init__(self, loss, budget, config):
self.result = {"loss": ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/tune/suggest/hyperopt.py | Python | import numpy as np
import copy
import logging
from functools import partial
import pickle
try:
hyperopt_logger = logging.getLogger("hyperopt")
hyperopt_logger.setLevel(logging.WARNING)
import hyperopt as hpo
except ImportError:
hpo = None
from ray.tune.error import TuneError
from ray.tune.suggest.sugge... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.