SlideShare a Scribd company logo
Compute Programming
Parallel Power for Modern Computing
Course CP293
Road Map • Why Compute Matters Today
• Compute Languages/API
• Core Concepts & Rules
• Essential Algorithms
• Performance Considerations
• Practical Examples
• Future of Compute
• Summary & Resources
Recommend Reading
101 WebGPU and WGSL
Programming Projects (Paperback)
WebGPU Data
Visualization
Cookbook (2nd
Edition)
Lots of projects to keep you busy with compute programming
(working and thinking in parallel)
WebGPU
Compute
(Paperback)
Why Learn Compute Programming Today?
• AI/ML revolution demands GPU compute
• Games and simulations are more complex
• Scientific computing needs more power
• WebGPU brings GPU compute to the browser
Did You Know?
Modern GPUs contain thousands of cores
while CPUs typically have 4-32 cores
What exactly is
compute
programming?
What exactly is compute programming?
• Specialized programming for parallel processing
• Utilizes GPU's architecture for general computation
• Different paradigm from traditional CPU programming
• Used in ML, scientific computing, data processing
What makes GPU
compute different
from CPU
programming?
• Massively parallel vs sequential thinking
• Different memory hierarchy
• Specialized languages (WGSL, CUDA)
• Different performance characteristics
What makes GPU compute different from
CPU programming?
JIM, It’s programming, but not as we know it!
GPU
CPU
Switch ‘Mindset’
Hands-On Task
Visit https://webgpulab.xbdev.net and:
• 1. Check your browser's WebGPU support
• 2. Run the demo compute shaders
• 3. Note the performance metrics
WebGPU Fact
WebGPU provides 3x better
performance than WebGL for
compute workloads
What are the key components of WebGPU?
What are the key components of WebGPU?
• Device: Represents the GPU
• Queue: Command submission
• Buffers: Memory storage
• Textures: Image data
• Bind Groups: Resource binding
• Pipelines: Shader configurations
Debugging Challenge
Try this broken compute shader:
1. Identify why it fails
2. Fix the memory access issue
3. Measure the performance impact
Performance Fact
Coalesced memory access can
improve performance by 20x
compared to random access
What are some common compute
programming pitfalls?
What are some common compute
programming pitfalls?
• Race conditions between threads
• Incorrect memory barriers
• Poor workgroup sizing
• Memory access conflicts
• Insufficient parallelism
Optimization Puzzle
Given this matrix multiplication shader:
• 1. Identify the bottleneck
• 2. Implement tiling with shared memory
• 3. Compare performance before/after
Algorithm Fact
Parallel reduction can accelerate
summation operations by 100x on
GPUs
What are essential compute algorithms to
learn?
What are essential compute algorithms to
learn?
• Parallel reduction (sum, min, max)
• Prefix sum/scan
• Matrix operations
• Sorting (bitonic, radix)
• Image processing kernels
• Physics simulations
Implementation Challenge
Implement a parallel histogram:
• 1. Start with naive version
• 2. Add atomic operations
• 3. Optimize with shared memory
Optimization
Fact
Proper workgroup sizing can
improve performance by 5-10x
How do I profile and
optimize compute
shaders?
How do I profile and optimize compute
shaders?
• Use timestamp queries
• Profile different workgroup sizes
• Analyze memory access patterns
• Check for thread divergence
• Compare against theoretical limits
Profiling Task
Profile this shader with:
1. Different workgroup sizes (8, 16, 32, 64)
2. Different memory layouts
3. Create a performance report
Advanced Fact
Wavefront operations can
enable new optimization
techniques in compute shaders
How does compute
programming
integrate with
graphics?
How does compute programming integrate
with graphics?
• Compute can prepare data for rendering
• Post-processing effects
• Procedural content generation
• Physics simulations
• Hybrid rendering techniques
Research Project
Investigate how:
1. Ray tracing uses compute
2. ML upscaling works
3. Particle systems are optimized
Future Fact
WebGPU is expected to
enable browser-based CAD
applications and scientific
visualization
What's next for
compute
programming?
What's next for compute programming?
• Tighter ML integration
• More hardware features exposed
• Better debugging tools
• Cross-platform standardization
• More accessible APIs
Challenge
Build your first compute shader:
• Simple image processor
• Parallel array reducer
• Interactive simulation
• Compute enables massive parallelism
• WebGPU brings GPU compute to the web
• Different mindset from CPU programming
• Performance requires careful optimization
• Essential for modern applications
Summary
Resources Visit
https://xbdev.net
https://webgpulab.xbdev.net
Questions
Recommend Reading
101 WebGPU and WGSL
Programming Projects (Paperback)
WebGPU Data
Visualization
Cookbook (2nd
Edition)
Lots of projects to keep you busy with compute programming
(working and thinking in parallel)
WebGPU
Compute
(Paperback)

More Related Content

PDF
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
PDF
WebGPU Compute - High Performance Compute Power - The Whats and Whys
PPT
Parallel computing with Gpu
PDF
Newbie’s guide to_the_gpgpu_universe
PPTX
GPU Computing: A brief overview
PPTX
benjamin kenwright webgpu api lecture 1.pptx
PPT
NVIDIA CUDA
PPTX
Future Directions for Compute-for-Graphics
High Performance Graphics - Introduction to WebGPU - Next Generation of High ...
WebGPU Compute - High Performance Compute Power - The Whats and Whys
Parallel computing with Gpu
Newbie’s guide to_the_gpgpu_universe
GPU Computing: A brief overview
benjamin kenwright webgpu api lecture 1.pptx
NVIDIA CUDA
Future Directions for Compute-for-Graphics

Similar to Compute Programming - Parallel Power for Modern Computing (20)

PDF
PDF
Computing using GPUs
PPTX
GPU Computing
PPTX
Graphic Processing Unit (GPU)
PPT
Lecture2 cuda spring 2010
PDF
CUDA-Python and RAPIDS for blazing fast scientific computing
PPTX
Gpu with cuda architecture
PDF
Zero con2019
PPTX
Graphics processing unit ppt
PDF
Raul sena - Apresentação Analiticsemtudo - Scientific Applications using GPU
PDF
Gpu perf-presentation
PDF
GPGPU Computation
PDF
Cuda materials
PPTX
PPTX
lecture11_GPUArchCUDA01.pptx
PPTX
GPU in Computer Science advance topic .pptx
PPT
Cuda intro
PDF
Gpu computing-webgl
PDF
Advanced Data Visualization with WebGPU and WGSL - Taking advantage of next g...
PDF
Introduction to CUDA programming in C language
Computing using GPUs
GPU Computing
Graphic Processing Unit (GPU)
Lecture2 cuda spring 2010
CUDA-Python and RAPIDS for blazing fast scientific computing
Gpu with cuda architecture
Zero con2019
Graphics processing unit ppt
Raul sena - Apresentação Analiticsemtudo - Scientific Applications using GPU
Gpu perf-presentation
GPGPU Computation
Cuda materials
lecture11_GPUArchCUDA01.pptx
GPU in Computer Science advance topic .pptx
Cuda intro
Gpu computing-webgl
Advanced Data Visualization with WebGPU and WGSL - Taking advantage of next g...
Introduction to CUDA programming in C language
Ad

More from contact14711 (20)

PDF
Visual Thinking with Data - From Static Charts to Interactive Insight - Data ...
PDF
Data Visualization Blender Scripting - Complexity, Data Dimensions and Extend...
PDF
Internet Dangers - Web has Become Wild West - More Dangerous Than You Think
PDF
Data Visualization - Psychological and Analytical Tricks
PDF
Your Brain Was Never Supposed to Read - it might not seem obvious - but our b...
PDF
Hello Clarice, do you like to play games? - Game Analytics and Psychology - u...
PDF
Speaking with Visualizations Combining graphics power with clarity and storyt...
PDF
Scientific Data Visualizations - Data Doesn't Care What You Believe.
PDF
AI Driven Data Visualization - AI is Not Your Enemy
PDF
Ethics, Testing, and Deployment - Data Visualization and Analytics
PDF
Ray-Tracing Acceleration Structures - Managing the Computational Complexity -...
PDF
Taste Vulkan Rainbow - Vulkan API for Graphics and Compute - Why It's Importa...
PDF
Special Effects Programming - Graphical Magic
PDF
Hello Ray-Tracing - What's it all about? Introduction to Ray-Tracing and why ...
PDF
Data Visualization - Understanding the Why - The Technologies - Custom Visual...
PDF
Graphics programming tomorrow - are humans still needed? Will AI take graphic...
PDF
Dual-Quaternions - A Unified Mathematical Logic
PDF
Data Visualization Power of Graphics for Understanding Data
PDF
Introduction ray-tracing and path-tracing
PDF
Introduction to Vulkan Compute Programming - High Performance Computing with ...
Visual Thinking with Data - From Static Charts to Interactive Insight - Data ...
Data Visualization Blender Scripting - Complexity, Data Dimensions and Extend...
Internet Dangers - Web has Become Wild West - More Dangerous Than You Think
Data Visualization - Psychological and Analytical Tricks
Your Brain Was Never Supposed to Read - it might not seem obvious - but our b...
Hello Clarice, do you like to play games? - Game Analytics and Psychology - u...
Speaking with Visualizations Combining graphics power with clarity and storyt...
Scientific Data Visualizations - Data Doesn't Care What You Believe.
AI Driven Data Visualization - AI is Not Your Enemy
Ethics, Testing, and Deployment - Data Visualization and Analytics
Ray-Tracing Acceleration Structures - Managing the Computational Complexity -...
Taste Vulkan Rainbow - Vulkan API for Graphics and Compute - Why It's Importa...
Special Effects Programming - Graphical Magic
Hello Ray-Tracing - What's it all about? Introduction to Ray-Tracing and why ...
Data Visualization - Understanding the Why - The Technologies - Custom Visual...
Graphics programming tomorrow - are humans still needed? Will AI take graphic...
Dual-Quaternions - A Unified Mathematical Logic
Data Visualization Power of Graphics for Understanding Data
Introduction ray-tracing and path-tracing
Introduction to Vulkan Compute Programming - High Performance Computing with ...
Ad

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Lesson notes of climatology university.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
RMMM.pdf make it easy to upload and study
Microbial disease of the cardiovascular and lymphatic systems
Microbial diseases, their pathogenesis and prophylaxis
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
O5-L3 Freight Transport Ops (International) V1.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Lesson notes of climatology university.
Final Presentation General Medicine 03-08-2024.pptx
Pharma ospi slides which help in ospi learning
Chinmaya Tiranga quiz Grand Finale.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
Final Presentation General Medicine 03-08-2024.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
RMMM.pdf make it easy to upload and study

