Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion docs/source/builder/agents-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ version = 1
src = ["torch-ext/torch_binding.cpp"]

[kernel.rmsnorm]
backend = "cuda"
language = "cpp-cuda"
src = ["kernel_src/rmsnorm.cu"]
depends = ["torch"]
cuda-capabilities = ["9.0"] # H100
Expand Down
2 changes: 1 addition & 1 deletion docs/source/builder/triton-autotune.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ files are picked up from the kenel's Python source directory, so add `json` to t
[general]
name = "gemm-triton-autotune"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = ["cuda", "rocm", "xpu"]

Expand Down
11 changes: 6 additions & 5 deletions docs/source/builder/writing-kernels.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ backends = [
]
name = "mykernel"
version = 1
edition = 5
edition = 6

[general.hub]
repo-id = "myorg/mykernel"
Expand All @@ -179,7 +179,7 @@ src = [
]

[kernel.mykernel]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
src = ["mykernel_cuda/mykernel.cu"]
# If the kernel is only supported on specific capabilities, set the
Expand All @@ -199,7 +199,7 @@ The following sections enumerate all supported options for `build.toml`.
by the `kernel-builder upload` command to upload the kernel to a version
branch named `v<version>`.
- `edition` (required): the `build.toml` format edition. The current
edition is `5`. Older `build.toml` files can be migrated with
edition is `6`. Older `build.toml` files can be migrated with
`kernel-builder update-build`.
- `backends` (required): a list of supported backends. Must be one or
more of `cpu`, `cuda`, `metal`, `rocm`, or `xpu`.
Expand Down Expand Up @@ -316,8 +316,9 @@ for an example with multiple kernel sections.

The following options can be set for a kernel:

