Skip to content

Instantly share code, notes, and snippets.

@zplizzi
zplizzi / test.py
Created December 20, 2019 14:57
ray perf regression
import ray
import random
import torch
from typing import List, Tuple
from collections import OrderedDict
# from papers.muzero.player import Game
import numpy as np
import time
@zplizzi
zplizzi / stack.txt
Created December 9, 2019 01:10
ray stack
Stack dump for ubuntu 995 0.0 0.0 697416 37364 ? Sl Nov20 0:01 ray_worker
Process 995: ray_worker
Python v3.6.8 (/home/ubuntu/.pyenv/versions/3.6.8/bin/python3.6)
Thread 995 (idle): "MainThread"
_wait_for_tstate_lock (threading.py:1072)
join (threading.py:1056)
join_import_thread (ray/import_thread.py:51)
disconnect (ray/worker.py:2119)
shutdown (ray/worker.py:1590)
running install
running bdist_egg
running egg_info
writing torchcule.egg-info/PKG-INFO
writing dependency_links to torchcule.egg-info/dependency_links.txt
writing requirements to torchcule.egg-info/requires.txt
writing top-level names to torchcule.egg-info/top_level.txt
reading manifest file 'torchcule.egg-info/SOURCES.txt'
writing manifest file 'torchcule.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
@zplizzi
zplizzi / Dockerfile
Created October 31, 2019 21:11
Ray Dockerfile
FROM nvidia/cuda:10.0-cudnn7-runtime as base
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-pip \
build-essential \
python3-dev \
# these two are needed for tensorflow/ray examples
libglib2.0-0 \
libgtk2.0-dev \
git \
% python wandbtest.py 1 ↵ ✹
wandb: Started W&B process version 0.7.2 with PID 24825
wandb: Local directory: wandb/run-20190405_210210-test10
wandb: Syncing to https://app.wandb.ai/zplizzi/test/runs/test10
wandb: Run `wandb off` to turn off syncing.
no existing run found
i is 0
model var is 1
i is 1
import time
import os
import pickle
import wandb
class Model:
def __init__(self):
self.var = 0
def step(self):
from torch import nn
import torch
import torchvision
from torchvision import transforms
from apex import amp
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.conv = nn.Conv2d(3, 10, kernel_size=3)
@zplizzi
zplizzi / align.py
Last active May 22, 2017 18:10
Code for aligning two videos with different framerates
import numpy as np
duration = 60*60
num_frames = 30* duration
error_percent = .02
a = np.linspace(0, duration, num_frames)
b = np.linspace(0, duration, num_frames * (1 - error_percent))