Skip to content

Comments

Kernel docs followups#287

Open
sayakpaul wants to merge 2 commits intomainfrom
kernel-docs-followups
Open

Kernel docs followups#287
sayakpaul wants to merge 2 commits intomainfrom
kernel-docs-followups

Conversation

@sayakpaul
Copy link
Member

  • Make kernel card generation a part of kernels upload (and test)
  • Add an entry for generating kernel system cards to the "writing kernels" tutorial.

@sayakpaul sayakpaul requested a review from danieldk February 17, 2026 05:32
@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.

)
if args.create_card:
if args.card_path is None:
args.card_path = str(Path(args.kernel_dir).resolve() / "README.md")
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but it would be nice to make all card paths Path and not str.

Comment on lines +112 to +116
upload_parser.add_argument(
"--create-pr",
action="store_true",
help="If set, it will create a PR on the repo-id (only used with --create-card).",
)
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this out for the upload command. Having dependent options is not nice if not needed and it's strange that the kernel upload would not generate a PR, but the card would.

Comment on lines +95 to +116
upload_parser.add_argument(
"--create-card",
action="store_true",
help="If set, a templated system card will be generated from the kernel.",
)
upload_parser.add_argument(
"--card-path",
type=str,
default=None,
help="Path to save the generated card to (only used with --create-card).",
)
upload_parser.add_argument(
"--description",
type=str,
default=None,
help="Description to introduce the kernel (only used with --create-card).",
)
upload_parser.add_argument(
"--create-pr",
action="store_true",
help="If set, it will create a PR on the repo-id (only used with --create-card).",
)
Copy link
Member

Choose a reason for hiding this comment

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

I was thinking more of just uploading the card, not creating one. E.g. if the user changed the card, it's nice that it gets uploaded as well along with the kernels. Presumably they already have created the card before. That means we have to settle on the name though, since I think on the Hub the card is always README.md and the README.md in a kernel Git repo may contain different information (more relevant to kernel developers/contributors).

So, maybe we should standardize on using CARD.md in the top-level directory of a kernel repo for the card and then kernel upload would upload it to the Hub as README.md. This is also in line with how the rest of how kernel building works - we go for very opinionated, there is only one way to do it, to enforce standardized, declarative source layouts.

I think orthogonal subcommands are the best, so ideally there would be a create-card subcommand that only creates a card. Then the upload subcommand uploads the card to the Kernel Hub along with the kernel. Maybe upload could have an --only-card option to only upload the card, but the default of kernels upload should do the right thing: upload the latest build variants and the latest card.

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