- `backend` (required): the compute backend of the kernel. The currently
supported backends are `cpu`, `cuda`, `metal`, `rocm`, and `xpu`.
- `language` (required): the language and compute backend of the kernel,
as `<language>-<backend>`. The currently supported values are `cpp-cpu`,
`cpp-cuda`, `cpp-metal`, `cpp-rocm`, and `cpp-xpu`.
**The `cpu` backend is currently experimental and might still change.**
- `depends` (required): a list of dependencies. The supported dependencies
are listed in [`cpp-deps.nix`](https://github.com/huggingface/kernels/blob/main/builder/lib/cpp-deps.nix).
Expand Down
4 changes: 2 additions & 2 deletions examples/kernels/cpp20-symbols/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "cpp20-symbols"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = ["cpu"]

Expand All @@ -15,6 +15,6 @@ src = [
]

[kernel.cpp20_symbols_cpu]
backend = "cpu"
language = "cpp-cpu"
depends = ["torch"]
src = ["cpu/cpu.cpp"]
6 changes: 3 additions & 3 deletions examples/kernels/cutlass-gemm-tvm-ffi/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "cutlass-gemm-tvm-ffi"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -15,15 +15,15 @@ repo-id = "kernels-test/cutlass-gemm-tvm-ffi"
src = ["tvm-ffi-ext/tvm_ffi_binding.cpp"]

[kernel.gemm]
backend = "cuda"
language = "cpp-cuda"
depends = ["cutlass_3_6"]
src = [
"gemm.cu",
"util.hh",
]

[kernel.gemm_xpu]
backend = "xpu"
language = "cpp-xpu"
depends = ["sycl_tla"]
src = [
"gemm_sycl.cpp",
Expand Down
6 changes: 3 additions & 3 deletions examples/kernels/cutlass-gemm/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "cutlass-gemm"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -18,15 +18,15 @@ src = [
]

[kernel.gemm_xpu]
backend = "xpu"
language = "cpp-xpu"
depends = [
"torch",
"sycl_tla",
]
src = ["gemm_sycl.cpp"]

[kernel.gemm]
backend = "cuda"
language = "cpp-cuda"
depends = [
"torch",
"cutlass_3_6",
Expand Down
2 changes: 1 addition & 1 deletion examples/kernels/gemm-triton-autotune/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "gemm-triton-autotune"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand Down
2 changes: 1 addition & 1 deletion examples/kernels/kernel-deps/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "kernel-deps"
version = 1
edition = 5
edition = 6
license = "apache-2.0"
backends = [
"cpu",
Expand Down
5 changes: 3 additions & 2 deletions examples/kernels/relu-archs-subset/build.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[general]
name = "relu-archs-subset"
version = 1
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -23,7 +24,7 @@ src = [
# supported sets.

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx90a",
Expand All @@ -34,7 +35,7 @@ rocm-archs = [
src = ["relu_cuda/relu.cu"]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
cuda-capabilities = [
"5.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/kernels/relu-backprop-compile/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-backprop-compile"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -18,12 +18,12 @@ src = [
]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
src = ["relu_cuda/relu.cu"]

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx906",
Expand Down
8 changes: 4 additions & 4 deletions examples/kernels/relu-compiler-flags/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-compiler-flags"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -20,19 +20,19 @@ src = [
cxx-flags = ["-DCANARY_IN_THE_KERNEL"]

[kernel.activation_xpu]
backend = "xpu"
language = "cpp-xpu"
depends = ["torch"]
sycl-flags = ["-DWHO_AM_I_IF_NOT_THE_CANARY"]
src = ["relu_xpu/relu.cpp"]

[kernel.activation]
backend = "cuda"
language = "cpp-cuda"
cuda-flags = ["-DWHO_AM_I_IF_NOT_THE_CANARY"]
depends = ["torch"]
src = ["relu_cuda/relu.cu"]

[kernel.activation_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx906",
Expand Down
6 changes: 3 additions & 3 deletions examples/kernels/relu-invalid-capability/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-invalid-capability"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cpu",
Expand All @@ -21,13 +21,13 @@ src = [
]

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [ "gfx99999" ]
src = ["relu_cuda/relu.cu"]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
cuda-capabilities = [ "99999.0" ]
src = ["relu_cuda/relu.cu"]
4 changes: 2 additions & 2 deletions examples/kernels/relu-metal-cpp/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = ["metal"]

Expand All @@ -15,7 +15,7 @@ src = [
]

[kernel.relu_metal]
backend = "metal"
language = "cpp-metal"
depends = [
"torch",
"metal-cpp",
Expand Down
2 changes: 1 addition & 1 deletion examples/kernels/relu-nki/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-nki"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = ["neuron"]

Expand Down
6 changes: 3 additions & 3 deletions examples/kernels/relu-specific-torch/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-specific-torch"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -18,12 +18,12 @@ src = [
]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
src = ["relu_cuda/relu.cu"]

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx906",
Expand Down
6 changes: 3 additions & 3 deletions examples/kernels/relu-torch-bounds/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand All @@ -20,12 +20,12 @@ src = [
]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
src = ["relu_cuda/relu.cu"]

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx906",
Expand Down
10 changes: 5 additions & 5 deletions examples/kernels/relu-torch-stable-abi/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-torch-stable-abi"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cpu",
Expand All @@ -28,7 +28,7 @@ rocm = "2.11"
xpu = "2.11"

[kernel.relu_xpu]
backend = "xpu"
language = "cpp-xpu"
depends = ["torch"]
src = ["relu_xpu/relu.cpp"]

Expand All @@ -46,7 +46,7 @@ src = ["relu_xpu/relu.cpp"]
#]

[kernel.relu_rocm]
backend = "rocm"
language = "cpp-rocm"
depends = ["torch"]
rocm-archs = [
"gfx906",
Expand All @@ -62,11 +62,11 @@ rocm-archs = [
src = ["relu_cuda/relu.cu"]

[kernel.relu_cpu]
backend = "cpu"
language = "cpp-cpu"
depends = ["torch"]
src = ["relu_cpu/relu_cpu.cpp"]

[kernel.relu]
backend = "cuda"
language = "cpp-cuda"
depends = ["torch"]
src = ["relu_cuda/relu.cu"]
2 changes: 1 addition & 1 deletion examples/kernels/relu-tpu/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-tpu"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = ["tpu"]

Expand Down
2 changes: 1 addition & 1 deletion examples/kernels/relu-triton/build.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
name = "relu-triton"
version = 1
edition = 5
edition = 6
license = "Apache-2.0"
backends = [
"cuda",
Expand Down
Loading
Loading