Cycles: CPU batched execution for performance #92572

Open
opened 2021-10-28 15:04:16 +02:00 by Brecht Van Lommel · 9 comments

With the new Cycles architecture, it will be easier to take advantage of SIMD instructions. This can be done in 3 steps.

  • Use Embree batched ray tracing
  • Use OSL batched shading
  • Use batched execution for rest of the kernel

This requires some changes for CPU threads to render multiple paths in a batch. This is relatively easy with the new architecture, which already works like a state machine.

Some technical points:

  • For full batched execution of the kernel the integrator state likely needs a SoA memory layout for good performance. However for Embree and OSL this is likely not needed yet.
  • Full batched execution of the kernel could be implemented in two ways. Either we could use a dedicated compiler like ISPC for it, or we could use a template library like Enoki.
  • The optimal size of batches is unclear. It can range from 4/8/16 to potentially millions, depending if it pays of to extract as much coherence as possible with sorting etc, or if a small batch using incidental coherence is better due to less overhead.
With the new Cycles architecture, it will be easier to take advantage of SIMD instructions. This can be done in 3 steps. - [ ] Use Embree batched ray tracing - [ ] Use OSL batched shading - [ ] Use batched execution for rest of the kernel This requires some changes for CPU threads to render multiple paths in a batch. This is relatively easy with the new architecture, which already works like a state machine. Some technical points: * For full batched execution of the kernel the integrator state likely needs a SoA memory layout for good performance. However for Embree and OSL this is likely not needed yet. * Full batched execution of the kernel could be implemented in two ways. Either we could use a dedicated compiler like ISPC for it, or we could use a template library like Enoki. * The optimal size of batches is unclear. It can range from 4/8/16 to potentially millions, depending if it pays of to extract as much coherence as possible with sorting etc, or if a small batch using incidental coherence is better due to less overhead.
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @brecht

Added subscriber: @brecht
Member

Added subscriber: @Alaska

Added subscriber: @Alaska

Added subscriber: @SteffenD

Added subscriber: @SteffenD

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Added subscriber: @Stefan_Werner

Added subscriber: @Stefan_Werner

Added subscriber: @Garek

Added subscriber: @Garek
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58
Brecht Van Lommel added this to the Render & Cycles project 2023-02-07 19:08:06 +01:00
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:02:55 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#92572
No description provided.