Skip to content

feat: arch/cc compatibility check. - #774

Merged
sayakpaul merged 7 commits into
release-0.16from
arch-check-0.16
Aug 21, 2026
Merged

sayakpaul merged 7 commits into
release-0.16from
arch-check-0.16

Conversation

@sayakpaul

Copy link
Copy Markdown
Member

Closes #769 and thereby should also hopefully close #707.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

print(f"{name}: rejected ({decision.reason})")
```

## Device Architecture Checks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Still debating if this is the right place to include notes about it given it's supposed to be "basic" in nature. Open to suggestions.

Comment thread kernels/src/kernels/archs.py Outdated
Comment thread kernels/src/kernels/archs.py Outdated
from kernels.compat import has_torch


def _parse_cuda_arch(arch: str) -> tuple[int, int, str] | None:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could have used Regex here but since they can be fragile (and this is somewhat easy to parse deterministically, I thought this is better.

@sayakpaul
sayakpaul marked this pull request as ready for review August 18, 2026 18:08
@remi-or

remi-or commented Aug 19, 2026 •

Copy link
Copy Markdown

Awesome, thanks! Re-tried the script I attached in #707 and it adequately crashed.

Comment thread kernels/src/kernels/archs.py Outdated
Comment thread kernels/src/kernels/archs.py Outdated
Comment thread kernels/src/kernels/archs.py Outdated

# Base and family-specific builds run on capabilities of the same
# generation with the same or a newer minor version.
return major == arch_major and minor >= arch_minor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The +PTX suffix, which we support is not handled:

  • 10.0+PTX: works on any capability >= 10.0.
  • 10.0a+PTX: only works on 9.0 (but embeds PTX, pretty useless, but it is supported).
  • 10.0f+PTX: works only on 10.x where x>=0 (for explicitness). Is also useful, because the runtime can JIT-compile the PTX for optimization if the capability is e.g. 10.3.

Comment thread kernels/tests/test_archs.py Outdated

@danieldk danieldk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!

@drbh could you also do an extra check, since we are directly rolling this out to stable?

@drbh drbh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm!

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants