Giter VIP home page Giter VIP logo

mkltorch's Introduction

DISCONTINUATION OF PROJECT.

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project. mkltorch

MKLDNN library is designed to accelerate Deep Neural Network(DNN) computation on CPU, in particular Intel® Xeon processors (HSW, BDW, Xeon Phi). The repo of mkltorch provides mklTensor to be called in MKLDNN library in Torch7 for convenience .

Relation with torch

Torch is the main package in Torch7 where data structures for multi-dimensional tensors and mathematical operationsover these are defined. Additionally, it provides many utilities for accessing files, serializing objects of arbitrary types and other useful utilities.

mklTorch wraps the data structure of tensor which is provided by Torch to offer a new tensor which is named as mklTensor. It is necessary to convert the regular tensor to mklTensor if you want to use MKLDNN to boost your neural networksi computation.

If there is a regular tensor variable named as a, you can call its mkl() method and you will get the corresponding mklTensor. It is not very hard.

require 'mkltorch'
a = torch.FloatTensor(2,3)
b = a:mkl()

Accordingly, it is easy to convert a mklTensor to a regular tensor just by using th() method. Just like:

require 'mkltorch'
a = torch.FloatTensor(2,3)
b = a:mkl()
c = b:th()

NOTE:

  • mklTensor doesn't provide any basic mathematical operations. You can transfer it to a regular tensor first then operate it if necessary.
  • Any convertions only occur between the two types tensors which have same data type.In other word, a regular tensor with float type only can be converted to MKLFloatTensor. It is impossible to convert it to a MKLDoubleTensor.
  • There are only two type data structures of mklTensor(float and double) currently.

mklTensor Library

It offers mklTensor some basic operations to create, copy, convert or query some infos.

  • new()
    create a new mklTensor and return it.
  • th()
    convert a mklTensor to the regular tensor and return the regular tensor.
  • float()
    convert a MKLFloatTensor to the regular float tensor and return the regular float tensor.
  • double()
    convert a MKLDoubleTensor to the regular double tensor and return the regular double tensor.
  • MKL2TH(A)
    convert a mklTensor to the regular tensor and return the regular tensor. And also assigned it to A
  • TH2MKL(A)
    convert a regular tensor A to the mklTensor and return the mklTensor.
  • nElement()
    Return the ammount of the mklTensor.
  • directTH()
    fetch the tensor from a MKLFloatTensor. It is NOT recommended to use this method by user in order to avoid potential problems.
  • size([dim])
    Returns the size of the specified dimension dim or the sizes of all dimensions if param dim is ignored.

The package also provide a regular tensor conversion methods to get the corresponding mklTensor.

  • mkl()
    convert a regular tensor to the mklTensor and return the mklTensor.
  • mklFloat()
    convert a regular float tensor to the MKLFloatTensor and return the MKLFloatTensor.
  • mklDouble()
    convert a regular double tensor to the MKLDoubleTensor and return the MKLDoubleTensor.

NOTE:

If you have any confusion about these repo, please contact us and help us improve this readme.

How to contribute to these repo

You should have confidence that the gap of performance between CPU and GPU is not that huge exaggeratively. join us and let your CPU speedup. You can pull request to the repo to help us improve it.

mkltorch's People

Contributors

mlwoo avatar rdower avatar xhzhao avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.