Skip to content

kernels: add a function system_variants#423

Merged
danieldk merged 4 commits intomainfrom
system-variants
Apr 3, 2026
Merged

kernels: add a function system_variants#423
danieldk merged 4 commits intomainfrom
system-variants

Conversation

@danieldk
Copy link
Copy Markdown
Member

@danieldk danieldk commented Apr 1, 2026

This function lists all the variants that are available on the current system.

@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.

This function lists all the variants that are available on the current
system.
sayakpaul
sayakpaul previously approved these changes Apr 1, 2026
Comment on lines +204 to +212
def possible_variants() -> list["ArchVariant"]:
frameworks: list[Torch | TvmFfi] = (
Torch.possible_variants() + TvmFfi.possible_variants()
)
archs = Arch.possible_variants()
return [
ArchVariant(framework=fw, arch=arch)
for fw, arch in itertools.product(frameworks, archs)
]
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.

This is so neat! As declarative as it gets.

system_variants,
)

VARIANT_STRINGS = (
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.

Ouf so neat!

Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks a lot for iterating on this and being patient with my suggestions on variant parsing.

@danieldk danieldk merged commit 212621c into main Apr 3, 2026
41 checks passed
@danieldk danieldk deleted the system-variants branch April 3, 2026 17:59
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.

3 participants