-
Notifications
You must be signed in to change notification settings - Fork 477
Validate default_ptx_arch against NVRTC supported architectures #1218
Description
Summary
default_ptx_arch is hardcoded to 75 in both the device-present path and the no-device path without validating that the value is actually supported by the available NVRTC. If NVRTC ever dropped support for arch 75, implicit compilation would fail with a cryptic error.
Details
In warp/_src/context.py, both code paths set:
default_ptx_arch = 75This value is never checked against Runtime.nvrtc_supported_archs. A defensive improvement would be to clamp or validate default_ptx_arch (and config.ptx_target_arch) against the set of architectures NVRTC actually supports, e.g.:
default_ptx_arch = max(nvrtc_supported_archs) if nvrtc_supported_archs else 75Impact
Low — Warp requires CUDA 12.0+, and NVRTC has supported arch 75 (Turing) since CUDA 10. This is a hardening/robustness concern rather than a current bug.
Context
Raised during review of GH-1217 (NVRTC compilation without CUDA driver). The reviewer noted the no-device path inherits this pattern from the existing device-present path, so both paths would benefit from the fix.