You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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”).
Copy file name to clipboardExpand all lines: kernel-builder.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ In this guide we'll show you how to build a complete, modern CUDA kernel from th
16
16
17
17
## What You’ll Learn
18
18
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:
20
20
21
21
```python
22
22
import torch
@@ -192,7 +192,7 @@ This approach is crucial for two main reasons:
192
192
193
193
**Setting up the `__init__.py` wrapper**
194
194
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.
196
196
197
197
> [!NOTE]
198
198
> 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"
372
372
git push -u origin main
373
373
```
374
374
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).
376
376
377
377
### Step 8: Loading and Testing Your Custom Op
378
378
@@ -428,14 +428,14 @@ from kernels import get_kernel
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`:
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`:
439
439
440
440
```python
441
441
from kernels import get_kernel
@@ -540,4 +540,4 @@ This guide has walked you through the entire lifecycle of a production-ready CUD
540
540
541
541
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.
0 commit comments