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 |
|---|---|---|---|---|---|---|---|---|---|
src/t_string.c | C | /*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above co... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/t_zset.c | C | /*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* Copyright (c) 2009-2012, Pieter Noordhuis <pcnoordhuis at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condition... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/testhelp.h | C/C++ Header | /* This is a really minimal testing framework for C.
*
* Example:
*
* test_cond("Check if 1 == 1", 1==1)
* test_cond("Check if 5 > 10", 5 > 10)
* test_report()
*
* ----------------------------------------------------------------------------
*
* Copyright (c) 2010-2012, Salvatore Sanfilippo <antirez at gmail d... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/util.c | C | /*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above co... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/util.h | C/C++ Header | /*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above co... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/version.h | C/C++ Header | #define REDIS_VERSION "5.0.6"
| zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/ziplist.c | C | /* The ziplist is a specially encoded dually linked list that is designed
* to be very memory efficient. It stores both strings and integer values,
* where integers are encoded as actual integers instead of a series of
* characters. It allows push and pop operations on either side of the list
* in O(1) time. Howeve... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/ziplist.h | C/C++ Header | /*
* Copyright (c) 2009-2012, Pieter Noordhuis <pcnoordhuis at gmail dot com>
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condition... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/zipmap.c | C | /* String -> String Map data structure optimized for size.
* This file implements a data structure mapping strings to other strings
* implementing an O(n) lookup data structure designed to be very memory
* efficient.
*
* The Redis Hash type uses this data structure for hashes composed of a small
* number of eleme... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/zipmap.h | C/C++ Header | /* String -> String Map data structure optimized for size.
*
* See zipmap.c for more info.
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and ... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/zmalloc.c | C | /* zmalloc - total amount of allocated memory aware version of malloc()
*
* Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions ar... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
src/zmalloc.h | C/C++ Header | /* zmalloc - total amount of allocated memory aware version of malloc()
*
* Copyright (c) 2009-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions ar... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
tests/modules/commandfilter.c | C | #define REDISMODULE_EXPERIMENTAL_API
#include "redismodule.h"
#include <string.h>
static RedisModuleString *log_key_name;
static const char log_command_name[] = "commandfilter.log";
static const char ping_command_name[] = "commandfilter.ping";
static const char unregister_command_name[] = "commandfilter.unregister";... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
tests/modules/testrdb.c | C | #include "redismodule.h"
#include <string.h>
#include <assert.h>
/* Module configuration, save aux or not? */
long long conf_aux_count = 0;
/* Registered type */
RedisModuleType *testrdb_type = NULL;
/* Global values to store and persist to aux */
RedisModuleString *before_str = NULL;
RedisModuleString *after_str =... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/corrupt_rdb.c | C | /* Trivia program to corrupt an RDB file in order to check the RDB check
* program behavior and effectiveness.
*
* Copyright (C) 2016 Salvatore Sanfilippo.
* This software is released in the 3-clause BSD license. */
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/generate-command-help.rb | Ruby | #!/usr/bin/env ruby
GROUPS = [
"generic",
"string",
"list",
"set",
"sorted_set",
"hash",
"pubsub",
"transactions",
"connection",
"server",
"scripting",
"hyperloglog",
"cluster",
"geo",
"stream"
].freeze
GROUPS_BY_NAME = Hash[*
GROUPS.each_with_index.map do |n,i|
[n,i]
end.flatten... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/hashtable/rehashing.c | C | #include "redis.h"
#include "dict.h"
void _redisAssert(char *x, char *y, int l) {
printf("ASSERT: %s %s %d\n",x,y,l);
exit(1);
}
unsigned int dictKeyHash(const void *keyp) {
unsigned long key = (unsigned long)keyp;
key = dictGenHashFunction(&key,sizeof(key));
key += ~(key << 15);
key ^= (key ... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/hyperloglog/hll-err.rb | Ruby | # hll-err.rb - Copyright (C) 2014 Salvatore Sanfilippo
# BSD license, See the COPYING file for more information.
#
# Check error of HyperLogLog Redis implementation for different set sizes.
require 'rubygems'
require 'redis'
require 'digest/sha1'
r = Redis.new
r.del('hll')
i = 0
while true do
100.times {
... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/hyperloglog/hll-gnuplot-graph.rb | Ruby | # hll-err.rb - Copyright (C) 2014 Salvatore Sanfilippo
# BSD license, See the COPYING file for more information.
#
# This program is suited to output average and maximum errors of
# the Redis HyperLogLog implementation in a format suitable to print
# graphs using gnuplot.
require 'rubygems'
require 'redis'
require 'di... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/install_server.sh | Shell | #!/bin/sh
# Copyright 2011 Dvir Volk <dvirsk at gmail dot com>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# t... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/lru/lfu-simulation.c | C | #include <stdio.h>
#include <time.h>
#include <stdint.h>
#include <stdlib.h>
int decr_every = 1;
int keyspace_size = 1000000;
time_t switch_after = 30; /* Switch access pattern after N seconds. */
struct entry {
/* Field that the LFU Redis implementation will have (we have
* 24 bits of total space in the obj... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/lru/test-lru.rb | Ruby | require 'rubygems'
require 'redis'
$runs = []; # Remember the error rate of each run for average purposes.
$o = {}; # Options set parsing arguments
def testit(filename)
r = Redis.new
r.config("SET","maxmemory","2000000")
if $o[:ttl]
r.config("SET","maxmemory-policy","volatile-ttl")
else
... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/redis-copy.rb | Ruby | # redis-copy.rb - Copyright (C) 2009-2010 Salvatore Sanfilippo
# BSD license, See the COPYING file for more information.
#
# Copy the whole dataset from one Redis instance to another one
#
# WARNING: this utility is deprecated and serves as a legacy adapter
# for the more-robust redis-copy gem.
require 'shell... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/redis-sha1.rb | Ruby | # redis-sha1.rb - Copyright (C) 2009 Salvatore Sanfilippo
# BSD license, See the COPYING file for more information.
#
# Performs the SHA1 sum of the whole datset.
# This is useful to spot bugs in persistence related code and to make sure
# Slaves and Masters are in SYNC.
#
# If you hack this code make sure to sort keys... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/releasetools/01_create_tarball.sh | Shell | #!/bin/sh
if [ $# != "1" ]
then
echo "Usage: ./mkrelease.sh <git-ref>"
exit 1
fi
TAG=$1
TARNAME="redis-${TAG}.tar"
echo "Generating /tmp/${TARNAME}"
cd ~/hack/redis
git archive $TAG --prefix redis-${TAG}/ > /tmp/$TARNAME || exit 1
echo "Gizipping the archive"
rm -f /tmp/$TARNAME.gz
gzip -9 /tmp/$TARNAME
| zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/releasetools/02_upload_tarball.sh | Shell | #!/bin/bash
echo "Uploading..."
scp /tmp/redis-${1}.tar.gz antirez@antirez.com:/var/virtual/download.redis.io/httpdocs/releases/
echo "Updating web site... (press any key if it is a stable release, or Ctrl+C)"
read x
ssh antirez@antirez.com "cd /var/virtual/download.redis.io/httpdocs; ./update.sh ${1}"
| zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/releasetools/03_test_release.sh | Shell | #!/bin/sh
if [ $# != "1" ]
then
echo "Usage: ${0} <git-ref>"
exit 1
fi
TAG=$1
TARNAME="redis-${TAG}.tar.gz"
DOWNLOADURL="http://download.redis.io/releases/${TARNAME}"
ssh antirez@metal "export TERM=xterm;
cd /tmp;
rm -rf test_release_tmp_dir;
cd test_re... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/releasetools/04_release_hash.sh | Shell | #!/bin/bash
SHA=$(curl -s http://download.redis.io/releases/redis-${1}.tar.gz | shasum -a 256 | cut -f 1 -d' ')
ENTRY="hash redis-${1}.tar.gz sha256 $SHA http://download.redis.io/releases/redis-${1}.tar.gz"
echo $ENTRY >> ~/hack/redis-hashes/README
vi ~/hack/redis-hashes/README
echo "Press any key to commit, Ctrl-C to ... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
utils/whatisdoing.sh | Shell | # This script is from http://poormansprofiler.org/
#
# NOTE: Instead of using this script, you should use the Redis
# Software Watchdog, which provides a similar functionality but in
# a more reliable / easy to use way.
#
# Check http://redis.io/topics/latency for more information.
#!/bin/bash
nsamples=1
sleeptime=0
p... | zhayujie/condis | 2 | Expanded version of redis with strong consistent base on raft. | C | zhayujie | Minimal Future Tech | |
kernel/defs.h | C/C++ Header | struct trap_context * get_trap_context(void);
void trap_handle(void);
void usertrapret(void);
void syscall(void);
// util
void printf(char * st);
void putc(uint64 c);
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/entry.S | Assembly | .section .text
la sp, kstack
li a0, 4096
add sp, sp, a0
call start
.section .data
.global _app_0_start
_app_0_start:
.incbin "user/app.bin"
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/entry.d | D | kernel/entry.o: kernel/entry.S
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/riscv.h | C/C++ Header | #define SSTATUS_SPP (1L << 8) // Previous mode, 1=Supervisor, 0=User
#define SSTATUS_SPIE (1L << 5) // Supervisor Previous Interrupt Enable
#define SSTATUS_UPIE (1L << 4) // User Previous Interrupt Enable
#define SSTATUS_SIE (1L << 1) // Supervisor Interrupt Enable
#define SSTATUS_UIE (1L << 0) // User Interrupt Ena... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/start.c | C | #include "types.h"
#include "riscv.h"
#include "trap.h"
#include "defs.h"
// app start address
extern uint64 _app_0_start;
extern void userret(uint64 trap_context);
extern void usertrap(uint64 trap_context);
// kernel stack
char kstack[4096];
// user stack
char ustack[4096];
void start(void)
{
#ifdef D1_BOARD
... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/start.d | D | kernel/start.o: kernel/start.c kernel/types.h kernel/riscv.h \
kernel/trap.h kernel/defs.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/syscall.c | C | #include "types.h"
#include "trap.h"
#include "defs.h"
#include "syscall.h"
uint64 sys_write(void)
{
uint64 c = (uint64) get_trap_context()->a0;
putc(c);
return 0;
}
void sched(void)
{
while (1) {
}
}
uint64 sys_exit(void)
{
printf("[kernel] application exit\r\n");
sched();
return 0;
}
static ui... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/syscall.d | D | kernel/syscall.o: kernel/syscall.c kernel/types.h kernel/trap.h \
kernel/defs.h kernel/syscall.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/syscall.h | C/C++ Header | #define SYS_write 1
#define SYS_exit 2
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/trap.c | C | #include "types.h"
#include "riscv.h"
#include "trap.h"
#include "defs.h"
extern void userret(uint64 trap_context);
extern char kstack[4096];
// trap context
struct trap_context trap_context;
void trap_handle(void) {
// uint64 cause = r_scause();
syscall();
w_sepc(r_sepc() + 4);
usertrapret();
}
void use... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/trap.d | D | kernel/trap.o: kernel/trap.c kernel/types.h kernel/riscv.h kernel/trap.h \
kernel/defs.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/trap.h | C/C++ Header | struct trap_context {
/* 0 */ uint64 x0;
/* 8 */ uint64 ra;
/* 16 */ uint64 sp;
/* 24 */ uint64 gp;
/* 32 */ uint64 tp;
/* 40 */ uint64 t0;
/* 48 */ uint64 t1;
/* 56 */ uint64 t2;
/* 64 */ uint64 s0;
/* 72 */ uint64 s1;
/* 80 */ uint64 a0;
/* 88 */ uint64 a1;
/* 96 */ uint64 a2;... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/trapentry.S | Assembly | .section .text
.global usertrap
usertrap:
csrrw a0, sscratch, a0
sd ra, 8(a0)
sd sp, 16(a0)
sd gp, 24(a0)
sd tp, 32(a0)
sd t0, 40(a0)
sd t1, 48(a0)
sd t2, 56(a0)
sd s0, 64(a0)
sd s1, 72(a0)
# sd a0, 80(a0)
sd a1, 88(a0)
sd a2, 96(a0)
sd a3, 104(a0)
sd a4, 112... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/types.h | C/C++ Header | typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long uint64;
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/util.c | C | #include "types.h"
#define THR 0
// #define LSR 0x7c // line status register
#define LSR 5 // line status register
#define LSR_RX_READY (1<<0) // input is waiting to be read from RHR
// #define LSR_TX_IDLE 0x02 // THR can accept another character to send
#define LSR_TX_IDLE (1<<5) ... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
kernel/util.d | D | kernel/util.o: kernel/util.c kernel/types.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/app.c | C | #include "user.h"
int main(void)
{
printf("[User] application start\r\n");
exit(0);
}
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/app.d | D | user/app.o: user/app.c user/user.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/app.s | Assembly | .file "app.c"
.option nopic
.option norelax
.attribute arch, "rv64i2p0_m2p0_a2p0_f2p0_d2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.Ltext0:
.cfi_sections .debug_frame
.section .rodata
.align 3
.LC0:
.string "application start\r\n"
.text
.align 2
.globl main
.type main, @function
... | zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/user.h | C/C++ Header | // syscall
int write(char c);
int exit(int) __attribute__((noreturn));
// ulib
void printf(char * st);
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/usys.S | Assembly | #include "kernel/syscall.h"
.global write
write:
li a7, SYS_write
ecall
ret
.global exit
exit:
li a7, SYS_exit
ecall
ret
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/util.c | C | #include "user.h"
void printf(char * st) {
int i;
for (i = 0; st[i]; i++) {
write(st[i]);
}
}
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
user/util.d | D | user/util.o: user/util.c user/user.h
| zhayujie/minos | 3 | A minimal viable operating system. | Assembly | zhayujie | Minimal Future Tech | |
autodiff.py | Python | import numpy as np
from collections import OrderedDict
from queue import Queue
class Operator:
_num_of_inputs = -1 # means no constrains of number of inputs
def forward(self, x):
"""
Operator forward.
:param x: list of inputs
:return: output value y according to input x
"""
raise NotImple... | zhuohan123/autodiff | 2 | A super tiny CPU single-threaded automated differentiation based on numpy. | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
test.py | Python | import numpy as np
import autodiff as ad
t = 1e-8
def noise_like(x):
return np.random.uniform(-1, 1, np.shape(x))
def run_problem3():
print("-" * 18 + " Problem 3 " + "-" * 18)
x = ad.Variable()
w1 = ad.Variable()
w2 = ad.Variable()
y = ad.average(ad.matmul(ad.relu(ad.matmul(x, w1)), w2) + x)
x_f = n... | zhuohan123/autodiff | 2 | A super tiny CPU single-threaded automated differentiation based on numpy. | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
build-docker.sh | Shell | #!/bin/bash
set -x
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--no-cache)
NO_CACHE="--no-cache"
;;
--skip-examples)
SKIP_EXAMPLES=YES
;;
--output-sha)
# output the SHA sum of the last built file (either ray-project/deploy
# or ray-project/examples, suppressing all other output. T... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
build.sh | Shell | #!/usr/bin/env bash
set -x
# Cause the script to exit if a single command fails.
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
function usage()
{
echo "Usage: build.sh [<args>]"
echo
echo "Options:"
echo " -h|--help print the help info"
echo " -l|--language language1[,langua... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/jenkins_tests/miscellaneous/large_memory_test.py | Python | import numpy as np
import ray
if __name__ == "__main__":
ray.init(num_cpus=0)
A = np.ones(2**31 + 1, dtype="int8")
a = ray.put(A)
assert np.sum(ray.get(a)) == np.sum(A)
del A
del a
print("Successfully put A.")
B = {"hello": np.zeros(2**30 + 1), "world": np.ones(2**30 + 1)}
b = ra... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/jenkins_tests/miscellaneous/test_wait_hanging.py | Python | import ray
@ray.remote
def f():
return 0
@ray.remote
def g():
import time
start = time.time()
while time.time() < start + 1:
ray.get([f.remote() for _ in range(10)])
# 10MB -> hangs after ~5 iterations
# 20MB -> hangs after ~20 iterations
# 50MB -> hangs after ~50 iterations
ray.init(redis... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/jenkins_tests/run_multi_node_tests.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails.
set -e
# Show explicitly which commands are currently running.
set -x
MEMORY_SIZE="20G"
SHM_SIZE="20G"
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
DOCKER_SHA=$($ROOT_DIR/../../build-docker.sh --output-sha --no-cache)
SUPPRESS_OUTPU... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/jenkins_tests/run_rllib_tests.sh | Shell | docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} $DOCKER_SHA \
/ray/ci/suppress_output python /ray/rllib/tests/test_catalog.py
docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} $DOCKER_SHA \
/ray/ci/suppress_output python /ray/rllib/tests/test_optimizers.py
docker run --rm --shm-siz... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/jenkins_tests/run_tune_tests.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails.
set -e
# Show explicitly which commands are currently running.
set -x
MEMORY_SIZE=$1
SHM_SIZE=$2
DOCKER_SHA=$3
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
SUPPRESS_OUTPUT=$ROOT_DIR/../suppress_output
if [ "$MEMORY_SIZE" == "" ]; th... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/actor_deaths.py | Python | # This workload tests repeatedly killing actors and submitting tasks to them.
import numpy as np
import sys
import time
import ray
from ray.cluster_utils import Cluster
num_redis_shards = 1
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 2
message = ("Make sure there is enough memory on this machin... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/apex.py | Python | # This workload tests running APEX
import ray
from ray.cluster_utils import Cluster
from ray.tune import run_experiments
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**9
num_nodes = 3
message = ("Make sure there is enough memory on this machine to run this "
"workload. We divide t... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/impala.py | Python | # This workload tests running IMPALA with remote envs
import ray
from ray.tune import run_experiments
from ray.cluster_utils import Cluster
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 1
message = ("Make sure there is enough memory on this machine to run this "
"wo... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/many_actor_tasks.py | Python | # This workload tests submitting many actor methods.
import time
import numpy as np
import ray
from ray.cluster_utils import Cluster
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 10
message = ("Make sure there is enough memory on this machine to run this "
"worklo... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/many_drivers.py | Python | # This workload tests many drivers using the same cluster.
import time
import ray
from ray.cluster_utils import Cluster
from ray.test_utils import run_string_as_driver
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 4
message = ("Make sure there is enough memory on this machine... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/many_tasks.py | Python | # This workload tests submitting and getting many tasks over and over.
import time
import numpy as np
import ray
from ray.cluster_utils import Cluster
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 10
message = ("Make sure there is enough memory on this machine to run this "
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/node_failures.py | Python | # This workload tests repeatedly killing a node and adding a new node.
import time
import ray
from ray.cluster_utils import Cluster
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 10
message = ("Make sure there is enough memory on this machine to run this "
"workload... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/long_running_tests/workloads/pbt.py | Python | # This workload tests running PBT
import ray
from ray.tune import run_experiments
from ray.tune.schedulers import PopulationBasedTraining
from ray.cluster_utils import Cluster
num_redis_shards = 5
redis_max_memory = 10**8
object_store_memory = 10**8
num_nodes = 3
message = ("Make sure there is enough memory on this ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/performance_tests/test_performance.py | Python | import argparse
import logging
import numpy as np
import time
import ray
from ray.tests.cluster_utils import Cluster
logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser(
description="Parse arguments for running the performance tests.")
parser.add_argument(
"--num-nodes",
required=True,
... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/stress_tests/run_application_stress_tests.sh | Shell | #!/usr/bin/env bash
# This script should be run as follows:
# ./run_application_stress_tests.sh <ray-version> <ray-commit>
# For example, <ray-version> might be 0.7.1
# and <ray-commit> might be bc3b6efdb6933d410563ee70f690855c05f25483. The commit
# should be the latest commit on the branch "releases/<ray-version>... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/stress_tests/run_jenkins_stress_test.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails.
set -e
# Show explicitly which commands are currently running.
set -x
MEMORY_SIZE="20G"
SHM_SIZE="20G"
docker build -q --no-cache -t ray-project/base-deps docker/base-deps
# Add Ray source
git rev-parse HEAD > ./docker/stress_test/git-rev
gi... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/stress_tests/run_stress_tests.sh | Shell | #!/usr/bin/env bash
# Show explicitly which commands are currently running.
set -x
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
RESULT_FILE=$ROOT_DIR/results-$(date '+%Y-%m-%d_%H-%M-%S').log
touch "$RESULT_FILE"
echo "Logging to" "$RESULT_FILE"
if [[ -z "$1" ]]; then
echo "ERROR: The first argument must... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/stress_tests/test_dead_actors.py | Python | #!/usr/bin/env python
import logging
import numpy as np
import sys
import time
import ray
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
ray.init(address="localhost:6379")
# These numbers need to correspond with the autoscaler config file.
# The number of remote nodes in the autoscale... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/stress_tests/test_many_tasks.py | Python | #!/usr/bin/env python
import numpy as np
import logging
import time
import ray
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
ray.init(address="localhost:6379")
# These numbers need to correspond with the autoscaler config file.
# The number of remote nodes in the autoscaler should up... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/bazel-format.sh | Shell | #!/usr/bin/env bash
# Before running this script, please make sure golang is installed
# and buildifier is also installed. The example is showed in .travis.yml.
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
function usage()
{
echo "Usage: bazel-format.sh [<args>]"
echo
echo "Options:"
echo " ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/build-autoscaler-images.sh | Shell | # This script build docker images for autoscaler.
# For now, we only build python3.6 images.
set -e
set -x
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
ROOT_DIR=$(cd $SCRIPT_DIR/../../; pwd)
DOCKER_USERNAME="raytravisbot"
# We will only build and push when we are building branch build.
if [[ "$TRAVIS" == "... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/check-git-clang-format-output.sh | Shell | #!/bin/bash
if [ -z "${TRAVIS_PULL_REQUEST-}" ] || [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
# Not in a pull request, so compare against parent commit
base_commit="HEAD^"
echo "Running clang-format against parent commit $(git rev-parse "$base_commit")"
else
base_commit="$TRAVIS_BRANCH"
echo "Running clang... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/determine_tests_to_run.py | Python | # Script used for checking changes for incremental testing cases
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import subprocess
import sys
from functools import partial
from pprint import pformat
def list_changed_files(commit_range):
"""Re... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/format.sh | Shell | #!/usr/bin/env bash
# YAPF + Clang formatter (if installed). This script formats all changed files from the last mergebase.
# You are encouraged to run this locally before pushing changes for review.
# Cause the script to exit if a single command fails
set -eo pipefail
ver=$(yapf --version)
if ! echo $ver | grep -q 0... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/install-bazel.sh | Shell | #!/usr/bin/env bash
set -euo pipefail
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
version="1.1.0"
achitecture="${HOSTTYPE}"
platform="unknown"
case "${OSTYPE}" in
msys)
echo "Platform is Windows."
platform="windows"
# No installer for Windows
;;
darwin*)
echo "Platform is Mac OS X."... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/install-cython-examples.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
echo "PYTHON is $PYTHON"
cython_examples="$ROOT_DIR/../../doc/examples/cython"
if [[ "$PYTHON" == "3.5" ]]; then
export PATH="$HOME/miniconda/bin:$PATH"
pushd $cython_example... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/install-dependencies.sh | Shell | #!/usr/bin/env bash
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
echo "PYTHON is $PYTHON"
platform="unknown"
unamestr="$(uname)"
if [[ "$unamestr" == "Linux" ]]; then
echo "Platform is linux."
platform="linux"
elif [[ "$unamestr" == "Darwin" ]]; then
echo "Platform is macosx."
platform="macosx"
else... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/install-ray.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails.
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
echo "PYTHON is $PYTHON"
# If we are in Travis, most of the compilation result will be cached.
# This means we are I/O bounded. By default, Bazel set the number of concurrent
# jobs... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/install.sh | Shell | #!/bin/bash
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
# Linux test uses Docker
# We need to update the Docker version provided by Travis CI
# in order to set shm size, a setting required by some of the
# tests.
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates
sudo apt-key ... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/run_test.sh | Shell | #!/bin/bash
#
# This script is for use in the Travis CI testing system. When running
# on Linux this script runs the command in a Docker container.
# Otherwise it runs the commands natively, which is what we want for
# the Mac OS X tests.
#
# Usage:
#
# run_test.sh [OPTIONS] [COMMAND]
#
# Key options are:
#
# --dock... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/test-wheels.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails.
set -e
# Show explicitly which commands are currently running.
set -x
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
platform="unknown"
unamestr="$(uname)"
if [[ "$unamestr" == "Linux" ]]; then
echo "Platform is linux."
platform="l... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
ci/travis/upgrade-syn.sh | Shell | #!/usr/bin/env bash
# Cause the script to exit if a single command fails
set -eo pipefail
# this stops git rev-parse from failing if we run this from the .git directory
builtin cd "$(dirname "${BASH_SOURCE:-$0}")"
ROOT="$(git rev-parse --show-toplevel)"
builtin cd "$ROOT"
find \
python test \
-name '*.py' -... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/api/v1alpha1/groupversion_info.go | Go | // Package v1alpha1 contains API Schema definitions for the ray v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=ray.io
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
var (
// GroupVersion is group version used to register these... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/api/v1alpha1/raycluster_types.go | Go | package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// RayClusterSpec defines the desired state of RayC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/api/v1alpha1/zz_generated.deepcopy.go | Go | // +build !ignore_autogenerated
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Extension) DeepC... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/common/constant.go | Go | package common
const (
// Head used as pod type to decide create service or not, for now only create service for head.
Head = "head"
// Belows used as label key
//rayclusterComponent is the pod name for this pod for selecting pod by pod name.
rayclusterComponent = "raycluster.component"
// rayIoComponent is the... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/common/meta.go | Go | package common
import rayiov1alpha1 "ray-operator/api/v1alpha1"
// The function labelsForCluster returns the labels for selecting the resources
// belonging to the given RayCluster CR name.
func labelsForCluster(instance rayiov1alpha1.RayCluster, name string, podTypeName string, extend map[string]string) (ret map[str... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/common/pod.go | Go | package common
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rayiov1alpha1 "ray-operator/api/v1alpha1"
"strings"
)
type PodConfig struct {
RayCluster *rayiov1alpha1.RayCluster
PodTypeName string
PodName string
Extension rayiov1alpha1.Extension
}
func DefaultPodConf... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/common/service.go | Go | package common
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rayiov1alpha1 "ray-operator/api/v1alpha1"
"ray-operator/controllers/utils"
"strings"
)
type ServiceConfig struct {
RayCluster rayiov1alpha1.RayCluster
PodName string
}
func DefaultServiceConfig(instance rayiov... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/raycluster_controller.go | Go | package controllers
import (
"context"
"fmt"
mapset "github.com/deckarep/golang-set"
"github.com/go-logr/logr"
_ "k8s.io/api/apps/v1beta1"
rayiov1alpha1 "ray-operator/api/v1alpha1"
"ray-operator/controllers/common"
_ "ray-operator/controllers/common"
"ray-operator/controllers/utils"
"strings"
corev1 "k8s.i... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/utils/util.go | Go | package utils
import (
corev1 "k8s.io/api/core/v1"
"strconv"
"strings"
)
// IsCreated returns true if pod has been created and is maintained by the API server
func IsCreated(pod *corev1.Pod) bool {
return pod.Status.Phase != ""
}
// Get substring before a string.
func Before(value string, a string) string {
pos... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/controllers/utils/util_test.go | Go | package utils
import "testing"
func TestBefore(t *testing.T) {
if Before("a","b") != ""{
t.Fail()
}
if Before("aaa","a") != ""{
t.Fail()
}
if Before("aab","b") != "aa"{
t.Fail()
}
}
| zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
deploy/ray-operator/main.go | Go | package main
import (
"flag"
"os"
rayv1 "ray-operator/api/v1alpha1"
"ray-operator/controllers"
"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/z... | zhuohan123/hoplite-rllib | 3 | Python | zhuohan123 | Zhuohan Li | vLLM / Meta | |
doc/dev/get_contributors.py | Python | from github import Github
from subprocess import check_output
import shlex
from tqdm import tqdm
import click
@click.command()
@click.option(
"--access-token",
required=True,
help="""
Github Access token that has repo:public_repo and user:read:user permission.
Create them at https://github.com/settings/t... | 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.