Skip to content

Conversation

@sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Jan 14, 2026

As discussed internally, this PR adds utilities to easily generate template repository cards for the kernels built with kernels and kernel-builder.

For now, the repository card contains basic info, which IMO, is sufficient for a v1. But of course, feedback is welcome.

If we run

python example_usage.py --kernels_dir /fsx/sayak/kernels-community/activation --card_path activation.md

We should expect to get an activation.md, looking like so:

Unfold

library_name: kernels
license: apache-2.0

This is the repository card of {repo_id} that has been pushed on the Hub. It was built to be used with the kernels library. This card was automatically generated.

How to use

# make sure `kernels` is installed: `pip install -U kernels`
from kernels import get_kernel

kernel_module = get_kernel("REPO_ID") # <- change the ID if needed
silu_and_mul = kernel_module.silu_and_mul

silu_and_mul(...)

Benchmarks

[TODO: provide benchmarks if available]

Code source

[TODO: provide original code source and other relevant citations if available]

Notes

[TODO: provide additional notes about this kernel if needed]

On the Hub, this would preview much better, of course. You can preview here.

TODOs

  • Tests
  • Remove the example_usage.py script
  • Discuss how this should be integrated in the build workflow (or any other workflow for that matter)

From Slack

We could have an upload-card subcommand (or even make it part of upload) that uploads the card to main on the Hub.

I agree to this. I will work on it in this PR later.

@danieldk @drbh the above are some TODOs that came to mind, but the list isn't limited to that. Would love an initial review of this draft and address anything.

@sayakpaul sayakpaul requested review from danieldk and drbh January 14, 2026 06:00
@HuggingFaceDocBuilderDev

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.

Comment on lines +106 to +107
except Exception:
return None
Copy link
Member Author

Choose a reason for hiding this comment

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

Can raise here instead as well.

Copy link
Member

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Awesome! Small comment on the __init__ parsing.

@sayakpaul
Copy link
Member Author

@danieldk

I have addressed #210 (comment). Additionally, I have added support to log "Supported backends" and "Supported CUDA backends" when they are available through build.toml.

Example: https://huggingface.co/sayakpaul/example-kernels-repocard

LMK your thoughts and I will start addressing the rest of the stuff.

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.

4 participants