Kernels documentation

kernels describe-api

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.17.2).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

kernels describe-api

Use kernels describe-api to list a kernel’s public functions and layers from the symbols.json generated at build time.

For Hub kernels, the resolver selects the matching build variant and downloads only metadata.json and symbols.json. Kernel source files and binaries are not downloaded or imported.

Online Hub inspection requires a trusted kernel publisher by default. Pass --trust-remote-code to explicitly allow a kernel from another publisher.

Usage

kernels describe-api <repo_id_or_path>

The local path can point to a kernel repository containing build/, the build/ directory itself, or an individual build variant containing metadata.json and symbols.json.

Options:

  • --revision <revision>: inspect a specific branch, tag, or commit (Hub only).
  • --version <version>: inspect a specific integer kernel version (Hub only). Cannot be combined with --revision. By default, the latest numbered version is used. Repositories without numbered versions require an explicit --revision.
  • --json: print the full symbol data, including signatures, docstrings, layer attributes, and the selected source and variant, as JSON.
  • --trust-remote-code: allow kernels from untrusted publishers (Hub only). Disabled by default.

Examples

kernels describe-api kernels-community/liger-kernels
kernels describe-api kernels-community/liger-kernels --version 2
kernels describe-api kernels-community/liger-kernels --revision main --json
kernels describe-api sayakpaul/liger-kernels --trust-remote-code
kernels describe-api ./liger-kernels
kernels describe-api ./liger-kernels/build/torch-cuda

Example output

Repository: kernels-community/liger-kernels
Revision: v2
Variant: torch-cuda

Functions:
  LigerForCausalLMLoss
  liger_rotary_pos_emb

Layers:
  LigerRMSNorm  has_backward=unknown  can_torch_compile=unknown
  LigerLinear  has_backward=unknown  can_torch_compile=True
  LigerSwiGLUMLP  has_backward=unknown  can_torch_compile=True
  LigerGEGLUMLP  has_backward=unknown  can_torch_compile=True
  LigerTiledSwiGLUMLP  has_backward=unknown  can_torch_compile=True
  LigerTiledGEGLUMLP  has_backward=unknown  can_torch_compile=True

Functions are the public exports in the kernel’s top-level __all__; layers are the public classes in layers.__all__. The generator excludes private and testing-only symbols. Layer attributes recorded as null are displayed as unknown. Empty groups are displayed as (none).

For kernel metadata, use kernels info. For available build variants, use kernels variants.

Update on GitHub