Compute Programming - Parallel Power for Modern Computing

  • 1. Compute Programming Parallel Power for Modern Computing Course CP293
  • 2. Road Map • Why Compute Matters Today • Compute Languages/API • Core Concepts & Rules • Essential Algorithms • Performance Considerations • Practical Examples • Future of Compute • Summary & Resources
  • 3. Recommend Reading 101 WebGPU and WGSL Programming Projects (Paperback) WebGPU Data Visualization Cookbook (2nd Edition) Lots of projects to keep you busy with compute programming (working and thinking in parallel) WebGPU Compute (Paperback)
  • 4. Why Learn Compute Programming Today? • AI/ML revolution demands GPU compute • Games and simulations are more complex • Scientific computing needs more power • WebGPU brings GPU compute to the browser
  • 5. Did You Know? Modern GPUs contain thousands of cores while CPUs typically have 4-32 cores
  • 7. What exactly is compute programming? • Specialized programming for parallel processing • Utilizes GPU's architecture for general computation • Different paradigm from traditional CPU programming • Used in ML, scientific computing, data processing
  • 8. What makes GPU compute different from CPU programming?
  • 9. • Massively parallel vs sequential thinking • Different memory hierarchy • Specialized languages (WGSL, CUDA) • Different performance characteristics What makes GPU compute different from CPU programming? JIM, It’s programming, but not as we know it! GPU CPU Switch ‘Mindset’
  • 10. Hands-On Task Visit https://webgpulab.xbdev.net and: • 1. Check your browser's WebGPU support • 2. Run the demo compute shaders • 3. Note the performance metrics
  • 11. WebGPU Fact WebGPU provides 3x better performance than WebGL for compute workloads
  • 12. What are the key components of WebGPU?
  • 13. What are the key components of WebGPU? • Device: Represents the GPU • Queue: Command submission • Buffers: Memory storage • Textures: Image data • Bind Groups: Resource binding • Pipelines: Shader configurations
  • 14. Debugging Challenge Try this broken compute shader: 1. Identify why it fails 2. Fix the memory access issue 3. Measure the performance impact
  • 15. Performance Fact Coalesced memory access can improve performance by 20x compared to random access
  • 16. What are some common compute programming pitfalls?
  • 17. What are some common compute programming pitfalls? • Race conditions between threads • Incorrect memory barriers • Poor workgroup sizing • Memory access conflicts • Insufficient parallelism
  • 18. Optimization Puzzle Given this matrix multiplication shader: • 1. Identify the bottleneck • 2. Implement tiling with shared memory • 3. Compare performance before/after
  • 19. Algorithm Fact Parallel reduction can accelerate summation operations by 100x on GPUs
  • 20. What are essential compute algorithms to learn?
  • 21. What are essential compute algorithms to learn? • Parallel reduction (sum, min, max) • Prefix sum/scan • Matrix operations • Sorting (bitonic, radix) • Image processing kernels • Physics simulations
  • 22. Implementation Challenge Implement a parallel histogram: • 1. Start with naive version • 2. Add atomic operations • 3. Optimize with shared memory
  • 23. Optimization Fact Proper workgroup sizing can improve performance by 5-10x
  • 24. How do I profile and optimize compute shaders?
  • 25. How do I profile and optimize compute shaders? • Use timestamp queries • Profile different workgroup sizes • Analyze memory access patterns • Check for thread divergence • Compare against theoretical limits
  • 26. Profiling Task Profile this shader with: 1. Different workgroup sizes (8, 16, 32, 64) 2. Different memory layouts 3. Create a performance report
  • 27. Advanced Fact Wavefront operations can enable new optimization techniques in compute shaders
  • 29. How does compute programming integrate with graphics? • Compute can prepare data for rendering • Post-processing effects • Procedural content generation • Physics simulations • Hybrid rendering techniques
  • 30. Research Project Investigate how: 1. Ray tracing uses compute 2. ML upscaling works 3. Particle systems are optimized
  • 31. Future Fact WebGPU is expected to enable browser-based CAD applications and scientific visualization
  • 33. What's next for compute programming? • Tighter ML integration • More hardware features exposed • Better debugging tools • Cross-platform standardization • More accessible APIs
  • 34. Challenge Build your first compute shader: • Simple image processor • Parallel array reducer • Interactive simulation
  • 35. • Compute enables massive parallelism • WebGPU brings GPU compute to the web • Different mindset from CPU programming • Performance requires careful optimization • Essential for modern applications Summary Resources Visit https://xbdev.net https://webgpulab.xbdev.net
  • 37. Recommend Reading 101 WebGPU and WGSL Programming Projects (Paperback) WebGPU Data Visualization Cookbook (2nd Edition) Lots of projects to keep you busy with compute programming (working and thinking in parallel) WebGPU Compute (Paperback)