-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move qualifying GroupData params onto stack #1710
Move qualifying GroupData params onto stack #1710
Conversation
18a54a6
to
a608ca6
Compare
This looks very good to me! |
As this seems useful change in general, would be good to update batched version to make the same type of change (actually should looks pretty much identical) |
Yep, happy to port this over. |
Updated with batched implementation. I'm relying on the Github CI for testing. |
Chris, you can build and test batched mode at work. Ask me how tomorrow. |
9e200e7
to
e9cba39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
Signed-off-by: Chris Hellmuth <chellmuth@gmail.com>
02b66b2
to
ea1a496
Compare
d4faecd
into
AcademySoftwareFoundation:main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* build(deps): Raise minimum CMake dependency from 3.12 to 3.15 (AcademySoftwareFoundation#1724) * Change RendererServices::get_texture_handle back to ustring (AcademySoftwareFoundation#1726) * The recently added SS::find_symloc can have const args (AcademySoftwareFoundation#1723) * perf(gpu): Move qualifying GroupData params onto stack (AcademySoftwareFoundation#1710) * OptiX PTX pipeline overhaul (AcademySoftwareFoundation#1680) * Fix default fmt logic changing in latest openimageio release (AcademySoftwareFoundation#1725) * feat: Add API for building attribute getter free functions. (AcademySoftwareFoundation#1704) * fix: Handle mixed string casting that plagues optix codegen (AcademySoftwareFoundation#1718) * Rs fmt specification - Journaling Algorithm for error, warning, fprintf (AcademySoftwareFoundation#1702)
Description
On SPI Arnold, we are seeing GroupData as a bottleneck for GPU performance. Regardless of whether the buffer is backed by local or global memory, it's off-chip and slow to access.
This change moves qualifying parameters out of the GroupData struct and onto the stack. On GPU this makes those parameters more likely to be stored in registers, leading to better performance.
Qualifying parameter details
The qualifying parameters are all the output parameters minus three exceptions.
A typical output parameter's lifetime is scoped to the execution of the instance it is associated with. The parameter is initialized at the beginning of instance execution, accessed during the body of the instance, and after the instance body its final state is broadcast to all its downstream connections. This lifetime makes output parameters a good fit for stack storage.
The three exceptions:
These are all identifiable at code generation time and can be flagged as disqualifying.
Improvements
On internal scenes, this change improves performance by about 15% on GPU. On CPU there aren't any performance regressions, but we don't see significant gains either. It also improves ptx generation and compilation by about 10%, and slightly lowers our memory footprint due to the GroupData size reduction.
Tests
Exceptions 2 & 3 are covered by existing tests. A new test is added for exception 1, and for the case of successful optimization. This patch was also run through our internal shading testsuite.
Checklist: