SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Efficient Image
Processing with
Halide
Presented by Adrián Palacios
Introduction
• Image processing is a topic
where optimization matters.
• But optimization for multiple
platforms is hard and
expensive.
• We want tools for obtaining
high-performance code
regardless of the platform.
• Halide is a tool that aims to
solve this problem.
Data-parallel and IP languages
• Data-parallel languages:
• CUDA and OpenCL propose a SIMD
programming model for multi-core CPUs
and GPUs.
• Implementations can be very efficient at
the cost of losing portability.
• IP languages:
• MATLAB and other suites release kernel
languages.
• But individual kernels are not enough.
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 the algorithm and
the 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 for
generating vectorized and parallel code.
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.
RGB to grayscale
RGB to grayscale results
Normal sized image Time (ms) Time / Halide Time (%)
Halide 8.486 1.000
ImageMagick 64.000 7.542
MATLAB 10.359 1.221
Mathematica 13.000 1.532
OpenCV 2 0.577 0.067
Big sized image Time (ms) Time / Halide Time (%)
Halide 188.829 1.000
ImageMagick 1748 9.257
MATLAB 192.501 1.019
Mathematica 1586 8.399
OpenCV 2 76.626 0.405
Gaussian blur
Gaussian blur results
Normal sized image Time (ms) Time / Halide Time (%)
Halide 2.674 1.000
ImageMagick 304.000 113.687
MATLAB 2.834 1.059
Mathematica 117.003 43.755
OpenCV 2 1.076 0.402
Big sized image Time (ms) Time / Halide Time (%)
Halide 219.274 1.000
ImageMagick 12265 55.935
MATLAB 277.388 1.265
Mathematica 199203 908.466
OpenCV 2 191.875 0.875
Conclusions
• Halide beats each other tool
(except OpenCV 2).
• There’s a lot of room for
improvement.
• Programming with Halide is
hard-to-learn, easy-to-
master.
Questions?
• Halide’s repository at Github:
• https://github.com/halide/Halide

Weitere ähnliche Inhalte

Was ist angesagt?

Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messagesSînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Codecamp Romania
 
Insight Demo
Insight DemoInsight Demo
Insight Demo
reza-asad
 
Insight Recent Demo
Insight Recent DemoInsight Recent Demo
Insight Recent Demo
reza-asad
 
Real-Time Voice Actuation
Real-Time Voice ActuationReal-Time Voice Actuation
Real-Time Voice Actuation
Pragya Agrawal
 

Was ist angesagt? (19)

Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education
 
Presentation may30th
Presentation may30thPresentation may30th
Presentation may30th
 
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messagesSînică Alboaie - Programming for cloud computing Flows of asynchronous messages
Sînică Alboaie - Programming for cloud computing Flows of asynchronous messages
 
Photo echance. Problems. Solutions. Ideas
Photo echance. Problems. Solutions. Ideas Photo echance. Problems. Solutions. Ideas
Photo echance. Problems. Solutions. Ideas
 
Training Large-scale Ad Ranking Models in Spark
Training Large-scale Ad Ranking Models in SparkTraining Large-scale Ad Ranking Models in Spark
Training Large-scale Ad Ranking Models in Spark
 
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
 
Dato vs GraphX
Dato vs GraphXDato vs GraphX
Dato vs GraphX
 
Extracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated applicationExtracting a Rails Engine to a separated application
Extracting a Rails Engine to a separated application
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Erin LeDell, H2O.ai - Scalable Automatic Machine Learning - H2O World San Fra...
Erin LeDell, H2O.ai - Scalable Automatic Machine Learning - H2O World San Fra...Erin LeDell, H2O.ai - Scalable Automatic Machine Learning - H2O World San Fra...
Erin LeDell, H2O.ai - Scalable Automatic Machine Learning - H2O World San Fra...
 
Insight Demo
Insight DemoInsight Demo
Insight Demo
 
Insight Recent Demo
Insight Recent DemoInsight Recent Demo
Insight Recent Demo
 
Graphics Libraries
Graphics LibrariesGraphics Libraries
Graphics Libraries
 
Deploy Deep Learning Models with TensorFlow + Lambda
Deploy Deep Learning Models with TensorFlow + LambdaDeploy Deep Learning Models with TensorFlow + Lambda
Deploy Deep Learning Models with TensorFlow + Lambda
 
Scaling Machine Learning To Billions Of Parameters
Scaling Machine Learning To Billions Of ParametersScaling Machine Learning To Billions Of Parameters
Scaling Machine Learning To Billions Of Parameters
 
Deep Reality Simulation for Automated Poacher Detection with Mark Hamilton an...
Deep Reality Simulation for Automated Poacher Detection with Mark Hamilton an...Deep Reality Simulation for Automated Poacher Detection with Mark Hamilton an...
Deep Reality Simulation for Automated Poacher Detection with Mark Hamilton an...
 
SiriusCon 2017 - Get your stakeholders into modeling using graphical editors
SiriusCon 2017 - Get your stakeholders into modeling using graphical editorsSiriusCon 2017 - Get your stakeholders into modeling using graphical editors
SiriusCon 2017 - Get your stakeholders into modeling using graphical editors
 
What is clooca
What is cloocaWhat is clooca
What is clooca
 
Real-Time Voice Actuation
Real-Time Voice ActuationReal-Time Voice Actuation
Real-Time Voice Actuation
 

Ähnlich wie Efficient Image Processing with Halide

Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
CEE-SEC(R)
 

Ähnlich wie Efficient Image Processing with Halide (20)

Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016
Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016
Open Standards for ADAS: Andrew Richards, Codeplay, at AutoSens 2016
 
CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...CeedMath & CeedGL, Let's talk 3D...
CeedMath & CeedGL, Let's talk 3D...
 
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
Массовый параллелизм для гетерогенных вычислений на C++ для беспилотных автом...
 
OpenCL & the Future of Desktop High Performance Computing in CAD
OpenCL & the Future of Desktop High Performance Computing in CADOpenCL & the Future of Desktop High Performance Computing in CAD
OpenCL & the Future of Desktop High Performance Computing in CAD
 
Paddle_Spark_Summit
Paddle_Spark_SummitPaddle_Spark_Summit
Paddle_Spark_Summit
 
OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012OpenCV @ Droidcon 2012
OpenCV @ Droidcon 2012
 
2018 03 25 system ml ai and openpower meetup
2018 03 25 system ml ai and openpower meetup2018 03 25 system ml ai and openpower meetup
2018 03 25 system ml ai and openpower meetup
 
Scalable Deep Learning Platform On Spark In Baidu
Scalable Deep Learning Platform On Spark In BaiduScalable Deep Learning Platform On Spark In Baidu
Scalable Deep Learning Platform On Spark In Baidu
 
Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmap
 
JavaDayKiev'15 Java in production for Data Mining Research projects
JavaDayKiev'15 Java in production for Data Mining Research projectsJavaDayKiev'15 Java in production for Data Mining Research projects
JavaDayKiev'15 Java in production for Data Mining Research projects
 
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNetFrom Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
From Hours to Minutes: The Journey of Optimizing Mask-RCNN and BERT Using MXNet
 
Evaluating GPU programming Models for the LUMI Supercomputer
Evaluating GPU programming Models for the LUMI SupercomputerEvaluating GPU programming Models for the LUMI Supercomputer
Evaluating GPU programming Models for the LUMI Supercomputer
 
Future Directions for Compute-for-Graphics
Future Directions for Compute-for-GraphicsFuture Directions for Compute-for-Graphics
Future Directions for Compute-for-Graphics
 
Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer Exploring the Programming Models for the LUMI Supercomputer
Exploring the Programming Models for the LUMI Supercomputer
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
Spark meetup feb 2016
Spark meetup feb 2016Spark meetup feb 2016
Spark meetup feb 2016
 
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
Webinar: Começando seus trabalhos com Machine Learning utilizando ferramentas...
 
MathWorks and Freescale Cup - Working with MATLAB & Simulink
MathWorks and Freescale Cup - Working with MATLAB & SimulinkMathWorks and Freescale Cup - Working with MATLAB & Simulink
MathWorks and Freescale Cup - Working with MATLAB & Simulink
 
A performance analysis of OpenStack Cloud vs Real System on Hadoop Clusters
A performance analysis of OpenStack Cloud vs Real System on Hadoop ClustersA performance analysis of OpenStack Cloud vs Real System on Hadoop Clusters
A performance analysis of OpenStack Cloud vs Real System on Hadoop Clusters
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Efficient Image Processing with Halide

  • 2. Introduction • Image processing is a topic where optimization matters. • But optimization for multiple platforms is hard and expensive. • We want tools for obtaining high-performance code regardless of the platform. • Halide is a tool that aims to solve this problem.
  • 3. Data-parallel and IP languages • Data-parallel languages: • CUDA and OpenCL propose a SIMD programming model for multi-core CPUs and GPUs. • Implementations can be very efficient at the cost of losing portability. • IP languages: • MATLAB and other suites release kernel languages. • But individual kernels are not enough.
  • 6. The Halide language • Halide is a functional programming language (“à la Haskell”) for IP. • It makes a distinction between the algorithm and the 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 for generating vectorized and parallel code.
  • 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.
  • 9. RGB to grayscale results Normal sized image Time (ms) Time / Halide Time (%) Halide 8.486 1.000 ImageMagick 64.000 7.542 MATLAB 10.359 1.221 Mathematica 13.000 1.532 OpenCV 2 0.577 0.067 Big sized image Time (ms) Time / Halide Time (%) Halide 188.829 1.000 ImageMagick 1748 9.257 MATLAB 192.501 1.019 Mathematica 1586 8.399 OpenCV 2 76.626 0.405
  • 11. Gaussian blur results Normal sized image Time (ms) Time / Halide Time (%) Halide 2.674 1.000 ImageMagick 304.000 113.687 MATLAB 2.834 1.059 Mathematica 117.003 43.755 OpenCV 2 1.076 0.402 Big sized image Time (ms) Time / Halide Time (%) Halide 219.274 1.000 ImageMagick 12265 55.935 MATLAB 277.388 1.265 Mathematica 199203 908.466 OpenCV 2 191.875 0.875
  • 12. Conclusions • Halide beats each other tool (except OpenCV 2). • There’s a lot of room for improvement. • Programming with Halide is hard-to-learn, easy-to- master.
  • 13. Questions? • Halide’s repository at Github: • https://github.com/halide/Halide