Skip to content
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

Add PacketOps support for textures #329

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Add PacketOps support for textures #329

merged 1 commit into from
Feb 6, 2025

Conversation

rtabbara
Copy link
Contributor

Texture channel data is packed contiguously, so leverage PacketOps for gathers (and scatters) that show substantial speed-ups (particularly on the LLVM backend).

This is especially true for half-precision textures, where the absence of FP16 SIMD gather instructions results in bloated compiled kernels and a degradation in performance relative to the single-precision counterpart. PacketOps circumvents this issue by avoiding the use of gather intrinsics entirely.

Copy link
Member

@wjakob wjakob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, only a few quite superficial comments 🚀

include/drjit/util.h Show resolved Hide resolved
include/drjit/texture.h Outdated Show resolved Hide resolved
include/drjit/texture.h Outdated Show resolved Hide resolved
include/drjit/texture.h Outdated Show resolved Hide resolved
tests/test_texture.py Outdated Show resolved Hide resolved
rtabbara added a commit to mitsuba-renderer/mitsuba3 that referenced this pull request Jan 27, 2025
* Prior to Mitsuba 3.6, FP16 storage for bitmaps was disabled due to observed degradation in performance (particularly on LLVM backends)
* Changes with Dr.Jit textures now using PacketOps (mitsuba-renderer/drjit#329) means we can re-enable support for FP16 bitmap textures
rtabbara added a commit to mitsuba-renderer/mitsuba3 that referenced this pull request Jan 27, 2025
* Prior to Mitsuba 3.6, FP16 storage for bitmaps was disabled due to observed degradation in performance (particularly on LLVM backends)
* Changes with Dr.Jit textures now using PacketOps (mitsuba-renderer/drjit#329) means we can re-enable support for FP16 bitmap textures
include/drjit/texture.h Show resolved Hide resolved
include/drjit/texture.h Show resolved Hide resolved
include/drjit/texture.h Show resolved Hide resolved
include/drjit/texture.h Show resolved Hide resolved
include/drjit/texture.h Show resolved Hide resolved
@njroussel njroussel mentioned this pull request Feb 4, 2025
Texture channel data is packed contiguously, so leverage PacketOps for gathers (and scatters) that show substantial speed-ups (particularly on the LLVM backend).

This is especially true for half-precision textures, where the absence of FP16 SIMD gather instructions results in bloated compiled kernels and a degradation in performance relative to the single-precision counterpart. PacketOps circumvents this issue by avoiding the use of gather intrinsics entirely.
rtabbara added a commit to mitsuba-renderer/mitsuba3 that referenced this pull request Feb 5, 2025
* Prior to Mitsuba 3.6, FP16 storage for bitmaps was disabled due to observed degradation in performance (particularly on LLVM backends)
* Changes with Dr.Jit textures now using PacketOps (mitsuba-renderer/drjit#329) means we can re-enable support for FP16 bitmap textures
Copy link
Member

@njroussel njroussel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! 🚀

@njroussel njroussel merged commit a1e4cf5 into master Feb 6, 2025
5 checks passed
@njroussel njroussel deleted the packet_ops_tex_v2 branch February 6, 2025 14:53
njroussel pushed a commit to mitsuba-renderer/mitsuba3 that referenced this pull request Feb 6, 2025
* Prior to Mitsuba 3.6, FP16 storage for bitmaps was disabled due to observed degradation in performance (particularly on LLVM backends)
* Changes with Dr.Jit textures now using PacketOps (mitsuba-renderer/drjit#329) means we can re-enable support for FP16 bitmap textures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants