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/autoscaler/updater.py | Python | try: # py3
from shlex import quote
except ImportError: # py2
from pipes import quote
import hashlib
import logging
import os
import subprocess
import sys
import time
from threading import Thread
from getpass import getuser
from ray.autoscaler.tags import TAG_RAY_NODE_STATUS, TAG_RAY_RUNTIME_CONFIG, \
ST... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/cloudpickle/__init__.py | Python | from __future__ import absolute_import
import os
import sys
CLOUDPICKLE_PATH = os.path.dirname(os.path.realpath(__file__))
if os.path.exists(os.path.join(CLOUDPICKLE_PATH, "..", "pickle5_files", "pickle5")):
HAS_PICKLE5 = True
else:
HAS_PICKLE5 = False
if sys.version_info[:2] >= (3, 8) or HAS_PICKLE5:
fr... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/cloudpickle/cloudpickle.py | Python | """
This class is defined to override standard pickle functionality
The goals of it follow:
-Serialize lambdas and nested functions to compiled byte code
-Deal with main module correctly
-Deal with other non-serializable objects
It does not include an unpickler, as standard python unpickling suffices.
This module wa... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/cloudpickle/cloudpickle_fast.py | Python | """
New, fast version of the CloudPickler.
This new CloudPickler class can now extend the fast C Pickler instead of the
previous Python implementation of the Pickler class. Because this functionality
is only available for Python versions 3.8+, a lot of backward-compatibility
code is also removed.
Note that the C Pick... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/cluster_utils.py | Python | import logging
import time
import redis
import ray
from ray import ray_constants
logger = logging.getLogger(__name__)
class Cluster:
def __init__(self,
initialize_head=False,
connect=False,
head_node_args=None,
shutdown_at_exit=True):
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/index.html | HTML | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of th... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/speedscope-1.5.3/demangle-cpp.8a387750.js | JavaScript | parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot f... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/speedscope-1.5.3/import.a03c2bef.js | JavaScript | parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot f... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/speedscope-1.5.3/index.html | HTML | <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>speedscope</title> <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet"> <script></script> <l... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/speedscope-1.5.3/reset.7ae984ff.css | CSS | a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/public/speedscope-1.5.3/speedscope.75eb7d8e.js | JavaScript | parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot f... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/App.tsx | TypeScript (TSX) | import CssBaseline from "@material-ui/core/CssBaseline";
import React from "react";
import { Provider } from "react-redux";
import { BrowserRouter, Route } from "react-router-dom";
import Dashboard from "./pages/dashboard/Dashboard";
import Errors from "./pages/dashboard/dialogs/errors/Errors";
import Logs from "./page... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/api.ts | TypeScript | const base =
process.env.NODE_ENV === "development"
? "http://localhost:8265"
: window.location.origin;
// TODO(mitchellstern): Add JSON schema validation for the responses.
const get = async <T>(path: string, params: { [key: string]: any }) => {
const url = new URL(path, base);
for (const [key, value] o... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/common/DialogWithTitle.tsx | TypeScript (TSX) | import Dialog from "@material-ui/core/Dialog";
import IconButton from "@material-ui/core/IconButton";
import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Ty... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/common/NumberedLines.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/common/UsageBar.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import React from "react";
const blend = (
[r1, g1, b1]: number[],
[r2, g2, b2]: number[],
ratio: number... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/common/formatUtils.ts | TypeScript | export const formatByteAmount = (
amount: number,
unit: "mebibyte" | "gibibyte"
) =>
`${(
amount / (unit === "mebibyte" ? Math.pow(1024, 2) : Math.pow(1024, 3))
).toFixed(1)} ${unit === "mebibyte" ? "MiB" : "GiB"}`;
export const formatUsage = (
used: number,
total: number,
unit: "mebibyte" | "gibibyt... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/index.tsx | TypeScript (TSX) | import React from "react";
import ReactDOM from "react-dom";
import "typeface-roboto";
import App from "./App";
ReactDOM.render(<App />, document.getElementById("root"));
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/Dashboard.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Tab from "@material-ui/core/Tab";
import Tabs from "@material-ui/core/Tabs";
import Typography from "@ma... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/LastUpdated.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Typography from "@material-ui/core/Typography";
import React from "react";
import { connect } from "reac... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/dialogs/errors/Errors.tsx | TypeScript (TSX) | import { fade } from "@material-ui/core/styles/colorManipulator";
import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Typography from "@material-ui/core/Typ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/dialogs/logs/Logs.tsx | TypeScript (TSX) | import { fade } from "@material-ui/core/styles/colorManipulator";
import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Typography from "@material-ui/core/Typ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx | TypeScript (TSX) | import Typography from "@material-ui/core/Typography";
import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import React from "react";
import { RayletInfoResponse }... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/logical-view/Actors.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import React from "react";
import { RayletInfoResponse } from "../../../api";
import Actor from "./Actor";
con... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/logical-view/LogicalView.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Typography from "@material-ui/core/Typography";
import React from "react";
import { connect } from "reac... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/NodeInfo.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/NodeRowGroup.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import TableCell from "@material-ui/core/TableCell";
import TableRow from "@material-ui/core/TableRow";
import ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/TotalRow.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import TableCell from "@material-ui/core/TableCell";
import TableRow from "@material-ui/core/TableRow";
import ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/CPU.tsx | TypeScript (TSX) | import React from "react";
import UsageBar from "../../../../common/UsageBar";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
const getWeightedAverage = (
input: {
weight: number;
value: number;
}[]
) => {
if (input.length === 0) {
return 0;
}... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Disk.tsx | TypeScript (TSX) | import Typography from "@material-ui/core/Typography";
import React from "react";
import { formatUsage } from "../../../../common/formatUtils";
import UsageBar from "../../../../common/UsageBar";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const Cluster... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Errors.tsx | TypeScript (TSX) | import Link from "@material-ui/core/Link";
import Typography from "@material-ui/core/Typography";
import React from "react";
import { Link as RouterLink } from "react-router-dom";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const makeClusterErrors = (er... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Host.tsx | TypeScript (TSX) | import React from "react";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const ClusterHost: ClusterFeatureComponent = ({ nodes }) => (
<React.Fragment>
Totals ({nodes.length.toLocaleString()}{" "}
{nodes.length === 1 ? "host" : "hosts"})
</Rea... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Logs.tsx | TypeScript (TSX) | import Link from "@material-ui/core/Link";
import Typography from "@material-ui/core/Typography";
import React from "react";
import { Link as RouterLink } from "react-router-dom";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const makeClusterLogs = (logC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/RAM.tsx | TypeScript (TSX) | import React from "react";
import { formatByteAmount, formatUsage } from "../../../../common/formatUtils";
import UsageBar from "../../../../common/UsageBar";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const ClusterRAM: ClusterFeatureComponent = ({ nod... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Received.tsx | TypeScript (TSX) | import Typography from "@material-ui/core/Typography";
import React from "react";
import { formatByteAmount } from "../../../../common/formatUtils";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const ClusterReceived: ClusterFeatureComponent = ({ nodes })... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Sent.tsx | TypeScript (TSX) | import Typography from "@material-ui/core/Typography";
import React from "react";
import { formatByteAmount } from "../../../../common/formatUtils";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const ClusterSent: ClusterFeatureComponent = ({ nodes }) => ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Uptime.tsx | TypeScript (TSX) | import Typography from "@material-ui/core/Typography";
import React from "react";
import { formatDuration } from "../../../../common/formatUtils";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
const getUptime = (bootTime: number) => Date.now() / 1000 - bootTime;... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/Workers.tsx | TypeScript (TSX) | import React from "react";
import {
ClusterFeatureComponent,
NodeFeatureComponent,
WorkerFeatureComponent
} from "./types";
export const ClusterWorkers: ClusterFeatureComponent = ({ nodes }) => {
let totalWorkers = 0;
let totalCpus = 0;
for (const node of nodes) {
totalWorkers += node.workers.length;
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/node-info/features/types.tsx | TypeScript (TSX) | import React from "react";
import { NodeInfoResponse } from "../../../../api";
type ArrayType<T> = T extends Array<infer U> ? U : never;
type Node = ArrayType<NodeInfoResponse["clients"]>;
type Worker = ArrayType<Node["workers"]>;
type ClusterFeatureData = { nodes: Node[] };
type NodeFeatureData = { node: Node };
typ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/ray-config/RayConfig.tsx | TypeScript (TSX) | import { Theme } from "@material-ui/core/styles/createMuiTheme";
import createStyles from "@material-ui/core/styles/createStyles";
import withStyles, { WithStyles } from "@material-ui/core/styles/withStyles";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/pages/dashboard/state.ts | TypeScript | import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import {
NodeInfoResponse,
RayConfigResponse,
RayletInfoResponse
} from "../../api";
const name = "dashboard";
interface State {
tab: number;
rayConfig: RayConfigResponse | null;
nodeInfo: NodeInfoResponse | null;
rayletInfo: RayletInfoRespo... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/react-app-env.d.ts | TypeScript | /// <reference types="react-scripts" />
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/client/src/store.ts | TypeScript | import { configureStore } from "@reduxjs/toolkit";
import { dashboardReducer } from "./pages/dashboard/state";
export const store = configureStore({
reducer: {
dashboard: dashboardReducer
},
devTools: process.env.NODE_ENV === "development"
});
export type StoreState = ReturnType<typeof store.getState>;
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/dashboard.py | Python | try:
import aiohttp.web
except ImportError:
print("The dashboard requires aiohttp to run.")
import sys
sys.exit(1)
import argparse
import copy
import datetime
import json
import logging
import os
import re
import threading
import time
import traceback
import yaml
from base64 import b64decode
from coll... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/index.html | HTML | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ray dashboard</title>
<meta name="description" content="ray dashboard"</meta>
<link rel="stylesheet" href="res/main.css">
<meta name="referrer" content="same-origin">
<!--
<script src="https://cdnjs.cloudflare.com/ajax/l... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/res/main.css | CSS | * { font-family: monospace; margin: 0; padding: 0; }
h1, h2 { text-align: center; margin: 1rem 0; }
h1 { font-size: 3rem; margin: 0.5rem auto; text-align: center; }
h2 { font-size: 2rem; margin: 1rem auto; text-align: center; }
div#dashboard {
width: 116rem; margin: 1rem auto;
}
table, tbody, thead {
width: 10... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dashboard/res/main.js | JavaScript | let dashboard = new Vue({
el: "#dashboard",
data: {
now: (new Date()).getTime() / 1000,
shown: {},
error: "loading...",
last_update: undefined,
clients: undefined,
totals: undefined,
tasks: undefined,
ray_config: undefined,
},
methods: {
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/dataframe/__init__.py | Python | raise DeprecationWarning("Pandas on Ray has moved to Modin: "
"github.com/modin-project/modin")
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/exceptions.py | Python | import os
import colorama
try:
import setproctitle
except ImportError:
setproctitle = None
import ray
class RayError(Exception):
"""Super class of all ray exception types."""
pass
class RayTaskError(RayError):
"""Indicates that a task threw an exception during execution.
If a task throws... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/__init__.py | Python | from .gcs_flush_policy import (set_flushing_policy, GcsFlushPolicy,
SimpleGcsFlushPolicy)
from .named_actors import get_actor, register_actor
from .api import get, wait
from .actor_pool import ActorPool
from .dynamic_resources import set_resource
from . import iter
def TensorFlowVariabl... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/actor_pool.py | Python | import ray
class ActorPool:
"""Utility class to operate on a fixed pool of actors.
Arguments:
actors (list): List of Ray actor handles to use in this pool.
Examples:
>>> a1, a2 = Actor.remote(), Actor.remote()
>>> pool = ActorPool([a1, a2])
>>> print(pool.map(lambda a, v:... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/api.py | Python | import ray
import numpy as np
def get(object_ids):
"""Get a single or a collection of remote objects from the object store.
This method is identical to `ray.get` except it adds support for tuples,
ndarrays and dictionaries.
Args:
object_ids: Object ID of the object to get, a list, tuple, nda... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/distributed/__init__.py | Python | from . import random
from . import linalg
from .core import (BLOCK_SIZE, DistArray, assemble, zeros, ones, copy, eye,
triu, tril, blockwise_dot, dot, transpose, add, subtract,
numpy_to_dist, subblocks)
__all__ = [
"random", "linalg", "BLOCK_SIZE", "DistArray", "assemble", "zer... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/distributed/core.py | Python | import numpy as np
import ray.experimental.array.remote as ra
import ray
BLOCK_SIZE = 10
class DistArray:
def __init__(self, shape, objectids=None):
self.shape = shape
self.ndim = len(shape)
self.num_blocks = [
int(np.ceil(1.0 * a / BLOCK_SIZE)) for a in self.shape
]
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/distributed/linalg.py | Python | import numpy as np
import ray.experimental.array.remote as ra
import ray
from . import core
__all__ = ["tsqr", "modified_lu", "tsqr_hr", "qr"]
@ray.remote(num_return_vals=2)
def tsqr(a):
"""Perform a QR decomposition of a tall-skinny matrix.
Args:
a: A distributed matrix with shape MxN (suppose K =... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/distributed/random.py | Python | import numpy as np
import ray.experimental.array.remote as ra
import ray
from .core import DistArray
@ray.remote
def normal(shape):
num_blocks = DistArray.compute_num_blocks(shape)
objectids = np.empty(num_blocks, dtype=object)
for index in np.ndindex(*num_blocks):
objectids[index] = ra.random.no... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/remote/__init__.py | Python | from . import random
from . import linalg
from .core import (zeros, zeros_like, ones, eye, dot, vstack, hstack, subarray,
copy, tril, triu, diag, transpose, add, subtract, sum,
shape, sum_list)
__all__ = [
"random", "linalg", "zeros", "zeros_like", "ones", "eye", "dot", "vstac... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/remote/core.py | Python | import numpy as np
import ray
@ray.remote
def zeros(shape, dtype_name="float", order="C"):
return np.zeros(shape, dtype=np.dtype(dtype_name), order=order)
@ray.remote
def zeros_like(a, dtype_name="None", order="K", subok=True):
dtype_val = None if dtype_name == "None" else np.dtype(dtype_name)
return np... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/remote/linalg.py | Python | import numpy as np
import ray
__all__ = [
"matrix_power", "solve", "tensorsolve", "tensorinv", "inv", "cholesky",
"eigvals", "eigvalsh", "pinv", "slogdet", "det", "svd", "eig", "eigh",
"lstsq", "norm", "qr", "cond", "matrix_rank", "multi_dot"
]
@ray.remote
def matrix_power(M, n):
return np.linalg.mat... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/array/remote/random.py | Python | import numpy as np
import ray
@ray.remote
def normal(shape):
return np.random.normal(size=shape)
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/async_api.py | Python | # Note: asyncio is only compatible with Python 3
import asyncio
import functools
import threading
import pyarrow.plasma as plasma
import ray
from ray.experimental.async_plasma import PlasmaProtocol, PlasmaEventHandler
from ray.services import logger
handler = None
transport = None
protocol = None
class _ThreadSaf... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/async_plasma.py | Python | import asyncio
import ctypes
import sys
import pyarrow.plasma as plasma
import ray
from ray.services import logger
INT64_SIZE = ctypes.sizeof(ctypes.c_int64)
def _release_waiter(waiter, *_):
if not waiter.done():
waiter.set_result(None)
class PlasmaProtocol(asyncio.Protocol):
"""Protocol control ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/dynamic_resources.py | Python | import ray
def set_resource(resource_name, capacity, client_id=None):
""" Set a resource to a specified capacity.
This creates, updates or deletes a custom resource for a target clientId.
If the resource already exists, it's capacity is updated to the new value.
If the capacity is set to 0, the resou... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/gcs_flush_policy.py | Python | import os
import time
import ray
import ray.cloudpickle as pickle
class GcsFlushPolicy:
"""Experimental: a policy to control GCS flushing.
Used by Monitor to enable automatic control of memory usage.
"""
def should_flush(self, redis_client):
"""Returns a bool, whether a flush request should... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/internal_kv.py | Python | import ray
_local = {} # dict for local mode
def _internal_kv_initialized():
worker = ray.worker.get_global_worker()
return hasattr(worker, "mode") and worker.mode is not None
def _internal_kv_get(key):
"""Fetch the value of a binary key."""
worker = ray.worker.get_global_worker()
if worker.m... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/iter.py | Python | from typing import TypeVar, Generic, Iterable, List, Callable, Any
import ray
# The type of an iterator element.
T = TypeVar("T")
U = TypeVar("U")
def from_items(items: List[T], num_shards: int = 2,
repeat: bool = False) -> "ParallelIterator[T]":
"""Create a parallel iterator from an existing set... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/multiprocessing/__init__.py | Python | from multiprocessing import TimeoutError
from .pool import Pool
__all__ = ["Pool", "TimeoutError"]
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/multiprocessing/pool.py | Python | import logging
from multiprocessing import TimeoutError
import os
import time
import random
import collections
import threading
import queue
import copy
import ray
logger = logging.getLogger(__name__)
RAY_ADDRESS_ENV = "RAY_ADDRESS"
# Helper function to divide a by b and round the result up.
def div_round_up(a, b)... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/named_actors.py | Python | import ray
import ray.cloudpickle as pickle
from ray.experimental.internal_kv import _internal_kv_get, _internal_kv_put
def _calculate_key(name):
"""Generate a Redis key with the given name.
Args:
name: The name of the named actor.
Returns:
The key to use for storing a named actor in Red... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/no_return.py | Python | class NoReturn:
"""Do not store the return value in the object store.
If a task returns this object, then Ray will not store this object in the
object store. Calling `ray.get` on the task's return ObjectIDs may block
indefinitely unless the task manually stores an object for the
corresponding Objec... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/queue.py | Python | from collections import deque
import time
import ray
class Empty(Exception):
pass
class Full(Exception):
pass
class Queue:
"""Queue implementation on Ray.
Args:
maxsize (int): maximum size of the queue. If zero, size is unboundend.
"""
def __init__(self, maxsize=0):
self... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/__init__.py | Python | from ray.experimental.serve.backend_config import BackendConfig
from ray.experimental.serve.policy import RoutePolicy
from ray.experimental.serve.api import (
init, create_backend, create_endpoint, link, split, get_handle, stat,
set_backend_config, get_backend_config, accept_batch) # noqa: E402
__all__ = [
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/api.py | Python | import inspect
from functools import wraps
from tempfile import mkstemp
import numpy as np
import ray
from ray.experimental.serve.constants import (
DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT, SERVE_NURSERY_NAME)
from ray.experimental.serve.global_state import (GlobalState,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/backend_config.py | Python | from copy import deepcopy
class BackendConfig:
# configs not needed for actor creation when
# instantiating a replica
_serve_configs = ["_num_replicas", "max_batch_size"]
# configs which when changed leads to restarting
# the existing replicas.
restart_on_change_fields = ["resources", "num_cp... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/constants.py | Python | #: The interval which http server refreshes its routing table
HTTP_ROUTER_CHECKER_INTERVAL_S = 2
#: Actor name used to register actor nursery
SERVE_NURSERY_NAME = "SERVE_ACTOR_NURSERY"
#: KVStore connector key in bootstrap config
BOOTSTRAP_KV_STORE_CONN_KEY = "kv_store_connector"
#: HTTP Address
DEFAULT_HTTP_ADDRESS... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/context.py | Python | from enum import IntEnum
from ray.experimental.serve.exceptions import RayServeException
class TaskContext(IntEnum):
"""TaskContext constants for queue.enqueue method"""
Web = 1
Python = 2
# Global variable will be modified in worker
# web == True: currrently processing a request from web server
# web ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo.py | Python | """
Example service that prints out http context.
"""
import time
import requests
from ray.experimental import serve
from ray.experimental.serve.utils import pformat_color_json
def echo(flask_request):
return "hello " + flask_request.args.get("name", "serve!")
serve.init(blocking=True)
serve.create_endpoint... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_actor.py | Python | """
Example actor that adds an increment to a number. This number can
come from either web (parsing Flask request) or python call.
This actor can be called from HTTP as well as from Python.
"""
import time
import requests
import ray
from ray.experimental import serve
from ray.experimental.serve.utils import pformat... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_actor_batch.py | Python | """
Example actor that adds an increment to a number. This number can
come from either web (parsing Flask request) or python call.
The queries incoming to this actor are batched.
This actor can be called from HTTP as well as from Python.
"""
import time
import requests
import ray
from ray.experimental import serve
f... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_batching.py | Python | """
This example has backend which has batching functionality enabled.
"""
import ray
from ray.experimental import serve
from ray.experimental.serve import BackendConfig
class MagicCounter:
def __init__(self, increment):
self.increment = increment
@serve.accept_batch
def __call__(self, flask_req... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_error.py | Python | """
Example of error handling mechanism in ray serve.
We are going to define a buggy function that raise some exception:
>>> def echo(_):
raise Exception("oh no")
The expected behavior is:
- HTTP server should respond with "internal error" in the response JSON
- ray.get(handle.remote()) should raise RayTaskEr... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_fixed_packing.py | Python | """
Example showing fixed packing policy. The outputs from
v1 and v2 will be coming according to packing_num specified!
This is a packed round robin example. First batch of packing_num
(five in this example) queries would go to 'echo:v1' backend and
then next batch of packing_num queries would go to 'echo:v2'
backend.
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_full.py | Python | """
Full example of ray.serve module
"""
import time
import requests
import ray
import ray.experimental.serve as serve
from ray.experimental.serve.utils import pformat_color_json
# initialize ray serve system.
# blocking=True will wait for HTTP server to be ready to serve request.
serve.init(blocking=True)
# an en... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_round_robin.py | Python | """
Example showing round robin policy. The outputs from
v1 and v2 will be (almost) interleaved as queries get processed.
"""
import time
import requests
from ray.experimental import serve
from ray.experimental.serve.utils import pformat_color_json
def echo_v1(_):
return "v1"
def echo_v2(_):
return "v2"
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_slo_reverse.py | Python | """
SLO [reverse] example of ray.serve module
"""
import time
import requests
import ray
import ray.experimental.serve as serve
# initialize ray serve system.
# blocking=True will wait for HTTP server to be ready to serve request.
serve.init(blocking=True)
# an endpoint is associated with an http URL.
serve.create... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/examples/echo_split.py | Python | """
Example of traffic splitting. We will first use echo:v1. Then v1 and v2
will split the incoming traffic evenly.
"""
import time
import requests
from ray.experimental import serve
from ray.experimental.serve.utils import pformat_color_json
def echo_v1(_):
return "v1"
def echo_v2(_):
return "v2"
serve... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/exceptions.py | Python | class RayServeException(Exception):
pass
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/global_state.py | Python | import ray
from ray.experimental.serve.constants import (
BOOTSTRAP_KV_STORE_CONN_KEY, DEFAULT_HTTP_HOST, DEFAULT_HTTP_PORT,
SERVE_NURSERY_NAME)
from ray.experimental.serve.kv_store_service import (
BackendTable, RoutingTable, TrafficPolicyTable)
from ray.experimental.serve.metric import (MetricMonitor,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/handle.py | Python | import ray
from ray.experimental import serve
from ray.experimental.serve.context import TaskContext
from ray.experimental.serve.exceptions import RayServeException
from ray.experimental.serve.constants import DEFAULT_HTTP_ADDRESS
class RayServeHandle:
"""A handle to a service endpoint.
Invoking this endpoin... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/http_util.py | Python | import io
import flask
def build_flask_request(asgi_scope_dict, request_body):
"""Build and return a flask request from ASGI payload
This function is indented to be used immediately before task invocation
happen.
"""
wsgi_environ = build_wsgi_environ(asgi_scope_dict, request_body)
return fla... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/kv_store_service.py | Python | import json
import sqlite3
from abc import ABC
from ray import cloudpickle as pickle
import ray.experimental.internal_kv as ray_kv
from ray.experimental.serve.utils import logger
class NamespacedKVStore(ABC):
"""Abstract base class for a namespaced key-value store.
The idea is that multiple key-value store... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/metric.py | Python | import time
import numpy as np
import pandas as pd
import ray
@ray.remote(num_cpus=0)
class MetricMonitor:
def __init__(self, gc_window_seconds=3600):
"""Metric monitor scrapes metrics from ray serve actors
and allow windowed query operations.
Args:
gc_window_seconds(int): H... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/policy.py | Python | from enum import Enum
from ray.experimental.serve.queues import (
RoundRobinPolicyQueueActor, RandomPolicyQueueActor,
PowerOfTwoPolicyQueueActor, FixedPackingPolicyQueueActor)
class RoutePolicy(Enum):
"""
A class for registering the backend selection policy.
Add a name and the corresponding class.... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/queues.py | Python | from collections import defaultdict, deque
import numpy as np
import ray
from ray.experimental.serve.utils import logger
import itertools
from blist import sortedlist
import time
class Query:
def __init__(self,
request_args,
request_kwargs,
request_context,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/scripts.py | Python | import json
import click
import ray
import ray.experimental.serve as serve
@click.group("serve", help="Commands working with ray serve")
def serve_cli():
pass
@serve_cli.command(help="Initialize ray serve components")
def init():
ray.init(address="auto")
serve.init(blocking=True)
@serve_cli.command(... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/server.py | Python | import asyncio
import json
import uvicorn
import ray
from ray.experimental.async_api import _async_init
from ray.experimental.serve.constants import HTTP_ROUTER_CHECKER_INTERVAL_S
from ray.experimental.serve.context import TaskContext
from ray.experimental.serve.utils import BytesEncoder
from urllib.parse import pars... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/task_runner.py | Python | import time
import traceback
import ray
from ray.experimental.serve import context as serve_context
from ray.experimental.serve.context import FakeFlaskRequest
from collections import defaultdict
from ray.experimental.serve.utils import parse_request_item
from ray.experimental.serve.exceptions import RayServeException... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/tests/conftest.py | Python | import os
import tempfile
import pytest
import ray
from ray.experimental import serve
@pytest.fixture(scope="session")
def serve_instance():
_, new_db_path = tempfile.mkstemp(suffix=".test.db")
serve.init(
kv_store_path=new_db_path,
blocking=True,
ray_init_kwargs={"num_cpus": 36})
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/tests/test_api.py | Python | import time
import pytest
import requests
from ray.experimental import serve
from ray.experimental.serve import BackendConfig
import ray
def test_e2e(serve_instance):
serve.init() # so we have access to global state
serve.create_endpoint("endpoint", "/api", blocking=True)
result = serve.api._get_global_... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
python/ray/experimental/serve/tests/test_metric.py | Python | import numpy as np
import pytest
import ray
from ray.experimental.serve.metric import MetricMonitor
@pytest.fixture(scope="session")
def start_target_actor(ray_instance):
@ray.remote
class Target:
def __init__(self):
self.counter_value = 0
def _serve_metric(self):
sel... | 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.