Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of Ubuntu Desktop 16.04.3 LTS.
This file serves a BKM to get better performance on CPU for PyTorch, mostly focusing on inference or deployment. Chinese version available here.
layout
refers to how data is organized in a tensor. PyTorch default layout is NCHW
, from optimization perspective, MKL-DNN library (renamed as DNNL recently) may choose a different layout, sometimes refered to as internal layout or primitive layout. This is actually a normal technique for acceleration libraries, common knowledge is that NHWC
runs faster than NCHW
for convolution, changing the default NCHW
to NHWC
is called a reorder
. MKL-DNN may choose different internal layouts based on the input pattern and the algorithm selected, e.g. nChw16c
, a.k.a. reorder a 4-dim tensor into 5-dim by chop down dimension C by 16, for vectorization purpose (AVX512 instruction length is 16x32 bit).
By default on CPU, conv2d
will ru
package main | |
import ( | |
"github.com/kardianos/service" | |
"log" | |
"flag" | |
) | |
type Service struct {} |
#include <Python.h> | |
#include <stdio.h> | |
/* | |
* gcc embpython.c -I/usr/include/python2.7 -lpython | |
**/ | |
void loadModule() | |
{ | |
/* run objects with low-level calls */ | |
char *arg1="sir", *arg2="robin", *cstr; | |
printf("Load Module err!\n"); |
/* Example of embedding Python in another program */ | |
// to compile run: | |
// gcc -o test $(python-config --cflags) test.c $(python-config --ldflags) && ./test | |
#include<stdio.h> | |
#include "Python.h" | |
void initxyzzy(void); /* Forward */ | |
main(int argc, char **argv) |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Author: Axel Angel, copyright 2015, license GPLv3. | |
# added mean subtraction so that, the accuracy can be reported accurately just like caffe when doing a mean subtraction | |
# Seyyed Hossein Hasan Pour | |
# Coderx7@Gmail.com | |
# 7/3/2016 | |
import sys |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
#برای نمایش بلادرنگ نمودار ترینینگ و تست ما | |
import numpy as np | |
from matplotlib import pyplot as plt | |
class LivePlotNotebook(object): | |
""" | |
Live plot using %matplotlib notebook in jupyter notebook | |
original url : https://gist.github.com/wassname/04e77eb821447705b399e8e7a6d082ce | |
""" |
# Dinesh Jayaraman | |
# Based on code by | |
# Authors: Fabian Pedregosa <fabian.pedregosa@inria.fr> | |
# Olivier Grisel <olivier.grisel@ensta.org> | |
# Mathieu Blondel <mathieu@mblondel.org> | |
# Gael Varoquaux | |
# License: BSD 3 clause (C) INRIA 2011 | |
print(__doc__) |