Skip to content

Add arch-specific bitcode file search to cuda.pathfinder#2201

Draft
benhg wants to merge 8 commits into
NVIDIA:mainfrom
benhg:issue-2200-sm-arch-bitcode
Draft

Add arch-specific bitcode file search to cuda.pathfinder#2201
benhg wants to merge 8 commits into
NVIDIA:mainfrom
benhg:issue-2200-sm-arch-bitcode

Conversation

@benhg

@benhg benhg commented Jun 11, 2026

Copy link
Copy Markdown
Member

Description

Implement #2200. Adds an sm_arch argument to CUDA-Pathfinder's bitcode file search.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 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 Jun 11, 2026
@benhg benhg requested a review from rwgk June 11, 2026 18:51
Comment thread cuda_pathfinder/tests/test_find_bitcode_lib.py Outdated
@benhg benhg force-pushed the issue-2200-sm-arch-bitcode branch from d1f8cc6 to f1289cc Compare June 11, 2026 18:52
Comment thread cuda_pathfinder/tests/test_find_bitcode_lib.py Outdated
@benhg benhg force-pushed the issue-2200-sm-arch-bitcode branch from f1289cc to 98ccd6e Compare June 11, 2026 18:55
@benhg benhg self-assigned this Jun 11, 2026
@benhg benhg added this to the cuda.pathfinder next milestone Jun 11, 2026
Comment thread cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py Outdated
@rwgk rwgk added the P0 High priority - Must do! label Jun 11, 2026
attachments.append(f' Directory does not exist: "{dir_path}"')


def _filename_with_sm_arch(filename: str, sm_arch: str) -> str:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small cleanup: switching to fullmatch, compile the SM arch pattern once, and reuse .pattern in the error message. That keeps the validation contract in one place instead of repeating the regex in code and text.

_SM_ARCH_PATTERN = re.compile(r"sm[0-9]+[a-z]?")


def _filename_with_sm_arch(filename: str, sm_arch: str) -> str:
    if not sm_arch:
        return filename

    if not _SM_ARCH_PATTERN.fullmatch(sm_arch):
        raise ValueError(f"Invalid sm_arch: {sm_arch!r} must match {_SM_ARCH_PATTERN.pattern!r}")

    stem, ext = os.path.splitext(filename)
    return f"{stem}_{sm_arch}{ext}"

Comment thread cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py Outdated
@rwgk

rwgk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/ok to test 614dead

@rwgk

rwgk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Hi @benhg, I went ahead and added a commit to parametrize the sm_arch_is_keyword_only test, so that we also have it for locate_bitcode_lib. Running the CI now.

@rwgk rwgk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benhg, I'll set this to auto-merge. 🤞

@rwgk

rwgk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Sorry I overlooked before that this PR was behind main. It was missing PR #2199. I clicked the Update branch button and will retrigger the CI.

@rwgk

rwgk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/ok to test bb8643b

@github-actions

Copy link
Copy Markdown

@rwgk rwgk marked this pull request as draft June 11, 2026 23:04
@rwgk

rwgk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Converting to draft, so this doesn't get merged accidentally, pending offline nvshmem design/packaging discussions.

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 P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants