Skip to content

Commit dbec572

Browse files
committed
Remove to-wheel subcommand
This subcommand is really under-maintained (e.g. doesn't support non-CUDA backends), nobody really seems to use it, and wheels bring back the issues that `kernels` is supposed to solve. Let's instead focus on getting more adoption and testing of kernel version locking/pre-downloading.
1 parent 8b807fa commit dbec572

File tree

4 files changed

+0
-270
lines changed

4 files changed

+0
-270
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,6 @@ jobs:
6666
HUGGINGFACE_CO_STAGING=true uv run pytest --token -m "is_staging_test" tests/
6767
if: matrix.python_version == '3.10' && matrix.torch-version == '2.7.0'
6868

69-
- name: Check kernel conversion
70-
run: |
71-
uv pip install wheel
72-
uv run kernels to-wheel kernels-community/triton-layer-norm 0.0.1
73-
uv pip install triton_layer_norm-0.0.1*.whl
74-
uv run python -c "import triton_layer_norm"
75-
76-
- name: Check kernel conversion (flat build)
77-
run: |
78-
uv run kernels to-wheel kernels-test/flattened-build 0.0.1
79-
uv pip install flattened_build-0.0.1*.whl
80-
uv run python -c "import flattened_build"
81-
8269
- name: Check README generation
8370
# For now, just checks that generation doesn't fail.
8471
run: |

docs/source/cli.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,6 @@ Checking variant: torch28-cxx11-cu128-aarch64-linux
2020
[...]
2121
```
2222

23-
### kernels to-wheel
24-
25-
We strongly recommend downloading kernels from the Hub using the `kernels`
26-
package, since this comes with large [benefits](index.md) over using Python
27-
wheels. That said, some projects may require deployment of kernels as
28-
wheels. The `kernels` utility provides a simple solution to this. You can
29-
convert any Hub kernel into a set of wheels with the `to-wheel` command:
30-
31-
```bash
32-
$ kernels to-wheel drbh/img2grey 1.1.2
33-
☸ img2grey-1.1.2+torch27cu128cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
34-
☸ img2grey-1.1.2+torch26cu124cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
35-
☸ img2grey-1.1.2+torch26cu126cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
36-
☸ img2grey-1.1.2+torch27cu126cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
37-
☸ img2grey-1.1.2+torch26cu126cxx98-cp39-abi3-manylinux_2_28_x86_64.whl
38-
☸ img2grey-1.1.2+torch27cu128cxx11-cp39-abi3-manylinux_2_28_aarch64.whl
39-
☸ img2grey-1.1.2+torch26cu126cxx98-cp39-abi3-manylinux_2_28_aarch64.whl
40-
☸ img2grey-1.1.2+torch27cu126cxx11-cp39-abi3-manylinux_2_28_aarch64.whl
41-
☸ img2grey-1.1.2+torch26cu126cxx11-cp39-abi3-manylinux_2_28_aarch64.whl
42-
☸ img2grey-1.1.2+torch26cu118cxx98-cp39-abi3-manylinux_2_28_x86_64.whl
43-
☸ img2grey-1.1.2+torch26cu124cxx98-cp39-abi3-manylinux_2_28_x86_64.whl
44-
☸ img2grey-1.1.2+torch26cu118cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
45-
☸ img2grey-1.1.2+torch27cu118cxx11-cp39-abi3-manylinux_2_28_x86_64.whl
46-
```
47-
4823
### kernels upload
4924

5025
Use `kernels upload <dir_containing_build> --repo_id="hub-username/kernel"` to upload

src/kernels/cli.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from kernels.utils import install_kernel, install_kernel_all_variants
1313

1414
from .doc import generate_readme_for_kernel
15-
from .wheel import build_variant_to_wheel
1615

1716
BUILD_VARIANT_REGEX = re.compile(r"^(torch\d+\d+|torch-universal)")
1817

@@ -92,25 +91,6 @@ def main():
9291
)
9392
lock_parser.set_defaults(func=lock_kernels)
9493

95-
to_wheel_parser = subparsers.add_parser(
96-
"to-wheel", help="Convert a kernel to a wheel file"
97-
)
98-
to_wheel_parser.add_argument("repo_id", type=str, help="The kernel repo ID")
99-
to_wheel_parser.add_argument("version", type=str, help="The kernel version")
100-
to_wheel_parser.add_argument(
101-
"--python-version",
102-
type=str,
103-
default="3.9",
104-
help="The minimum Python version. Must match the Python version that the kernel was compiled for.",
105-
)
106-
to_wheel_parser.add_argument(
107-
"--manylinux-version",
108-
type=str,
109-
default="2.28",
110-
help="The manylinux version. Must match the manylinux version that the kernel was compiled for.",
111-
)
112-
to_wheel_parser.set_defaults(func=kernels_to_wheel)
113-
11494
# Add generate-readme subcommand parser
11595
generate_readme_parser = subparsers.add_parser(
11696
"generate-readme",
@@ -174,24 +154,6 @@ def download_kernels(args):
174154
sys.exit(1)
175155

176156

177-
def kernels_to_wheel(args):
178-
variants_path = install_kernel_all_variants(
179-
repo_id=args.repo_id, revision=f"v{args.version}"
180-
)
181-
for variant_path in variants_path.iterdir():
182-
if not variant_path.is_dir():
183-
continue
184-
wheel_path = build_variant_to_wheel(
185-
manylinux_version=args.manylinux_version,
186-
python_version=args.python_version,
187-
repo_id=args.repo_id,
188-
version=args.version,
189-
variant_path=variant_path,
190-
wheel_dir=Path("."),
191-
)
192-
print(f"☸️ {wheel_path.name}", file=sys.stderr)
193-
194-
195157
def lock_kernels(args):
196158
with open(args.project_dir / "pyproject.toml", "rb") as f:
197159
data = tomllib.load(f)

src/kernels/wheel.py

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)