Skip to content

Commit 2ad7c76

Browse files
drbhdanieldk
authored andcommitted
fix: update relative paths and readme cleanups (#240)
1 parent 30685a7 commit 2ad7c76

5 files changed

Lines changed: 21 additions & 25 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# kernels
22

33
<div align="center">
4-
<img src="https://github.com/user-attachments/assets/64a652f3-0cd3-4829-b3c1-df13f7933569" width="450" height="450" alt="kernel-builder logo">
4+
<img src="https://github.com/user-attachments/assets/4b5175f3-1d60-455b-8664-43b2495ee1c3" width="450" height="450" alt="kernel-builder logo">
55
<p align="center">
66
<a href="https://pypi.org/project/kernels"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/kernels"></a>
77
<a href="https://github.com/huggingface/kernels/tags"><img alt="GitHub tag" src="https://img.shields.io/github/v/tag/huggingface/kernels"></a>
8-
<a href="https://github.com/huggingface/kernels/actions/workflows/docker-build-push.yaml"><img alt="Test kernels" src="https://img.shields.io/github/actions/workflow/status/huggingface/kernels/test.yml?label=test"></a>
8+
<a href="https://github.com/huggingface/kernels/actions/workflows/test_kernels.yaml"><img alt="Test kernels" src="https://img.shields.io/github/actions/workflow/status/huggingface/kernels/test_kernels.yaml?label=test"></a>
99

1010
</p>
1111
</div>

builder/README.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# kernel-builder
22

3-
<div align="center">
4-
<img src="https://github.com/user-attachments/assets/4b5175f3-1d60-455b-8664-43b2495ee1c3" width="450" height="450" alt="kernel-builder logo">
5-
<p align="center">
6-
<a href="https://github.com/huggingface/kernel-builder/actions/workflows/docker-build-push.yaml"><img alt="Build and Push Docker Image" src="https://img.shields.io/github/actions/workflow/status/huggingface/kernel-builder/docker-build-push.yaml?label=docker"></a>
7-
<a href="https://github.com/huggingface/kernel-builder/tags"><img alt="GitHub tag" src="https://img.shields.io/github/v/tag/huggingface/kernel-builder"></a>
8-
<a href="https://github.com/huggingface/kernel-builder/pkgs/container/kernel-builder"><img alt="GitHub package" src="https://img.shields.io/badge/container-ghcr.io-blue"></a>
9-
</p>
10-
</div>
11-
<hr/>
3+
The kernel-builder is a build system for creating Hub-compatible compute kernels. It handles the complexity of building kernels that are:
4+
5+
- Portable: kernels can be loaded from paths outside `PYTHONPATH`.
6+
- Unique: multiple versions of the same kernel can be loaded in the same Python process.
7+
- Compatible: kernels support all recent versions of Python and the different PyTorch build configurations (various CUDA versions and C++ ABIs).
128

139
**Note:** Torch 2.10 builds are still based on PyTorch release candidates.
1410
Typically the ABI does not break during release candidates. If it does,
@@ -70,14 +66,14 @@ See [dockerfiles/README.md](./dockerfiles/README.md) for more options, including
7066

7167
# 📚 Documentation
7268

73-
- [Writing Hub kernels](./docs/writing-kernels.md)
74-
- [Building kernels with Nix](./docs/nix.md)
69+
- [Writing Hub kernels](../docs/source/builder/writing-kernels.md)
70+
- [Building kernels with Nix](../docs/source/builder/nix.md)
7571
- Framework-specific notes:
76-
- [Metal](docs/metal.md)
77-
- [Building kernels with Docker](./docs/docker.md) (for systems without Nix)
78-
- [Local kernel development](docs/local-dev.md) (IDE integration)
79-
- [Kernel security](./docs/security.md)
80-
- [Why Nix?](./docs/why-nix.md)
72+
- [Metal](../docs/source/builder/metal.md)
73+
- [Building kernels with Docker](../docs/source/builder/docker.md) (for systems without Nix)
74+
- [Local kernel development](../docs/source/builder/local-dev.md) (IDE integration)
75+
- [Kernel security](../docs/source/builder/security.md)
76+
- [Why Nix?](../docs/source/builder/why-nix.md)
8177

8278
## Credits
8379

docs/source/builder/local-dev.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ $ pip install --no-build-isolation -e .
4646
**Warnings:**
4747

4848
- Kernels built in this way should **not** be published on the Kernel
49-
Hub. They do not fulfill the [kernel requirements](https://github.com/huggingface/kernels/blob/main/docs/kernel-requirements.md).
49+
Hub. They do not fulfill the [kernel requirements](../kernel-requirements.md).
5050
- Do not add the generated files to Git. `build2cmake` has regular updates
5151
and you generally want to use files generated by the latest version.

docs/source/builder/nix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We recommend installing Nix in the following way:
1212

1313
The easiest way get all the Nix functionality is by putting a
1414
`flake.nix` in your kernel repository. To do so, copy
15-
[`examples/relu/flake.nix`](../examples/relu/flake.nix) into the
15+
[`examples/relu/flake.nix`](https://github.com/huggingface/kernels/blob/main/builder/examples/relu/flake.nix) into the
1616
same directory as your `build.toml` file. Then run `nix flake update`.
1717
This generates a `flake.lock` file that pins the kernel builder
1818
and _all_ its transitive dependencies. Commit both `flake.nix`

docs/source/builder/writing-kernels.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ of CMake or setuptools.
3030

3131
This page describes the directory layout of a kernel-builder project, the
3232
format of the `build.toml` file, and some additional Python glue that
33-
`kernel-builder` provides. We will use a [simple ReLU kernel](../examples/relu)
33+
`kernel-builder` provides. We will use a [simple ReLU kernel](https://github.com/huggingface/kernels/tree/main/builder/examples/relu)
3434
as the running example. After reading this page, you may also want to have
35-
a look at the more realistic [ReLU kernel with backprop and `torch.compile`](../examples/relu-backprop-compile)
35+
a look at the more realistic [ReLU kernel with backprop and `torch.compile`](https://github.com/huggingface/kernels/tree/main/builder/examples/relu-backprop-compile)
3636
support.
3737

3838
## Kernel project layout
@@ -107,12 +107,12 @@ depends = [ "torch" ]
107107

108108
- `maxver`: the maximum CUDA toolkit version (inclusive). This option
109109
_must not_ be set under normal circumstances, since it can exclude Torch
110-
build variants that are [required for compliant kernels](https://github.com/huggingface/kernels/blob/main/docs/kernel-requirements.md).
110+
build variants that are [required for compliant kernels](../kernel-requirements.md).
111111
This option is provided for kernels that cause compiler errors on
112112
newer CUDA toolkit versions.
113113
- `minver`: the minimum required CUDA toolkit version. This option
114114
_must not_ be set under normal circumstances, since it can exclude Torch
115-
build variants that are [required for compliant kernels](https://github.com/huggingface/kernels/blob/main/docs/kernel-requirements.md).
115+
build variants that are [required for compliant kernels](../kernel-requirements.md).
116116
This option is provided for kernels that require functionality only
117117
provided by newer CUDA toolkits.
118118

@@ -145,7 +145,7 @@ The following options can be set for a kernel:
145145
supported backends are `cpu`, `cuda`, `metal`, `rocm`, and `xpu`.
146146
**The `cpu` backend is currently experimental and might still change.**
147147
- `depends` (required): a list of dependencies. The supported dependencies
148-
are listed in [`deps.nix`](../lib/deps.nix).
148+
are listed in [`deps.nix`](https://github.com/huggingface/kernels/blob/main/builder/lib/deps.nix).
149149
- `src` (required): a list of source files and headers.
150150
- `include` (optional): include directories relative to the project root.
151151
Default: `[]`.

0 commit comments

Comments
 (0)