mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-04-30 03:01:16 +00:00
[build]: rename PyPI package from kt-kernel to ktransformers
Users can now `pip install ktransformers` to get everything (sglang-kt is auto-installed as a dependency). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
28
.github/workflows/release-pypi.yml
vendored
28
.github/workflows/release-pypi.yml
vendored
@@ -21,7 +21,7 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── sglang-kt (must be on PyPI before users can pip install kt-kernel) ──
|
# ── sglang-kt (must be on PyPI before users can pip install ktransformers) ──
|
||||||
build-and-publish-sglang-kt:
|
build-and-publish-sglang-kt:
|
||||||
name: Build & publish sglang-kt
|
name: Build & publish sglang-kt
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
@@ -72,9 +72,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m twine upload --repository testpypi --skip-existing --verbose third_party/sglang/python/dist/*.whl
|
python -m twine upload --repository testpypi --skip-existing --verbose third_party/sglang/python/dist/*.whl
|
||||||
|
|
||||||
# ── kt-kernel ──
|
# ── ktransformers (formerly kt-kernel) ──
|
||||||
build-kt-kernel:
|
build-ktransformers:
|
||||||
name: Build kt-kernel (Python ${{ matrix.python-version }})
|
name: Build ktransformers (Python ${{ matrix.python-version }})
|
||||||
runs-on: [self-hosted, linux, x64, gpu]
|
runs-on: [self-hosted, linux, x64, gpu]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -103,7 +103,7 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install build wheel setuptools torch --index-url https://download.pytorch.org/whl/cu118
|
pip install build wheel setuptools torch --index-url https://download.pytorch.org/whl/cu118
|
||||||
|
|
||||||
- name: Build kt-kernel wheel
|
- name: Build ktransformers wheel
|
||||||
working-directory: kt-kernel
|
working-directory: kt-kernel
|
||||||
env:
|
env:
|
||||||
CPUINFER_BUILD_ALL_VARIANTS: '1'
|
CPUINFER_BUILD_ALL_VARIANTS: '1'
|
||||||
@@ -115,7 +115,7 @@ jobs:
|
|||||||
CPUINFER_FORCE_REBUILD: '1'
|
CPUINFER_FORCE_REBUILD: '1'
|
||||||
CUDA_HOME: '/usr/local/cuda-11.8'
|
CUDA_HOME: '/usr/local/cuda-11.8'
|
||||||
run: |
|
run: |
|
||||||
echo "Building kt-kernel with:"
|
echo "Building ktransformers with:"
|
||||||
echo " - CUDA support (SM 80, 86, 89, 90)"
|
echo " - CUDA support (SM 80, 86, 89, 90)"
|
||||||
echo " - CPU multi-variant (AMX, AVX512, AVX2)"
|
echo " - CPU multi-variant (AMX, AVX512, AVX2)"
|
||||||
python -m build --wheel -v
|
python -m build --wheel -v
|
||||||
@@ -171,13 +171,13 @@ jobs:
|
|||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: kt-kernel-wheels-py${{ matrix.python-version }}
|
name: ktransformers-wheels-py${{ matrix.python-version }}
|
||||||
path: kt-kernel/dist/*.whl
|
path: kt-kernel/dist/*.whl
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
publish-pypi:
|
publish-pypi:
|
||||||
name: Publish kt-kernel to PyPI
|
name: Publish ktransformers to PyPI
|
||||||
needs: [build-and-publish-sglang-kt, build-kt-kernel]
|
needs: [build-and-publish-sglang-kt, build-ktransformers]
|
||||||
runs-on: [self-hosted, linux, x64]
|
runs-on: [self-hosted, linux, x64]
|
||||||
if: github.repository == 'kvcache-ai/ktransformers' && github.ref == 'refs/heads/main'
|
if: github.repository == 'kvcache-ai/ktransformers' && github.ref == 'refs/heads/main'
|
||||||
environment: prod
|
environment: prod
|
||||||
@@ -203,8 +203,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Extract version from first wheel filename
|
# Extract version from first wheel filename
|
||||||
wheel_name=$(ls dist/*.whl | head -1 | xargs basename)
|
wheel_name=$(ls dist/*.whl | head -1 | xargs basename)
|
||||||
# Extract version (format: kt_kernel-X.Y.Z-...)
|
# Extract version (format: ktransformers-X.Y.Z-...)
|
||||||
version=$(echo "$wheel_name" | sed 's/kt_kernel-\([0-9.]*\)-.*/\1/')
|
version=$(echo "$wheel_name" | sed 's/ktransformers-\([0-9.]*\)-.*/\1/')
|
||||||
echo "VERSION=$version" >> $GITHUB_OUTPUT
|
echo "VERSION=$version" >> $GITHUB_OUTPUT
|
||||||
echo "Publishing version: $version"
|
echo "Publishing version: $version"
|
||||||
|
|
||||||
@@ -238,11 +238,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Create release summary
|
- name: Create release summary
|
||||||
run: |
|
run: |
|
||||||
echo "## 🎉 kt-kernel v${{ steps.get_version.outputs.VERSION }} Published to PyPI" >> $GITHUB_STEP_SUMMARY
|
echo "## 🎉 ktransformers v${{ steps.get_version.outputs.VERSION }} Published to PyPI" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Installation" >> $GITHUB_STEP_SUMMARY
|
echo "### Installation" >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```bash' >> $GITHUB_STEP_SUMMARY
|
echo '```bash' >> $GITHUB_STEP_SUMMARY
|
||||||
echo "pip install kt-kernel==${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
|
echo "pip install ktransformers==${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Published Wheels" >> $GITHUB_STEP_SUMMARY
|
echo "### Published Wheels" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -269,4 +269,4 @@ jobs:
|
|||||||
echo "- Linux x86-64 (manylinux_2_17 compatible)" >> $GITHUB_STEP_SUMMARY
|
echo "- Linux x86-64 (manylinux_2_17 compatible)" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- For CUDA features: NVIDIA driver with CUDA 11.8+ or 12.x support" >> $GITHUB_STEP_SUMMARY
|
echo "- For CUDA features: NVIDIA driver with CUDA 11.8+ or 12.x support" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "PyPI link: https://pypi.org/project/kt-kernel/${{ steps.get_version.outputs.VERSION }}/" >> $GITHUB_STEP_SUMMARY
|
echo "PyPI link: https://pypi.org/project/ktransformers/${{ steps.get_version.outputs.VERSION }}/" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ requires = ["setuptools>=61", "wheel", "cmake>=3.16", "pybind11"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "kt-kernel"
|
name = "ktransformers"
|
||||||
# Version is dynamically read from ../version.py via setup.py
|
# Version is dynamically read from ../version.py via setup.py
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
description = "KT-Kernel: High-performance kernel operations for KTransformers (AMX/AVX/KML optimizations)"
|
description = "KTransformers: CPU-GPU heterogeneous inference framework for LLMs (AMX/AVX/KML optimizations)"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [{ name = "kvcache-ai" }]
|
authors = [{ name = "kvcache-ai" }]
|
||||||
# Use SPDX string form (table form deprecated in newer setuptools)
|
# Use SPDX string form (table form deprecated in newer setuptools)
|
||||||
|
|||||||
@@ -708,14 +708,14 @@ else:
|
|||||||
VERSION = _base_version
|
VERSION = _base_version
|
||||||
print(f"-- Version: {VERSION}")
|
print(f"-- Version: {VERSION}")
|
||||||
|
|
||||||
# Package name is always kt-kernel
|
# Package name is ktransformers (formerly kt-kernel)
|
||||||
# The CUDA-enabled wheel includes both CPU multi-variant support and CUDA capabilities
|
# The CUDA-enabled wheel includes both CPU multi-variant support and CUDA capabilities
|
||||||
PACKAGE_NAME = "kt-kernel"
|
PACKAGE_NAME = "ktransformers"
|
||||||
cuda_enabled = _env_get_bool("CPUINFER_USE_CUDA", False)
|
cuda_enabled = _env_get_bool("CPUINFER_USE_CUDA", False)
|
||||||
if cuda_enabled:
|
if cuda_enabled:
|
||||||
print(f"-- Building kt-kernel with CUDA support (+ CPU multi-variant)")
|
print(f"-- Building ktransformers with CUDA support (+ CPU multi-variant)")
|
||||||
else:
|
else:
|
||||||
print(f"-- Building kt-kernel (CPU-only multi-variant)")
|
print(f"-- Building ktransformers (CPU-only multi-variant)")
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Setup
|
# Setup
|
||||||
@@ -724,7 +724,7 @@ else:
|
|||||||
setup(
|
setup(
|
||||||
name=PACKAGE_NAME,
|
name=PACKAGE_NAME,
|
||||||
version=VERSION,
|
version=VERSION,
|
||||||
description="KT-Kernel: High-performance kernel operations for KTransformers (AMX/AVX/KML optimizations)",
|
description="KTransformers: CPU-GPU heterogeneous inference framework for LLMs (AMX/AVX/KML optimizations)",
|
||||||
author="kvcache-ai",
|
author="kvcache-ai",
|
||||||
license="Apache-2.0",
|
license="Apache-2.0",
|
||||||
python_requires=">=3.8",
|
python_requires=">=3.8",
|
||||||
|
|||||||
Reference in New Issue
Block a user