Skip to content

Commit 8af440b

Browse files
fix(docs): correct grammar, clarity, and typos in CUDA kernels guide (#3033)
- Add “like this:” to the sample usage lead-in (“use your kernels directly from the hub, like this:”). - Remove extra “the” before `torch-ext/img2gray/` in the package init sentence. - Rephrase “recommend to use” → “recommend using” (semantic versioning section). - Fix off-by-version example: use “at least 1.1.2” (was 1.2.1) to match text/code. - Correct possessive: “it’s” → “its” (“all of its build variants”).
1 parent ed7307e commit 8af440b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel-builder.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In this guide we'll show you how to build a complete, modern CUDA kernel from th
1616

1717
## What You’ll Learn
1818

19-
When you're done, other developers will be able to use your kernels directly from the hub like
19+
When you're done, other developers will be able to use your kernels directly from the hub like this:
2020

2121
```python
2222
import torch
@@ -192,7 +192,7 @@ This approach is crucial for two main reasons:
192192

193193
**Setting up the `__init__.py` wrapper**
194194

195-
In the `torch-ext/img2gray/` we need an `__init__.py` file to make this directory a Python package and to expose our custom operator in a user-friendly way.
195+
In `torch-ext/img2gray/` we need an `__init__.py` file to make this directory a Python package and to expose our custom operator in a user-friendly way.
196196

197197
> [!NOTE]
198198
> The `_ops` module is auto-generated by kernel-builder from a [template](https://github.com/huggingface/kernel-builder/blob/main/build2cmake/src/templates/_ops.py) to provide a standard namespace for your registered C++ functions.
@@ -372,7 +372,7 @@ git commit -m "feat: Created a compliant img2gray kernel"
372372
git push -u origin main
373373
```
374374

375-
Fantastic! Your kernel is now on the Hugging Face Hub, ready for others to use and fully compliant with the `kernels` library. Our kernel and all of it's build variants are now available at [drbh/img2gray](https://huggingface.co/drbh/img2gray/tree/main/build).
375+
Fantastic! Your kernel is now on the Hugging Face Hub, ready for others to use and fully compliant with the `kernels` library. Our kernel and all of its build variants are now available at [drbh/img2gray](https://huggingface.co/drbh/img2gray/tree/main/build).
376376

377377
### Step 8: Loading and Testing Your Custom Op
378378

@@ -428,14 +428,14 @@ from kernels import get_kernel
428428
img2gray_lib = get_kernel("drbh/img2gray", revision="4148918")
429429
```
430430

431-
Using a Git shorthash will reduce the chance of breakage; however, it is hard to interpret and does not allow graceful upgrades within a version range. We therefore recommend to use the familiar [semantic versioning](https://semver.org/) system for Hub kernels. Adding a version to a kernel is easy: you simply add a Git tag of the form `vx.y.z` where _x.y.z_ is the version. For instance, if the current version of the kernel is 1.1.2, you can tag it as `v1.1.2`. You can then get that version with `get_kernel`:
431+
Using a Git shorthash will reduce the chance of breakage; however, it is hard to interpret and does not allow graceful upgrades within a version range. We therefore recommend using the familiar [semantic versioning](https://semver.org/) system for Hub kernels. Adding a version to a kernel is easy: you simply add a Git tag of the form `vx.y.z` where _x.y.z_ is the version. For instance, if the current version of the kernel is 1.1.2, you can tag it as `v1.1.2`. You can then get that version with `get_kernel`:
432432

433433
```python
434434
from kernels import get_kernel
435435
img2gray_lib = get_kernel("drbh/img2gray", revision="v1.1.2")
436436
```
437437

438-
Versioning becomes even more powerful with version bounds. In semantic versioning, the version `1.y.z`, must not have backward-incompatible changes in the public API for each succeeding `x` and `y`. So, if the kernel's version was `1.1.2` at the time of writing your code, you can ask the version to be at least `1.2.1`, but less than `2.0.0`:
438+
Versioning becomes even more powerful with version bounds. In semantic versioning, the version `1.y.z`, must not have backward-incompatible changes in the public API for each succeeding `x` and `y`. So, if the kernel's version was `1.1.2` at the time of writing your code, you can ask the version to be at least `1.1.2`, but less than `2.0.0`:
439439

440440
```python
441441
from kernels import get_kernel
@@ -540,4 +540,4 @@ This guide has walked you through the entire lifecycle of a production-ready CUD
540540

541541
We believe that open and collaborative development is the key to innovation. Now that you have the tools and knowledge to build your own high-performance kernels, we're excited to see what you create! We warmly invite you to share your work, ask questions, and start discussions on the [Kernel Hub](https://huggingface.co/kernels-community) or in our [kernel-builder GitHub repository](https://github.com/huggingface/kernel-builder) and [kernels GitHub repository](https://github.com/huggingface/kernels). Whether you’re a seasoned developer or just starting out, the community is here to support you.
542542

543-
Let's get building! 🚀
543+
Let's get building! 🚀

0 commit comments

Comments
 (0)