Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
group: ${{ matrix.runner }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
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.

Good catch!

Copy link
Copy Markdown

@H1235515648 H1235515648 Apr 17, 2026

Choose a reason for hiding this comment

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

1.hsk hhhs 😂

with:
extra-conf: |
max-jobs = 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_kernel_rocm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
group: aws-highmemory-32-plus-nix
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
max-jobs = 4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_kernel_xpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
group: aws-highmemory-32-plus-nix
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
max-jobs = 4
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/nix_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Nix checks"
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
workflow_dispatch:

jobs:
build:
name: Nix checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
max-jobs = 4
cores = 12
sandbox-fallback = false
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
with:
name: huggingface
env:
USER: runner
- name: Check formatting
run: nix fmt -- --ci
- name: Nix checks
run: nix build .\#checks.x86_64-linux.default
- name: Test kernel card generation
run: |
(
cd examples/kernels/silu-and-mul
nix build -L .
test -e result/CARD.md
)
Comment on lines +29 to +37
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.

Hmm, do we need to trigger an entire build to check for the card stuff? Seems like an overkill to me 👀

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.

Or I guess it's simple and doesn't cost much?

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.

Yeah, it's a noarch kernel, so cheap. We need to do a bundle build to generate the card.

22 changes: 0 additions & 22 deletions .github/workflows/nix_fmt.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
variant: ${{ steps.variant.outputs.name }}
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
max-jobs = 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_extra_commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
max-jobs = 4
Expand Down
48 changes: 48 additions & 0 deletions examples/kernels/cutlass-gemm-tvm-ffi/CARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
library_name: kernels
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.

Auto-generated? 👀

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.

Not sure? This comes from the template that init uses:

https://github.com/huggingface/kernels/blob/main/kernel-builder/src/init/templates/CARD.md?plain=1

I have no idea where it comes from, maybe @drbh ?

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.

yea, added because I was using the output from the previous ModelCardData output which included the library name field

that being said its not fully clear if we need it since its really a model loading concept... maybe we can remove (no strong preference)

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.

I'll leave that to a separate PR. No preference either.

{% if license %}license: {{ license }}
{% endif %}---

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](https://github.com/huggingface/kernels). This card was automatically generated.

## How to use
{% if functions %}

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

kernel_module = get_kernel("{{ repo_id }}")
{{ functions[0] }} = kernel_module.{{ functions[0] }}

{{ functions[0] }}(...)
```
{% else %}

Usage example not available.
{% endif %}

## Available functions
{% if functions %}
{% for func in functions %}
- `{{ func }}`
{% endfor %}
{% else %}

Function list not available.
{% endif %}

## Benchmarks
{% if has_benchmark %}

Benchmarking script is available for this kernel. Run `kernels benchmark {{ repo_id }}`.
{% else %}

No benchmark available yet.
{% endif %}
{% if upstream %}

## Source code

Source code of this kernel originally comes from {{ upstream }} and it was repurposed for compatibility with `kernels`.
{% endif %}
3 changes: 3 additions & 0 deletions examples/kernels/cutlass-gemm-tvm-ffi/build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ backends = [
"xpu",
]

[general.hub]
repo-id = "kernels-test/cutlass-gemm-tvm-ffi"
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.

I am guessing the token is configured to write to kernels-test too?

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 don't actually upload these. I just needed to give them an identifier. We could also consider changing these to example/<name>, though that org seems to exist:

https://huggingface.co/Example


[tvm-ffi]
src = [
"tvm-ffi-ext/tvm_ffi_binding.cpp",
Expand Down
48 changes: 48 additions & 0 deletions examples/kernels/cutlass-gemm/CARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
library_name: kernels
{% if license %}license: {{ license }}
{% endif %}---

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](https://github.com/huggingface/kernels). This card was automatically generated.

## How to use
{% if functions %}

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

kernel_module = get_kernel("{{ repo_id }}")
{{ functions[0] }} = kernel_module.{{ functions[0] }}

{{ functions[0] }}(...)
```
{% else %}

Usage example not available.
{% endif %}

## Available functions
{% if functions %}
{% for func in functions %}
- `{{ func }}`
{% endfor %}
{% else %}

Function list not available.
{% endif %}

## Benchmarks
{% if has_benchmark %}

Benchmarking script is available for this kernel. Run `kernels benchmark {{ repo_id }}`.
{% else %}

No benchmark available yet.
{% endif %}
{% if upstream %}

## Source code

Source code of this kernel originally comes from {{ upstream }} and it was repurposed for compatibility with `kernels`.
{% endif %}
4 changes: 3 additions & 1 deletion examples/kernels/cutlass-gemm/build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ backends = [
"xpu",
]

[general.hub]
repo-id = "kernels-test/cutlass-gemm"

[torch]
src = [
"torch-ext/torch_binding.cpp",
Expand All @@ -26,4 +29,3 @@ depends = [
"sycl_tla",
]
src = ["gemm_sycl.cpp"]

48 changes: 48 additions & 0 deletions examples/kernels/extra-data/CARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
library_name: kernels
{% if license %}license: {{ license }}
{% endif %}---

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](https://github.com/huggingface/kernels). This card was automatically generated.

## How to use
{% if functions %}

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

kernel_module = get_kernel("{{ repo_id }}")
{{ functions[0] }} = kernel_module.{{ functions[0] }}

{{ functions[0] }}(...)
```
{% else %}

Usage example not available.
{% endif %}

## Available functions
{% if functions %}
{% for func in functions %}
- `{{ func }}`
{% endfor %}
{% else %}

Function list not available.
{% endif %}

## Benchmarks
{% if has_benchmark %}

Benchmarking script is available for this kernel. Run `kernels benchmark {{ repo_id }}`.
{% else %}

No benchmark available yet.
{% endif %}
{% if upstream %}

## Source code

Source code of this kernel originally comes from {{ upstream }} and it was repurposed for compatibility with `kernels`.
{% endif %}
3 changes: 3 additions & 0 deletions examples/kernels/extra-data/build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ backends = [
"xpu",
]

[general.hub]
repo-id = "kernels-test/extra-data"

[torch]
src = [
"torch-ext/torch_binding.cpp",
Expand Down
48 changes: 48 additions & 0 deletions examples/kernels/relu-backprop-compile/CARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
library_name: kernels
{% if license %}license: {{ license }}
{% endif %}---

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](https://github.com/huggingface/kernels). This card was automatically generated.

## How to use
{% if functions %}

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

kernel_module = get_kernel("{{ repo_id }}")
{{ functions[0] }} = kernel_module.{{ functions[0] }}

{{ functions[0] }}(...)
```
{% else %}

Usage example not available.
{% endif %}

## Available functions
{% if functions %}
{% for func in functions %}
- `{{ func }}`
{% endfor %}
{% else %}

Function list not available.
{% endif %}

## Benchmarks
{% if has_benchmark %}

Benchmarking script is available for this kernel. Run `kernels benchmark {{ repo_id }}`.
{% else %}

No benchmark available yet.
{% endif %}
{% if upstream %}

## Source code

Source code of this kernel originally comes from {{ upstream }} and it was repurposed for compatibility with `kernels`.
{% endif %}
3 changes: 3 additions & 0 deletions examples/kernels/relu-backprop-compile/build.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ backends = [
"rocm",
]

[general.hub]
repo-id = "kernels-test/relu-backprop-compile"

[torch]
src = [
"torch-ext/torch_binding.cpp",
Expand Down
48 changes: 48 additions & 0 deletions examples/kernels/relu-compiler-flags/CARD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
library_name: kernels
{% if license %}license: {{ license }}
{% endif %}---

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](https://github.com/huggingface/kernels). This card was automatically generated.

## How to use
{% if functions %}

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

kernel_module = get_kernel("{{ repo_id }}")
{{ functions[0] }} = kernel_module.{{ functions[0] }}

{{ functions[0] }}(...)
```
{% else %}

Usage example not available.
{% endif %}

## Available functions
{% if functions %}
{% for func in functions %}
- `{{ func }}`
{% endfor %}
{% else %}

Function list not available.
{% endif %}

## Benchmarks
{% if has_benchmark %}

Benchmarking script is available for this kernel. Run `kernels benchmark {{ repo_id }}`.
{% else %}

No benchmark available yet.
{% endif %}
{% if upstream %}

## Source code

Source code of this kernel originally comes from {{ upstream }} and it was repurposed for compatibility with `kernels`.
{% endif %}
Loading
Loading