fix(cudnn): implement cuDNN 9 error codes, replace todo!() panic with proper mapping#371
Draft
CharryWu wants to merge 1 commit intoRust-GPU:mainfrom
Draft
fix(cudnn): implement cuDNN 9 error codes, replace todo!() panic with proper mapping#371CharryWu wants to merge 1 commit intoRust-GPU:mainfrom
CharryWu wants to merge 1 commit intoRust-GPU:mainfrom
Conversation
…r mapping cuDNN 9 restructured cudnnStatus_t into a hierarchical numeric system (2xxx=BAD_PARAM, 3xxx=NOT_SUPPORTED, 4xxx=INTERNAL_ERROR, 5xxx=EXECUTION_FAILED) and removed several codes present in cuDNN 8. Changes: - Add four new CudnnError variants behind #[cfg(cudnn9)]: SublibraryVersionMismatch, SerializationVersionMismatch, Deprecated, SublibraryLoadingFailed - Replace the _ => todo!() wildcard in IntoResult::into_result() with a category-based fallback that maps cuDNN 9 sub-codes (e.g. BAD_PARAM_NULL_POINTER) to their parent category variant using integer division, eliminating the runtime panic entirely - Add wire both new variants in into_raw() for round-trip correctness Verified against cudnn_graph.h from cuDNN 9.20 (anaconda distribution). The cudnn crate itself compiles cleanly; only pre-existing cust bindgen errors prevent a full cargo check -p cudnn from succeeding. Made-with: Cursor
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.
Summary
Fixes a runtime panic in crates/cudnn/src/error.rs when the cudnn crate is built against cuDNN 9+.
Problem
When DEP_CUDNN_VERSION >= 90000, the build script sets cfg(cudnn9). The into_result() implementation had an unresolved TODO comment followed by _ => todo!(). Any unrecognized status code would panic at runtime rather than return an error.
cuDNN 9 restructured cudnnStatus_t into a hierarchical numeric system. New sub-codes such as CUDNN_STATUS_BAD_PARAM_NULL_POINTER (2002) and CUDNN_STATUS_NOT_SUPPORTED_ARCH_MISMATCH (3007) could trigger the wildcard arm and cause panics.
Changes
Verification
Verified against cudnn_graph.h from cuDNN 9.20 (CUDA 13.2 / anaconda). The cudnn crate compiles cleanly on this setup.
Testing