Skip to content

Instantly share code, notes, and snippets.

View kuenishi's full-sized avatar
🎴

UENISHI Kota kuenishi

🎴
View GitHub Profile
#!/usr/bin/env python3
import re
import sys
filename = sys.argv[1]
pattern = r"(https://youtu\.be/[a-zA-Z0-9_-]*)"
with open(filename, 'r') as fp:
for line in fp.readlines():
for match in re.findall(pattern, line):
@kuenishi
kuenishi / sync.py
Last active June 1, 2020 06:17
Simple dotfiles manager
#!/usr/bin/env python3
import argparse
import difflib
import json
import os
import shutil
class LBL:
"""File handler to handle text files with line-by-line comparison"""
#!/bin/sh
set -eux
files=$@
cwd=`pwd`
out=`pwd`/output.mp4
echo $@
$ NCCL_DEBUG=INFO mpirun -x NCCL_DEBUG -np 2 python3 nccl25.py
chainer-dev2:644:644 [0] NCCL INFO Bootstrap : Using [0]eth0:172.23.201.52<0>
chainer-dev2:644:644 [0] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so).
chainer-dev2:644:644 [0] misc/ibvwrap.cc:212 NCCL WARN Call to ibv_open_device failed
chainer-dev2:644:644 [0] transport/net_ib.cc:120 NCCL WARN NET/IB : Unable to open device mlx5_1
chainer-dev2:644:644 [0] misc/ibvwrap.cc:212 NCCL WARN Call to ibv_open_device failed
import argparse
import copy
import chainer
from chainer import iterators
from chainer import function
import chainermn
from chainermn.extensions import GenericMultiNodeEvaluator

More example tuples of replica set representation follow

===================== ========= ================================================ code comm.size actual sets ===================== ========= ================================================ [0] 4 [{0}, {1, 2, 3}] [0, 1] 4 [{0}, {1}, {2, 3}] [0, 1], [2, 3]] 4 [{0, 1}, {2, 3}] [] 4 [{0, 1, 2, 3}] [range(0, 16, 2)] 16 [set(range(0, 16, 2)), set(range(1, 16, 2))

from chainer.training import extension
from chainer.training import extensions
class ReplicaSets:
def __init__(rank, replica_sets):
self.rank = rank
self.replica_sets = replica_sets
self.master = None
import argparse
import copy
import chainer
from chainer import iterators
from chainer import function
import chainermn
from chainermn.extensions.multi_node_evaluator import GatherEvaluator
import argparse
import chainer
from chainer import iterators
import chainermn
from chainermn.extensions.multi_node_evaluator import MultiNodeAggregationEvaluator
from chainercv.utils import ProgressHook
from chainercv.utils.iterator.unzip import unzip
import time
import pickle
import chainerio
import io
import cProfile
import sys
chainerio.set_root("posix")
cache_path = 'hoge.pkl'
'''