Skip to content

v0.18.0

Latest

Choose a tag to compare

@github-actions github-actions released this 28 Oct 14:10
· 0 commits to main since this release

New features

Support for TPU kernels

Building kernels for TPUs (torch_tpu/Pallas) is now supported using the tpu backend:

[general]
# ...
backends = ["tpu"]

See the relu-tpu kernel for a full example.

Torch 2.15 and support for older Torch versions

First off, this release adds initial support for Torch 2.15, including support for CUDA 13.4 and ROCm 7.14.

As kernels gets increasingly used by larger projects like Transformers, we would like to increase the number of supported Torch versions. We will reveal our support policy soon, but as a first step, we have added back support for building kernels for Torch 2.10 to 2.12.

We have also extended Torch Stable ABI handling to build non-stable ABI versions for releases that precede the targeted ABI version. For instance, if the stable ABI supports Torch >= 2.13, 2.10-2.12 will be built as regular non-stable ABI builds.

New command-line tools: kernels describe-api and kernels cache ls

The new kernels describe-api subcommand lists the functions and layers that a
kernel provides:

$ kernels describe-api sayakpaul/liger-kernels --trust-remote-code
Repository: sayakpaul/liger-kernels
Revision: v2
Variant: torch-cuda

Functions:
  LigerForCausalLMLoss
  liger_rotary_pos_emb

Layers:
  LigerRMSNorm  has_backward=unknown  can_torch_compile=unknown
  LigerSwiGLUMLP  has_backward=unknown  can_torch_compile=True
  ...

The information comes from a symbols.json that is now generated for every
kernel build.

kernels cache ls lists the kernels in your local cache, similar to hf cache ls.

$ hf cache ls
ID                                  SIZE LAST_ACCESSED  LAST_MODIFIED  VERSION VARIANTS
----------------------------------- ---- -------------- -------------- ------- --------------------------------
kernel/kernels-community/activation 2.5M 45 minutes ago 45 minutes ago v1      torch28-cxx11-cu126-x86_64-linux
                                                                               torch28-cxx11-cu128-x86_64-linux
                                                                               torch28-cxx11-cu129-x86_64-linux
kernel/kernels-community/activation 2.6M 23 minutes ago 23 minutes ago v2      torch28-cxx11-cu126-x86_64-linux
                                                                               torch28-cxx11-cu128-x86_64-linux
                                                                               torch28-cxx11-cu129-x86_64-linux

Kernel signature and digest verification

kernels now verifies kernels while they are loaded:

  • Signatures: the kernel metadata is verified using a signature and signing policy. For now, a missing or incorrect signature only
    results in a warning. Signature verification is only enabled when the optional sigstore dependency is installed.
  • Digests: kernels are verified using the digest in the metadata. Unlike signatures, a hash mismatch raises an exception.

Faster Nix evaluation

Evaluating kernel flakes got a lot faster through multiple changes:

  • We share nixpkgs between Torch versions that use the same backend version.
  • We avoid a per-Torch version Python package overlay.
  • We avoid evaluating the Haskell package set (through pandoc).

On the ReLU example kernel, these changes cut down evaluation time from 42.6s to 22.2s. However, more importantly, the improved sharing makes evaluation time grow linearly onlywith the number of backend versions and not the number of Torch/backend version combinations.

API changes

  • kernels versions is deprecated in favor of kernels variants. This subcommand lists the variants of a kernel and which of them are compatible with and preferred for your machine. It supports --only-compatible, --all-versions, --version, and --json.
  • build.toml edition 6: the backend kernel option is replaced by language, which takes <language>-<backend> (cpp-cpu, cpp-cuda, cpp-metal, cpp-rocm, cpp-xpu, or rust-cpu). For instance, backend = "cuda" becomes language = "cpp-cuda". This is a breaking change: build.toml files with an older edition can be migrated with kernel-builder update-build.

Documentation improvements

