refactor(pathfinder): author candidates in search order - #2708
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test e7705a7 |
This comment has been minimized.
This comment has been minimized.
isVoid
left a comment
There was a problem hiding this comment.
Just confirming one thing below, else lgtm.
| SUPPORTED_LINUX_SONAMES_CTK = { | ||
| desc.name: _legacy_least_preferred_first(desc.linux_sonames) for desc in _CTK_DESCRIPTORS if desc.linux_sonames | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yes, that is correct. There are a few additional in-tree uses of these mappings, but they are all order-insensitive: they use dictionary keys, membership, parametrization, or uniqueness checks. Runtime discovery and loading consume the descriptor tuples directly.
The reversal here is deliberately conservative. supported_nvidia_libs.py is retained for legacy compatibility, and although these constants are private implementation details, client code could have imported and iterated, indexed, or compared their tuple values. Preserving their historical order costs only this small conversion and keeps the refactor mechanically strictly behavior-neutral.
|
Description
Follow-up to #2689 and the ordering discussion in
#2689 (comment).
Pathfinder historically authored dynamic-library filenames in ascending order,
then reversed them at each runtime lookup site. That distinction no longer
serves the descriptor catalog and makes preference mistakes easier.
This PR:
order, most preferred first;
search consume the descriptor tuples as-is;
SUPPORTED_*projections at their compatibility boundary; and
utilities, static libraries, and bitcode libraries are consumed first to
last.
The tuple rewrite is mechanically behavior-neutral: every multi-name dynamic
library tuple is the exact reverse of its previous catalog representation, and
the corresponding runtime reversal is removed.
Validation
cuda-pathfindersuite: 1,608 passed, 5 skipped on CUDA 13.3.checker).