v1.17.0 #1886
shi-eric
announced in
Announcements
v1.17.0
#1886
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Warp v1.17.0
Warp v1.17 expands geometry queries with sphere and capsule searches over BVHs, exact sphere queries against mesh triangles, and direct access to a mesh's BVH. Tiles now support matrix-row indexing, CG and CR solvers can restart periodically, and new controls let you tune and inspect CUDA kernel resource use. The release also includes experimental native build hooks for external C++ and CUDA integrations, along with native CPU support when building Warp from source on Windows ARM64.
If you are upgrading, note that implicit conversion of Python and Warp numeric scalars to composite types has been removed; see Removals and deprecations for migration guidance.
New features
Sphere and capsule spatial queries
A BVH can now be queried with a sphere or capsule instead of first converting the search region to an AABB.
wp.bvh_query_sphere()finds item bounds that overlap a sphere using an exact sphere-AABB test.wp.bvh_query_capsule()searches for item bounds that overlap the volume swept by moving a sphere along a line segment. Capsule queries are conservative: they do not miss bounds within the requested radius, but they can return extra candidates near AABB corners (#1741).A capsule query takes a start point and a direction rather than two endpoints. To query the segment from
p0top1, passp0as the start andp1 - p0as the direction towp.bvh_query_capsule(). By default, traversal continues indefinitely along that direction. Passmax_dist=1.0towp.bvh_query_next()to limit the query to the full segment, including both endpoints. Ifp0 == p1, usewp.bvh_query_sphere()instead.wp.mesh_get_bvh()exposes a mesh's internal BVH to the generalwp.bvh_query_*()APIs. This makes BVH-only operations such aswp.bvh_query_capsule()available for meshes, with returned bound indices corresponding to triangle faces. Usewp.mesh_query_sphere()when you need exact triangle-sphere intersections rather than broad-phase candidates.wp.MeshQueryis now the common base type for AABB and sphere mesh queries, withwp.mesh_query_next()as the canonical iterator for both. The existingwp.MeshQueryAABBtype andwp.mesh_query_aabb_next()alias remain available.Tune and inspect CUDA kernel resource use
CUDA kernels now have controls for register allocation and shared-memory spilling, and their resource use can be inspected before launch.
cuda_max_registersrequires Warp to have been built with CUDA Toolkit 12.4 or newer and cannot be combined withlaunch_bounds. The Linux and Windowswarp-langwheels on PyPI are built with CUDA Toolkit 12.9, so they meet this requirement.enable_cuda_smem_spillingtakes effect only when Warp itself was built with CUDA Toolkit 13.0 or newer. Warp 1.17's PyPI wheels use CUDA Toolkit 12.9 and ignore this option. CUDA 13.0 wheels for Linux x86-64, Linux ARM64, and Windows x86-64 are available from GitHub Releases, or you can build Warp from source with CUDA Toolkit 13.0 or newer. CUDA 13 builds require an R580-series or newer NVIDIA driver and a Turing-class GPU (compute capability 7.5) or newer. See CUDA 13 PyPI wheel timing for the planned PyPI transition. Shared-memory spilling is also ignored when a kernel uses dynamic shared memory (#1671).wp.get_cuda_kernel_properties()compiles the requested kernel variant if necessary, without launching it, and reports its per-thread register count and local-memory use (#1805).Resource counts depend on the GPU, toolchain, compiler options, and block size. Use them to investigate occupancy and spilling, then profile the kernel before changing its configuration.
Tile programming
Index matrix rows inside tiles
Matrix-valued tiles now support chained row indexing such as
tile[i, j, k][row]. Reads, writes, negative row indices, and adjoints work for tiles with one through four logical dimensions (#1028).Iterative solvers
Limit finite-precision drift with CG and CR restarts
Over a long CG or CR solve, the recursively updated residual can drift away from the true residual
b - A x. Setrestart=Nonwarp.optim.linear.cg()orwarp.optim.linear.cr()to recompute it and reset the search direction everyNiterations. This matters most forfloat32CUDA workloads, including batched and matrix-free solves. The restart path also works with CUDA graph capture (#1708).A restart requires one extra matrix-vector product. Warp checks convergence and invokes callbacks only at cycle boundaries, so the solve can run up to
restart - 1iterations pastmaxiter. Omitrestartto keep the existing recursive behavior.Batched CUDA solves also get more accurate dot products as subproblem size grows. When the largest subproblem is known, pass
max_batch_lengthtoLinearOperatororaslinearoperator()to avoid unnecessary reduction work (#1700). Reusable CG, CR, BiCGSTAB, and GMRES states returned withrun=Falsenow allocate their temporary device memory once during construction instead of on each solve.Compilation and tooling
Name generated kernels explicitly
Kernel factories can now give closure-generated kernels distinct, predictable names for registration and ahead-of-time compilation. Set
nameon@wp.kernelto assign the registration key and the base of the generated native entry-point name (#1561).Names must be valid C++ identifiers. With
strip_hash=True, Warp uses the custom key without a hash suffix as the base of generated entry-point names.Experimental native build hooks
Important
This is an experimental feature. The API may change without a formal deprecation cycle.
Add-on packages can now attach native C++ or CUDA headers to a Warp module and make header-defined types and functions available to Warp kernels.
wp.ModuleBuildOptionssupplies include directories, preambles, and dependency files.wp.build_experimental.add_native_type()andadd_builtin()register the matching ABI types and functions, whilewp.compile_aot_module()returns artifact paths for an external build or runtime system (#1575). We have not yet validated this as a complete production workflow.In this example,
addon_math.hcomes from the add-on package, not Warp. The example assumes this package layout:addon_math.hdefines the native function that the add-on exposes to Warp kernels. Warp includes its native headers first, so the add-on header can useCUDA_CALLABLE:include/addon_math.h:build_addon.pylocates the header relative to its own file, registersaddon::squareaswp.addon_square, and tells Warp where to find the header when compiling the module:This example stops after generating PTX. It does not include the external application that loads and launches the PTX.
External native value types do not gain arithmetic or differentiation automatically. Register those functions separately.
Platform and toolchain
Additional improvements
wp.transform()with no arguments and same-type copies. Unsupported Python arguments now raiseTypeErrorinstead of silently returning an all-zero transform, and scalar construction inside kernels fills all seven components (wp.transform()silently returns a zero value on unsupported arguments #1742,wp.transform()fill and copy construction fail at kernel scope #1814).wp.empty()andwp.zeros()allocations now account for gaps correctly and reject negative or dimensionally invalid strides (wp.empty() and wp.zeros() can allocate insufficient storage for custom-strided arrays #1703).wp.map()andwp.utils.create_warp_function()now have stable identities across processes. This allows persistent kernel-cache reuse when separate processes discover the callables in different orders (Salted hash() in create_warp_function makes kernel hashing nondeterministic, defeating and eventually poisoning the kernel cache #1696).New example
example_fdtd_3d.pyis a three-dimensional finite-difference time-domain simulation on a Yee grid. It models a Luneburg lens that collimates waves from a point source and supports both interactive Matplotlib visualization and headless execution (#1772).Announcements
CUDA 13 PyPI wheel timing
pipdoes not check the installed driver or GPU architecture and may install a wheel whose CUDA backend cannot run on the system.This updates the tentative plan announced in Warp v1.16.0. See NVIDIA's CUDA minor-version compatibility table for driver requirements.
Removals and deprecations
wp.mat22(123)(Remove implicit scalar promotion to composite types #1721).wp.mat22(np.float32(123)). This conversion will be removed in a future feature release under Warp's standard deprecation timeline (Remove implicit scalar promotion to composite types #1721).wp.Texture.copy_from_array()andwp.Texture.copy_to_array()have been removed. Usewp.Texture.copy_from()andwp.Texture.copy_to()(Remove deprecated Texture array-copy aliases #1722).wp.spatial_jacobian()andwp.spatial_mass()have been removed. Although previously listed as built-ins, neither function was callable from kernels or Python (spatial_jacobian()andspatial_mass()cannot be called from kernels or from Python #1768).Migration examples:
Acknowledgments
We thank the following contributors from outside the core Warp development team:
wp.empty()andwp.zeros()arrays (wp.empty() and wp.zeros() can allocate insufficient storage for custom-strided arrays #1703).@wp.kernel(name=...)(Allow passing a key/name to the@wp.kernel#1561, Add name argument to @wp.kernel (GH-1561) #1570).For a complete list of changes, see the full changelog.
This discussion was created from the release v1.17.0.
All reactions