def setUpClass(cls): np.random.seed(0) cls.ctx = make_default_context() cls.handle = cublasxt.cublasXtCreate() cls.nbDevices = 1 cls.deviceId = np.array([0], np.int32) cublasxt.cublasXtDeviceSelect(cls.handle, cls.nbDevices, cls.deviceId)
def setUp(self): np.random.seed(0) self.handle = cublasxt.cublasXtCreate() self.nbDevices = 1 self.deviceId = np.array([0], np.int32) cublasxt.cublasXtDeviceSelect(self.handle, self.nbDevices, self.deviceId)
import cPickle # import custom_layers import logging import skcuda.cublasxt as cublasxt import math import os import scipy from data_iter import DataIter from mixmodule import create_net, mixModule print 'mxnet version' + mx.__version__ # ctx = [mx.gpu(i) for i in range(3)] ctx = [mx.gpu(0)] handle = cublasxt.cublasXtCreate() # mode = cublasxt.cublasXtGetPinningMemMode(handle) cublasxt.cublasXtSetPinningMemMode(handle, 1) cublasxt.cublasXtSetCpuRatio(handle, 0, 0, 0.9) nbDevices = len(ctx) deviceId = np.array(range(nbDevices), np.int32) cublasxt.cublasXtDeviceSelect(handle, nbDevices, deviceId) num_epoch = 1000000 batch_size = 64 * nbDevices show_period = 1000 assert (batch_size % nbDevices == 0) bsz_per_device = batch_size / nbDevices print 'batch_size per device:', bsz_per_device
def setUp(self): self.handle = cublasxt.cublasXtCreate()
def setUp(self): self.handle = cublasxt.cublasXtCreate() self.nbDevices = 1 self.deviceId = np.array([0], np.int32) cublasxt.cublasXtDeviceSelect(self.handle, self.nbDevices, self.deviceId.ctypes.data)