mxnet代码剖析之--mshadow篇
来源:互联网 发布:ubuntu 时区 编辑:程序博客网 时间:2024/06/08 11:32
### -------------------------------------------------------------------------
Basic Class:
1 shape: kDimension, kSubDim, shape_[]
size(), slice(), subShape()
2 stream: <gpu> stream_, blas_handle_, blas_handle_ownership_
dnn_handle_, dnn_handle_ownership_
3 Tensor: kDevCPU, kSubDim, *dptr_, shape_, stride_, stream_
MemSize()
4 Saver: Save(DType &a, DType b) {a = b}
plusto, minusto, multo, divto
5 Red(reduce): sum, maximum, minimum
6 Expression engine:
7 IStream: Read()
Write()
SaveBinary()
LoadBinary()
8 TensorContainer: pad_, data_
9 TShape: ndim_, num_heap_allocated_, data_stack_[kStackCache], kStackCache, *data_heap_
10 TBlob: *dptr_, shape_, stride_, dev_mask_, type_flag_
### -------------------------------------------------------------------------
namespace mshadow-ps
1 ThreadPQueue: use_fifo, pqueue_, fqueue_, lock_, counter_
push(), pop(), abort()
2 ThreadSafeMap: lock, map
### -------------------------------------------------------------------------
Some public method:
1 InitTensorEngine(int device_id = 0):
2 ShutdownTensorEngine(void): nothing
3 SetDevice(int devid):
4 NewStream<Device>(true, false):
5 DeleteStream(Stream<Device> *stream):
6 AllocSpace(cpu/gpu): attention pitch!
7 FreeSpace(cpu/gpu):
8 NewTensor(): ??
9 Copy(cpu <-> gpu): wrap cudaMemcpy2D()
10 Softmax(cpu/gpu):
11 SoftmaxGrad(cpu/gpu):
12 MapExp(cpu/gpu):
13 MapReduceKeepLowest(cpu/gpu):
14 MapReduceKeepHighDim(cpu/gpu):
15 VectorDot(dst, lhs, rhs):
### -------------------------------------------------------------------------
Basic Class:
1 shape: kDimension, kSubDim, shape_[]
size(), slice(), subShape()
2 stream: <gpu> stream_, blas_handle_, blas_handle_ownership_
dnn_handle_, dnn_handle_ownership_
Wait(): cudaStreamSynchronize(stream_)
CheckIdle(): cudaStreamQuery(stream_);
GetStream():
3 Tensor: kDevCPU, kSubDim, *dptr_, shape_, stride_, stream_
MemSize()
4 Saver: Save(DType &a, DType b) {a = b}
plusto, minusto, multo, divto
5 Red(reduce): sum, maximum, minimum
6 Expression engine:
6.1 type: kRValue, kMapper, kChainer, kComplex
6.2 ScalarExpTypecastExp
TransposeExp
RValueExp
DotExp: Eval() --> BLASEngine<xpu, type>gemm()
BLASEngine: gemm(), gemv(), ger(), dot()
BLASEngine<cpu, float>: gemm(), gemv(), ger(), dot()
BLASEngine<cpu, double>: gemm(), gemv(), ger(), dot()
BLASEngine<gpu, float>: gemm(), gemv(), ger(), dot()
BLASGngine<gpu, double>: gemm(), gemv(), ger(), dot()
BinaryMapExp:
UnaryMapExp:
7 IStream: Read()
Write()
SaveBinary()
LoadBinary()
8 TensorContainer: pad_, data_
9 TShape: ndim_, num_heap_allocated_, data_stack_[kStackCache], kStackCache, *data_heap_
10 TBlob: *dptr_, shape_, stride_, dev_mask_, type_flag_
### -------------------------------------------------------------------------
namespace mshadow-ps
1 ThreadPQueue: use_fifo, pqueue_, fqueue_, lock_, counter_
push(), pop(), abort()
2 ThreadSafeMap: lock, map
### -------------------------------------------------------------------------
Some public method:
1 InitTensorEngine(int device_id = 0):
cpu: nothing to do
gpu: check device_id valid, setDevice(device_id)
2 ShutdownTensorEngine(void): nothing
3 SetDevice(int devid):
4 NewStream<Device>(true, false):
5 DeleteStream(Stream<Device> *stream):
6 AllocSpace(cpu/gpu): attention pitch!
7 FreeSpace(cpu/gpu):
8 NewTensor(): ??
9 Copy(cpu <-> gpu): wrap cudaMemcpy2D()
10 Softmax(cpu/gpu):
11 SoftmaxGrad(cpu/gpu):
12 MapExp(cpu/gpu):
13 MapReduceKeepLowest(cpu/gpu):
14 MapReduceKeepHighDim(cpu/gpu):
15 VectorDot(dst, lhs, rhs):
### -------------------------------------------------------------------------
0 0
- mxnet代码剖析之--mshadow篇
- mxnet代码解析之mshadow
- mxnet系列之-mshadow
- mxnet代码剖析之--Storage篇
- mxnet代码剖析之--thread_engine篇
- mxnet代码剖析之--Symbol篇
- mxnet代码剖析之--StaticGraph篇
- mxnet代码剖析之--Executor篇
- mxnet代码剖析之--kvstore篇
- mxnet代码剖析之--ndarray篇
- mshadow的原理--MXNet
- mxnet代码解析之nnvm
- MXnet代码实战之CNN
- mxnet代码解析之dependency engine
- mxnet代码解析之computation graph
- mxnet系列之 代码阅读1
- MXnet代码实战之正则化
- mxnet系列之mxnet介绍
- Linux内核源码阅读以及工具
- 每天学点Excel技巧-Day1
- Mavlink地面站编写之一--协议分析
- 正则表达式课堂笔记
- 用SMT对大数据 过滤
- mxnet代码剖析之--mshadow篇
- 使用MAC的一些小知识
- iOS性能优化之内存管理:Analyze、Leaks、Allocations的使用和案例代码
- 算法-java(1)
- Silktest试用笔记
- 虚幻4Matinee功能 基本概念及简单示例(Sequence编辑器)
- 【poj 2627】 Sudoku 题意&题解&代码(C++)
- 【iOS开发-103】解决方案:iOS8.1中UIBarButtonItem的setTitleTextAttributes对Disabled颜色设置无效
- sql约束