Skip to content

Commit 5c835e1

Browse files
authored
kernels: remove the version warning until we have the Hub UX (#234)
Also extend the documentation a bit on versioning.
1 parent 4545dca commit 5c835e1

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

docs/source/basic-usage.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ get the latest kernel build from the `v1` branch.
2828
Kernels within a version branch must never break the API or remove builds
2929
for older PyTorch versions. This ensures that your code will continue to work.
3030

31+
Some kernels have not yet been updated to use versioning yet. In these cases,
32+
you can use `get_kernel` without the `version` argument.
33+
3134
## Checking Kernel Availability
3235

3336
You can check if a particular version of a kernel supports the environment

docs/source/layers.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,18 @@ kernel_layer_mapping = {
170170
}
171171
```
172172

173-
You can register such a mapping using `register_kernel_mapping`:
173+
This uses version `1` of the `SiluAndMul` kernel layer from
174+
`kernels-community/activation` for the `cuda` and `rocm` backends. Kernel
175+
layers are versioned using a major version number. Using `version=1`
176+
will get the latest kernel build from the `v1` branch. Kernel layers
177+
within a version branch must never break the API or remove builds for
178+
older PyTorch versions. This ensures that your code will continue to
179+
work.
180+
181+
Some kernels have not yet been updated to use versioning yet. In these cases,
182+
you can use `LayerRepository` without the `version` argument.
183+
184+
You can register a mapping, like the one above, using `register_kernel_mapping`:
174185

175186
```python
176187
register_kernel_mapping(kernel_layer_mapping)

kernels/src/kernels/_versions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ def select_revision_or_version(
8484
elif version is not None:
8585
return resolve_version_spec_as_ref(repo_id, version).target_commit
8686

87-
warnings.warn(
88-
"Future versions of `kernels` (>=0.14) will require specifying a kernel version or revision."
89-
"See: https://huggingface.co/docs/kernels/migration"
90-
)
87+
# Re-enable once we have proper UX on the hub for showing the
88+
# kernel versions.
89+
#
90+
# warnings.warn(
91+
# "Future versions of `kernels` (>=0.14) will require specifying a kernel version or revision."
92+
# "See: https://huggingface.co/docs/kernels/migration"
93+
# )
9194

9295
return "main"

0 commit comments

Comments
 (0)