Skip to content

perf(pathfinder): fast-path exact directory searches#2425

Open
KRRT7 wants to merge 2 commits into
NVIDIA:mainfrom
KRRT7:perf/pathfinder-exact-discovery
Open

perf(pathfinder): fast-path exact directory searches#2425
KRRT7 wants to merge 2 commits into
NVIDIA:mainfrom
KRRT7:perf/pathfinder-exact-discovery

Conversation

@KRRT7

@KRRT7 KRRT7 commented Jul 25, 2026

Copy link
Copy Markdown

Description

Optimize exact directory discovery in cuda.pathfinder by joining the complete candidate path and checking it once.

Previously, exact paths were traversed one component at a time, resulting in one filesystem check per component. Wildcard paths retain the existing traversal behavior.

This affects the shared discovery path used for CUDA headers, binaries, static libraries, bitcode libraries, and dynamic-library locations.

A new cross-platform pyperf benchmark suite under benchmarks/cuda_pathfinder/ covers:

  • exact-path hits and misses;
  • wildcard traversal;
  • cached lookup;
  • cold public API discovery for headers, binaries, and static libraries;
  • realistic one-root and three-root site-packages layouts.

Performance

Rigorous A/B measurements compared pristine main against this branch using identical environments and fixtures:

Public workload Before After Improvement
Header discovery, 1 root 142 us 70.8 us 2.01x
Header discovery, 3 roots 202 us 141 us 1.44x
Binary discovery, 1 root 149 us 71.8 us 2.07x
Binary discovery, 3 roots 206 us 144 us 1.43x
Static-library discovery, 3 roots 219 us 141 us 1.55x

Geometric mean: 1.68x faster.

The benchmark fixtures use NVIDIA wheel layouts such as:

  • nvidia/cuda_runtime/include
  • nvidia/cuda_nvcc/bin
  • nvidia/cuda_runtime/lib

Notes

  • GPU execution performance is unchanged.
  • This improves CPU-side cold discovery and startup latency.
  • Wildcard search behavior and result ordering are unchanged.

KRRT7 added 2 commits July 25, 2026 18:42
Signed-off-by: Kevin Turcios <turcioskevinr@gmail.com>
Signed-off-by: Kevin Turcios <turcioskevinr@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant