Skip to content

Instantly share code, notes, and snippets.

View keisukefukuda's full-sized avatar

Keisuke Fukuda keisukefukuda

View GitHub Profile
import chainermn
from chainer.datasets import get_cifar10
import pickle
comm = chainermn.create_communicator('pure_nccl')
if comm.rank == 0:
train, test = get_cifar10()
else:
train, test = None, None
@keisukefukuda
keisukefukuda / a_pdfmark.py
Last active September 17, 2019 02:39
Generate pdfmarks (TOC) file, to feed to gs command
# LICENSE: MIT License
# How to use:
# $ pip install PyYAML fire pdfrw
# $ python pdfmark.py --infile=pdfmarks.yaml --outfile=pdfmarks
# $ gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf in.pdf
#
import sys
import pprint # NOQA
import yaml
use std::ops;
#[derive(Debug,Copy,Clone)]
struct Vec3 {
e: [f32; 3]
}
#[allow(dead_code)]
impl Vec3 {
pub fn new(e1: f32, e2: f32, e3: f32) -> Vec3 {
@keisukefukuda
keisukefukuda / 0 README.md
Last active August 4, 2019 15:06
How to run ChainerMN application on TSUBAME3

TSUBAME3上でのChainerMNアプリケーションの実行方法の説明

ChainerMNプログラムを分散環境で動かすには、動かしたいプログラムとデータに加えて、2つのファイルを用意します。

  • 動かしたいアプリケーションを起動するジョブスクリプト(ここでは例として以下のjob_mnist.sh)
  • 補助ファイル run.sh

ジョブスクリプトの内容は、走らせたいジョブの処理の内容に従って細かく変更を加えていきます。 補助ファイルは、最初に作成したあとは基本的に変更の必要はありません

import hashlib
import sys
import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
UINT32_MAX = 4294967295
INT32_MAX = 2147483647
dataset_info = {
'cifar10': {'class_lables': 10, load_func: get_cifar10},
'cifar100': {'class_lables': 100, load_func: get_cifar100},
}
if args.dataset not in dataset_info:
raise RuntimeError('Invalid dataset choice.')
class_labels = dataset_info[args.dataset]['class_labels']
Fri Apr 12 07:58:03 UTC 2019
================================================================================
In process.sh:
CUDA_VERSION = 9.0
PYTHON_VERSION = 2.7.15
OPENMPI_VERSION = 2.1.3
Chainer = https://github.com/chainer/chainer@master
CuPy = https://github.com/cupy/cupy@master
@keisukefukuda
keisukefukuda / .prototxt
Created March 12, 2019 06:05
train_pred.prototxt
name: "OctreeDecoder"
#------------------------------------------------------------------------------------------------------------
# INPUT DATA
#------------------------------------------------------------------------------------------------------------
layer {name: "octree_models" type: "OGNData"
top: "octree_model_values" top: "octree_labels"
ogn_data_param {batch_size: 4 source: "model_names.txt" preload_data: false}}
@keisukefukuda
keisukefukuda / .prototxt
Last active March 12, 2019 06:03
train_known.prototxt
name: "OctreeDecoder"
#------------------------------------------------------------------------------------------------------------
# INPUT DATA
#------------------------------------------------------------------------------------------------------------
layer {name: "octree_models" type: "OGNData"
top: "octree_model_values" top: "octree_labels"
ogn_data_param {batch_size: 4 source: "model_names.txt" preload_data: false}}
@keisukefukuda
keisukefukuda / env.sh
Last active April 20, 2019 09:41
Reedbush環境での最新版Chainerのセットアップ方法
#!/bin/bash
GROUP=$(id -ng)
MYDIR=/lustre/${GROUP}/$USER
export HOME=$MYDIR
. /etc/profile.d/modules.sh
module load cuda9/9.1.85
module load anaconda3/4.3.0