What's Changed

  • kernels-common: add HFKernelsClientBuilder by @danieldk in #822
  • kernels: use Oid throughout kernels by @danieldk in #827
  • Key the doc build concurrency group on the pull request number by @albertvillanova in #824
  • CI: Fix E2E test by @danieldk in #820
  • Set the version to 0.18.0.dev0 by @danieldk in #825
  • Fix egg_info.writers entry point module path by @jiqing-feng in #829
  • nix-builder: update nixpkgs, bumps Python from 3.13 to 3.14 by @danieldk in #831
  • nix-builder: experimental support for CUDA 13.4 by @danieldk in #832
  • kernels: verify the signature of a kernel while loading by @danieldk in #828
  • [docs] add latest learnings from version bumps and test module by @sayakpaul in #837
  • kernel-builder: add gfx11{02,03,50,51} ROCm archs by @danieldk in #839
  • nix-builder: we don't need to filter -mtls-dialect on ROCM >= 7.14 by @danieldk in #840
  • Scope GITHUB_TOKEN permissions per job by @hf-security-analysis[bot] in #841
  • Pass workflow expressions through the environment by @hf-security-analysis[bot] in #843
  • nix-builder: cut down eval time by 31.5% by @danieldk in #845
  • feat: experimental kernel porting tool by @drbh in #776
  • build(deps): bump the actions group across 1 directory with 9 updates by @dependabot[bot] in #835
  • kernel-abi-check: refresh vendored ABI symbol files by @hf-kernels-bot[bot] in #855
  • nix-builder: add support for Torch 2.10-2.12 for Metal by @danieldk in #851
  • flake: fix devshell on macOS by @danieldk in #852
  • ci: build and push to cache and Darwin by @danieldk in #857
  • ci: fix Darwin cache build by @danieldk in #858
  • feat: exclude private modules from card. by @sayakpaul in #860
  • {kernel,nix}-builder: remove the cxx11 ABI tag from Linux builds by @danieldk in #856
  • ci: make the E2E test more reliable by @danieldk in #863
  • Build non-stable ABI kernels when stable-abi > 2.10 by @danieldk in #862
  • docs: add security discussion of kernels by @danieldk in #842
  • kernel-builder: fix warning about missing project name by @danieldk in #864
  • Fix fetch build fallback by @SunMarc in #848
  • nix-builder: rebuild the Rust binding in when entering the devshell by @danieldk in #867
  • nix-builder: avoid rebuilds of Rust crates better by @danieldk in #866
  • feat: introduce kernels variants by @sayakpaul in #865
  • kernel-builder: quote the stable ABI version in the preamble by @danieldk in #869
  • feat: add version 6 config by @drbh in #870
  • feat: rust cpu support in v6 by @drbh in #871
  • nix-builder: share nixpkgs between build sets with equal backend versions by @danieldk in #882
  • Bump doc-builder workflow pin by @paulinebm in #879
  • feat: add machine readability to kernels variants by @sayakpaul in #880
  • [Func] Allow proper preservations/reference across copy and pickle by @vasqu in #873
  • nix-builder: small dev shell improvements by @danieldk in #883
  • [DOCs]: Enhancements to Quickstart by @ariG23498 in #874
  • nix-builder: improve eval speed by avoiding Python overlay by @danieldk in #884
  • nix-builder: remove Torch from the closure of TVM-FFI kernels by @danieldk in #885
  • kernel-builder: Python script to generate symbols in __all__ by @sayakpaul in #878
  • kernels: update uv.lock by @danieldk in #853
  • fix: detect TPU with torch.accelerator.current_accelerator() by @tengomucho in #888
  • docs: tighten up the wording around kernel identifiers by @danieldk in #891
  • kernel-builder: modify readme. by @sayakpaul in #889
  • nix-builder: wire up generate-symbols in the build by @danieldk in #894
  • nix-builder: add tvm-ffi support for ROCm by @danieldk in #887
  • feat: improve test kernel loading by @drbh in #877
  • kernel-abi-check: refresh vendored ABI symbol files by @hf-kernels-bot[bot] in #896
  • Cookbook: Using Layers by @ariG23498 in #893
  • nix-builder: add support for Torch 2.15.0 RC3 by @danieldk in #897
  • vouch aritra. by @sayakpaul in #899
  • [Func] Fix more complex global/compile regions by @vasqu in #903
  • nix-builder: always pass GPU_LANG to CMake by @danieldk in #901
  • kernels: describe-api for enlisting functions and layers. by @sayakpaul in #900
  • ROCm fixes for Torch 2.15 by @danieldk in #902
  • nix-builder: add back Torch 2.10-2.12 for CUDA by @danieldk in #904
  • Add back Torch 2.10-2.12 for CPU/ROCm by @danieldk in #908
  • kernels: do not reload kernel with the same ID by @danieldk in #892
  • kernel-abi-check: refresh vendored ABI symbol files by @hf-kernels-bot[bot] in #910
  • Add torch-stable-abi-shim by @danieldk in #915
  • nix-builder: fully enable TPU support by @danieldk in #917
  • Security bumps (eMudhra compromise) by @danieldk in #918
  • [DOCS] Adding the layers cookbook to various parts of our documentation by @ariG23498 in #898
  • nix-builder: override cacert to remove compromised eMudhra intermediates by @danieldk in #919
  • kernels: remove use_layers.md by @sayakpaul in #922
  • python3Packages.torch: 2.15.0-rc3 -> 2.15.0-rc5 by @danieldk in #911
  • Add initial AGENTS.md by @danieldk in #929
  • kernels: remove -cxx11 tag from test that expected it by @danieldk in #924
  • Support developer-specific agent instructions by @danieldk in #933
  • kernels: add a function to get all kernelized layers in a model by @danieldk in #931
  • kernels: split out digest validation validation and raise on two different kernels with the same ID by @danieldk in #895
  • nix-builder: bump nixpkgs and remove cacert overrides by @danieldk in #923
  • Fix XPU flash-attention performance on DPC++ 2026.1 by @jiqing-feng in #921
  • ci: cache devshells by @danieldk in #934
  • kernel-abi-check: refresh vendored ABI symbol files by @hf-kernels-bot[bot] in #936
  • ci: force reinstall so that the requested cuda tag wheel is installed. by @sayakpaul in #935
  • [docs] Fix links in triton-autotune documentation by @sayakpaul in #937
  • python-wheel-deps-check-hook: update for future changes in packaging by @danieldk in #938
  • kernels: fix malformed user-agent string when telemetry is disabled by @danieldk in #939
  • kernels: implement kernels cache ls by @sayakpaul in #932
  • kernels: fix device name lookup in collect_machine_info by @danieldk in #940
  • kernels: do not cache device capability in DeviceRepos by @danieldk in #941
  • docs: steer users towards using layer decoration as opposed to function decoration by @sayakpaul in #943
  • kernels: add a test for get_file for RemoteKernel. by @sayakpaul in #944
  • [docs] kernels: fix autotuning docs for triton. by @sayakpaul in #945
  • feat: trust kernels signed by kernels-community-rs by @drbh in #942

New Contributors

Full Changelog: v0.17.0...v0.18.0