Document C++ and CUDA workflows#1494
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request introduces a new comprehensive "Extending Warp" user guide documenting native function integration, custom allocators, and custom loggers, with coordinated updates to existing documentation, decorator docstrings, and navigation to establish consistent cross-references across the Warp documentation. ChangesCustomization APIs Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/user_guide/differentiability.rst (1)
675-676: ⚡ Quick winUse explicit keyword arguments for
wp.func_nativesnippets to avoid API-order ambiguity.Given the text says “provide
adj_snippet,” the decorator call is safer/clearer as keyword args (snippet=...,adj_snippet=...) instead of positional arguments.Suggested doc tweak
- `@wp.func_native`(snippet, adj_snippet) + `@wp.func_native`(snippet=snippet, adj_snippet=adj_snippet) def axpy(🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/user_guide/differentiability.rst` around lines 675 - 676, The decorator call for axpy uses positional args which can be ambiguous; change the `@wp.func_native` usage to pass explicit keyword arguments (e.g., snippet=... and adj_snippet=...) so the decorator invocation is unambiguous—update the `@wp.func_native`(...) line above the axpy definition to use snippet= and adj_snippet= named parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/user_guide/differentiability.rst`:
- Around line 675-676: The decorator call for axpy uses positional args which
can be ambiguous; change the `@wp.func_native` usage to pass explicit keyword
arguments (e.g., snippet=... and adj_snippet=...) so the decorator invocation is
unambiguous—update the `@wp.func_native`(...) line above the axpy definition to
use snippet= and adj_snippet= named parameters.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Enterprise
Run ID: 24bc03c1-c570-4231-a7c4-733be99601cd
📒 Files selected for processing (8)
docs/deep_dive/allocators.rstdocs/deep_dive/codegen.rstdocs/index.rstdocs/user_guide/basics.rstdocs/user_guide/debugging.rstdocs/user_guide/differentiability.rstdocs/user_guide/extending_warp.rstwarp/_src/context.py
Greptile SummaryThis PR adds a new
Confidence Score: 5/5This is a documentation-only change with no runtime code modifications; it is safe to merge. All changes are documentation and docstrings. The new page's testcode blocks are either guarded by skipif or verified with np.testing.assert_array_equal. All cross-references resolve to existing targets. The only finding is a skipif guard on a CPU-capable doctest that is more restrictive than necessary — it doesn't cause any incorrect behavior, just reduces test coverage on CPU-only CI. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User needs non-Python integration] --> B{What kind?}
B -->|Embed CUDA/C++ in kernel| C[cpp_cuda_workflows.rst\nNative Snippets section]
B -->|Compile kernels ahead of time| D[cpp_cuda_workflows.rst\nAOT Workflows section]
B -->|Replay from C++ without Python| E[cpp_cuda_workflows.rst\nAPI Capture Replay section]
C --> F[wp.func_native in context.py\nExpanded docstring + examples]
C --> G[differentiability.rst\nAdjoint / replay_snippet guidance]
D --> H[codegen.rst\nahead_of_time_compilation_workflows label]
E --> I[runtime.rst\napic_save_load label]
F --> J[basics.rst / debugging.rst\nAllocators.rst cross-links]
Reviews (7): Last reviewed commit: "Document C++ and CUDA workflows" | Re-trigger Greptile |
bea13a6 to
398c868
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/deep_dive/allocators.rst`:
- Around line 406-407: The section underline for the heading "RAPIDS Memory
Manager (RMM) Integration" is one character short; update the underline (the row
of ~ characters immediately below that heading in docs/deep_dive/allocators.rst)
so it is at least as long as the heading text (add one more ~ to make it 40
characters) so the reStructuredText title underline matches or exceeds the
heading length.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Enterprise
Run ID: 6579d5fe-1527-4e54-b1bd-da2362eeb29c
📒 Files selected for processing (4)
docs/deep_dive/allocators.rstdocs/user_guide/debugging.rstdocs/user_guide/extending_warp.rstwarp/_src/context.py
✅ Files skipped from review due to trivial changes (3)
- warp/_src/context.py
- docs/user_guide/debugging.rst
- docs/user_guide/extending_warp.rst
1cb56c5 to
07d09bc
Compare
The branch previously split extension-point docs across several commits. It also introduced an Advanced Customization page that mixed native snippets, custom allocators, and logger configuration. Keep allocator and logger guidance in their topical docs. Use the new user-guide page for C++ and CUDA workflows: native snippets, AOT outputs, C++ example entry points, and APIC replay. This gives non-Python workflows a discoverable home without moving unrelated customization docs away from the pages users already consult. Signed-off-by: Eric Shi <ershi@nvidia.com>
07d09bc to
3c924f4
Compare
Description
Add a new
Extending Warpuser guide page that makes public extension points easier to discover. The page now covers native C++/CUDA snippets viawp.func_native, custom allocators, custom loggers, and related extension points.The existing differentiability page now keeps only autodiff-specific native snippet guidance and links to the new page for general syntax. Related pages in Basics, Codegen, Allocators, and Debugging now cross-link to the new hub. The generated API docs for
wp.func_nativealso get a fuller docstring with safer examples.Checklist
Test plan
uvx pre-commit run --files docs/index.rst docs/user_guide/extending_warp.rst docs/user_guide/basics.rst docs/user_guide/differentiability.rst docs/deep_dive/allocators.rst docs/user_guide/debugging.rst docs/deep_dive/codegen.rst warp/_src/context.pyWARP_CACHE_ROOT=/tmp/warp-cache-warp-worktree-2-docs WARP_CACHE_PATH=/tmp/warp-cache-warp-worktree-2-docs uv run --extra docs build_docs.py 2>&1 | tee /tmp/build_docs.logrg -n "WARNING|undefined label|unknown document|Title underline too short|Inline emphasis" /tmp/build_docs.logNew feature / enhancement
This is a documentation discoverability enhancement for existing Warp extension APIs.
Summary by CodeRabbit