Efficient ImageProcessing withHalidePresented by Adrián Palacios
Introduction• Image processing is a topicwhere optimization matters.• But optimization for multipleplatforms is hard andex...
Data-parallel and IP languages• Data-parallel languages:• CUDA and OpenCL propose a SIMDprogramming model for multi-core C...
Concretely, the problem is…
And the solution is…
The Halide language• Halide is a functional programming language (“àla Haskell”) for IP.• It makes a distinction between t...
Evaluation of Halide• Halide’s execution time is measured against:• ImageMagick.• MATLAB.• Mathematica.• OpenCV 2.• Two te...
RGB to grayscale
RGB to grayscale resultsNormal sized image Time (ms) Time / Halide Time (%)Halide 8.486 1.000ImageMagick 64.000 7.542MATLA...
Gaussian blur
Gaussian blur resultsNormal sized image Time (ms) Time / Halide Time (%)Halide 2.674 1.000ImageMagick 304.000 113.687MATLA...
Conclusions• Halide beats each other tool(except OpenCV 2).• There’s a lot of room forimprovement.• Programming with Halid...
Questions?• Halide’s repository at Github:• https://github.com/halide/Halide
Upcoming SlideShare
Loading in …5
×

Efficient Image Processing with Halide

2,057 views

Published on

Published in: Technology, Art & Photos
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,057
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Efficient Image Processing with Halide

  1. 1. Efficient ImageProcessing withHalidePresented by Adrián Palacios
  2. 2. Introduction• Image processing is a topicwhere optimization matters.• But optimization for multipleplatforms is hard andexpensive.• We want tools for obtaininghigh-performance coderegardless of the platform.• Halide is a tool that aims tosolve this problem.
  3. 3. Data-parallel and IP languages• Data-parallel languages:• CUDA and OpenCL propose a SIMDprogramming model for multi-core CPUsand GPUs.• Implementations can be very efficient atthe cost of losing portability.• IP languages:• MATLAB and other suites release kernellanguages.• But individual kernels are not enough.
  4. 4. Concretely, the problem is…
  5. 5. And the solution is…
  6. 6. The Halide language• Halide is a functional programming language (“àla Haskell”) for IP.• It makes a distinction between the algorithm andthe schedule:• The algorithm is what should be done.• The schedule is how it should be done.• Optimization is achieved by:• Using LLVM for generating simple code.• Using architecture-specific compilers forgenerating vectorized and parallel code.
  7. 7. Evaluation of Halide• Halide’s execution time is measured against:• ImageMagick.• MATLAB.• Mathematica.• OpenCV 2.• Two test images:• A normal sized image (512x512).• A big sized image (6400x4800).• For two methods:• RGB to grayscale.• Gaussian blur.
  8. 8. RGB to grayscale
  9. 9. RGB to grayscale resultsNormal sized image Time (ms) Time / Halide Time (%)Halide 8.486 1.000ImageMagick 64.000 7.542MATLAB 10.359 1.221Mathematica 13.000 1.532OpenCV 2 0.577 0.067Big sized image Time (ms) Time / Halide Time (%)Halide 188.829 1.000ImageMagick 1748 9.257MATLAB 192.501 1.019Mathematica 1586 8.399OpenCV 2 76.626 0.405
  10. 10. Gaussian blur
  11. 11. Gaussian blur resultsNormal sized image Time (ms) Time / Halide Time (%)Halide 2.674 1.000ImageMagick 304.000 113.687MATLAB 2.834 1.059Mathematica 117.003 43.755OpenCV 2 1.076 0.402Big sized image Time (ms) Time / Halide Time (%)Halide 219.274 1.000ImageMagick 12265 55.935MATLAB 277.388 1.265Mathematica 199203 908.466OpenCV 2 191.875 0.875
  12. 12. Conclusions• Halide beats each other tool(except OpenCV 2).• There’s a lot of room forimprovement.• Programming with Halide ishard-to-learn, easy-to-master.
  13. 13. Questions?• Halide’s repository at Github:• https://github.com/halide/Halide

×