Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ get the latest kernel build from the `v1` branch.
Kernels within a version branch must never break the API or remove builds
for older PyTorch versions. This ensures that your code will continue to work.

Some kernels have not yet been updated to use versioning yet. In these cases,
you can use `get_kernel` without the `version` argument.

## Checking Kernel Availability

You can check if a particular version of a kernel supports the environment
Expand Down
13 changes: 12 additions & 1 deletion docs/source/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,18 @@ kernel_layer_mapping = {
}
```

You can register such a mapping using `register_kernel_mapping`:
This uses version `1` of the `SiluAndMul` kernel layer from
`kernels-community/activation` for the `cuda` and `rocm` backends. Kernel
layers are versioned using a major version number. Using `version=1`
will get the latest kernel build from the `v1` branch. Kernel layers
within a version branch must never break the API or remove builds for
older PyTorch versions. This ensures that your code will continue to
work.

Some kernels have not yet been updated to use versioning yet. In these cases,
you can use `LayerRepository` without the `version` argument.

You can register a mapping, like the one above, using `register_kernel_mapping`:

```python
register_kernel_mapping(kernel_layer_mapping)
Expand Down
11 changes: 7 additions & 4 deletions kernels/src/kernels/_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ def select_revision_or_version(
elif version is not None:
return resolve_version_spec_as_ref(repo_id, version).target_commit

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

return "main"
Loading