[DNS] Dev/mkeshava/benchmark test - #904
Draft
mkeshavaNV wants to merge 6 commits into
Draft
Conversation
…mers Bypass slangtorch's Python WrappedFunction layer and call the raw pybind11 C++ fn_handle directly. This matches NRE's pre-compiled slangtorch extension behavior and reduces dispatch overhead from ~92us to ~39us (fwd p50). Also adds CPU dispatch timing instrumentation (atexit stats) to both slangpy and slangtorch PPISP benchmarks for apples-to-apples launch latency comparison. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidate _fn_handle and _bwd_fn_handle into a single _get_native_fns() function with documentation explaining why we bypass slangtorch's WrappedFunction layer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Load the slangtorch-compiled C++ extension directly as a raw pybind11
module, bypassing slangtorch's Python WrappedFunction wrapper entirely.
This matches NRE's pattern where bazel's slangtorch_library() produces
a pre-compiled .so that Python imports and calls directly:
ppisp_slang.ppisp(block, grid, batch_size, ...) # NRE: 18us
ppisp_slang.ppisp_bwd_diff(block, grid, ...) # NRE: 12us
The standalone JIT-compiled path now achieves 39us fwd / ~30us bwd,
vs 92us previously with WrappedFunction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ppisp_slangtorch_cc.so, the pre-compiled C++ CUDA extension for the PPISP slangtorch kernel. At runtime, _get_native_module() loads this .so directly (matching NRE's libppisp_slang_cc pattern), avoiding the ~8s JIT compilation on first run. Falls back to JIT via slangtorch if the .so fails to load (wrong platform/Python/CUDA version). Built with: torch 2.11.0+cu128, Python 3.12, Linux x86_64. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Recompile the slangtorch C++ extension with the same flags as NRE's bazel slangtorch_library(): - nvcc: -O3 --use_fast_math --generate-line-info - g++: -O3 -DTORCH_EXTENSION_NAME=libppisp_slangtorch_cc - ld: -Wl,--no-undefined -Wl,--as-needed This reduces dispatch latency from 31us to 12us (matching NRE's 18us) and shrinks the .so from 2.0M to 716K. The key optimization is --as-needed which reduces PLT overhead from unused symbol resolution. Built with: nvcc 12.8, g++ 13, torch 2.11.0+cu128, Python 3.12. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
build_slangtorch_cc.sh recompiles the JIT-generated slangtorch sources with optimized flags (-O3, --as-needed) Usage: ./slangpy/benchmarks/ppisp/build_slangtorch_cc.sh /path/to/python
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.