-
Notifications
You must be signed in to change notification settings - Fork 81
Move card filling to Nix #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 👀
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or I guess it's simple and doesn't cost much?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| library_name: kernels | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auto-generated? 👀
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure? This comes from the template that 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 ?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea, added because I was using the output from the previous 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)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,9 @@ backends = [ | |
| "xpu", | ||
| ] | ||
|
|
||
| [general.hub] | ||
| repo-id = "kernels-test/cutlass-gemm-tvm-ffi" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am guessing the token is configured to write to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| [tvm-ffi] | ||
| src = [ | ||
| "tvm-ffi-ext/tvm_ffi_binding.cpp", | ||
|
|
||
| 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 %} |
| 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 %} |
| 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 %} |
| 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 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.hsk hhhs 😂