Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

winograd convolution (portable and fast in inference) #11

Open
wants to merge 6 commits into
base: intel_scnn
Choose a base branch
from

Conversation

TaoHuUMD
Copy link

@TaoHuUMD TaoHuUMD commented Jul 24, 2017

Dear developers,
thanks for your contribution to this excellent program, here are parts of my work about winograd convolution for cpu inference.

Three files are added for cpu inference based on winograd convolution, winograd_inference.hpp, winograd_layer_inference. hpp, and winograd_layer_inference.cpp.

  1. Three winograd algrithms are supported, and WT8X8 with F(6x6, 3x3) are added to support cpu inference.
  2. Also, winograd2D_initialize() is provided, which supports precomputed and stored before runtime inference.
  3. Float calculations are supported for fast inference.

The new wiongrad interface is more portable for usage, and usages can be found in winograd_layer_inference.cpp.

Hope for a contribution.
Thanks.

@TaoHuUMD TaoHuUMD changed the title winograd convolution (for portable and fast) winograd convolution (portable and fast in inference) Jul 24, 2017
@jspark1105
Copy link
Contributor

jspark1105 commented Jul 26, 2017

Thanks for your contribution. I think your contribution on dense Winograd convolution can be more appreciated in the main caffe branch because SkimCaffe focuses on taking advantage of sparsity. Also, you may want to compare the performance/portability with Winograd implementation in libxsmm, which is already used in TensorFlow.

@hfp
Copy link

hfp commented Jul 26, 2017

Regarding Joongso's comment on Winograd in LIBXSMM, I recommend to build the library and the sample code under samples/dnn and then execute for example:

WINOGRAD=1 ./run_googlenetv1.sh

This will run all GoogleNetv1 convolutions forcing the Winograd algorithm (even when not beneficial). The default as used by the DNN sample codes relies on direct convolutions. However, a real use case would be to rely on LIBXSMM_DNN_CONV_ALGO_AUTO rather then LIBXSMM_DNN_CONV_ALGO_DIRECT or LIBXSMM_DNN_CONV_ALGO_WINOGRAD. The environment variable WINOGRAD is simply to reuse the sample code programs for testing purpose.

All sample codes print performance measures, which can be used to compare with your implementation. Please note that you may want to use at least an AVX2-capable system since otherwise only fallback code paths are taken. Further, since we merged some code which partially broke our Winograd implementation (whoever ;-) you may want to take LIBXSMM/20d993e:

git clone https://github.com/hfp/libxsmm.git
git checkout 20d993e

@imniksha
Copy link

Hello,

Have you tried substituting a Winograd Layer in for the Convolution Layer in a CNN using SkimCaffe yet?

I am doing a comparative study between the two types of convolution and want to insert a Winograd Conv Layer instead of the conv layer in Lenet. I have tried with unsuccessful results.

Is this possible to do using SkimCaffe's winograd Layer? Could you please guide me to an example usage of the Winograd layer? I appreciate the help!

Thank you :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants