[GH-ISSUE #1017] [Bug] No module named 'sched_ext' #718

Closed
opened 2026-10-29 14:43:19 +00:00 by bsakaguchi · 39 comments
Owner

Originally created by @Colacalc on GitHub (Apr 2, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1017

检查清单

  • 1. 我已经搜索过相关问题,但未能获得预期的帮助
  • 2. 该问题在最新版本中尚未修复
  • 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性
  • 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭
  • 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭

问题描述

安装过程遇到了这个问题,其他部分在编译库时有错误。

Image Image

复现步骤

bash ./start.sh -m ~/Desktop/model/DeepSeek-V3-0324-GGUF-Q4_K_M/config/ -g ~/Desktop/model/DeepSeek-V3-0324-GGUF-Q4_K_M/ -c 16 -t 8192 -l 2048

环境信息

ubuntu22.04 ./run.sh 安装

Originally created by @Colacalc on GitHub (Apr 2, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1017 ### 检查清单 - [x] 1. 我已经搜索过相关问题,但未能获得预期的帮助 - [ ] 2. 该问题在最新版本中尚未修复 - [ ] 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性 - [ ] 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [ ] 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭 ### 问题描述 安装过程遇到了这个问题,其他部分在编译库时有错误。 <img width="806" alt="Image" src="https://github.com/user-attachments/assets/f3583897-d2ec-4e91-9c26-32592e5f4c05" /> <img width="700" alt="Image" src="https://github.com/user-attachments/assets/d66a48a2-a42f-48fe-bf09-d86667c206c9" /> ### 复现步骤 bash ./start.sh -m ~/Desktop/model/DeepSeek-V3-0324-GGUF-Q4_K_M/config/ -g ~/Desktop/model/DeepSeek-V3-0324-GGUF-Q4_K_M/ -c 16 -t 8192 -l 2048 ### 环境信息 ubuntu22.04 ./run.sh 安装
Author
Owner

@orca-zhang commented on GitHub (Apr 2, 2025):

+1

<!-- gh-comment-id:2771992862 --> @orca-zhang commented on GitHub (Apr 2, 2025): +1
Author
Owner

@Warshmao commented on GitHub (Apr 2, 2025):

+1

<!-- gh-comment-id:2772252954 --> @Warshmao commented on GitHub (Apr 2, 2025): +1
Author
Owner

@Apanoff commented on GitHub (Apr 2, 2025):

+1

<!-- gh-comment-id:2772255148 --> @Apanoff commented on GitHub (Apr 2, 2025): +1
Author
Owner

@knilink commented on GitHub (Apr 2, 2025):

github.com/kvcache-ai/ktransformers@795524cacc/setup.py (L39)

好像要构建时要设置USE_BALANCE_SERVE=1来构建balancer

而且balancer的CMake可能要根据自身的环境改动
github.com/kvcache-ai/ktransformers@795524cacc/csrc/balance_serve/CMakeLists.txt (L3)
github.com/kvcache-ai/ktransformers@795524cacc/csrc/balance_serve/CMakeLists.txt (L55)
CMake中需要某些命令带后缀g++-13和python3但我的环境里就没后缀有比如g++,python

<!-- gh-comment-id:2772305554 --> @knilink commented on GitHub (Apr 2, 2025): https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/setup.py#L39 好像要构建时要设置`USE_BALANCE_SERVE=1`来构建balancer 而且balancer的CMake可能要根据自身的环境改动 https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/csrc/balance_serve/CMakeLists.txt#L3 https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/csrc/balance_serve/CMakeLists.txt#L55 CMake中需要某些命令带后缀`g++-13`和`python3`但我的环境里就没后缀有比如`g++`,`python`
Author
Owner

@pitaozi commented on GitHub (Apr 2, 2025):

ktransformers/setup.py

Line 39 in 795524c

with_balance = os.environ.get("USE_BALANCE_SERVE", "0") == "1"
好像要构建时要设置USE_BALANCE_SERVE=1来构建balancer

而且balancer的CMake可能要根据自身的环境改动

ktransformers/csrc/balance_serve/CMakeLists.txt

Line 3 in 795524c

find_program(GCC_COMPILER NAMES g++-13 g++-12 g++-11 REQUIRED)

ktransformers/csrc/balance_serve/CMakeLists.txt

Line 55 in 795524c

COMMAND python3 -c "import torch; print(torch.path[0])"

CMake中需要某些命令带后缀g++-13和python3但我的环境里就没后缀有比如g++,python
env USE_BALANCE_SERVE=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh
g++-11和python3都有,但是也是No module named 'sched_ext'

<!-- gh-comment-id:2772382444 --> @pitaozi commented on GitHub (Apr 2, 2025): > [ktransformers/setup.py](https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/setup.py#L39) > > Line 39 in [795524c](/kvcache-ai/ktransformers/commit/795524caccfd9830d22324c4951606f4d8ffb59b) > > with_balance = os.environ.get("USE_BALANCE_SERVE", "0") == "1" > 好像要构建时要设置`USE_BALANCE_SERVE=1`来构建balancer > > 而且balancer的CMake可能要根据自身的环境改动 > > [ktransformers/csrc/balance_serve/CMakeLists.txt](https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/csrc/balance_serve/CMakeLists.txt#L3) > > Line 3 in [795524c](/kvcache-ai/ktransformers/commit/795524caccfd9830d22324c4951606f4d8ffb59b) > > find_program(GCC_COMPILER NAMES g++-13 g++-12 g++-11 REQUIRED) > > [ktransformers/csrc/balance_serve/CMakeLists.txt](https://github.com/kvcache-ai/ktransformers/blob/795524caccfd9830d22324c4951606f4d8ffb59b/csrc/balance_serve/CMakeLists.txt#L55) > > Line 55 in [795524c](/kvcache-ai/ktransformers/commit/795524caccfd9830d22324c4951606f4d8ffb59b) > > COMMAND python3 -c "import torch; print(torch.__path__[0])" > > CMake中需要某些命令带后缀`g++-13`和`python3`但我的环境里就没后缀有比如`g++`,`python` env USE_BALANCE_SERVE=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh g++-11和python3都有,但是也是No module named 'sched_ext'
Author
Owner

@createthis commented on GitHub (Apr 2, 2025):

+1

I also see this at the end of the build log:

cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-*.so*': No such file or directory
<!-- gh-comment-id:2773742232 --> @createthis commented on GitHub (Apr 2, 2025): +1 I also see this at the end of the build log: ``` cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-*.so*': No such file or directory ```
Author
Owner

@olproff commented on GitHub (Apr 2, 2025):

+1
Hello, i have the same issue:

  1. git pull && sh install.sh - everything all ok
    run ktransformers and there is i have that issue:

PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True ktransformers --gguf_path ~/deepseek/unsloth/DeepSeek-R1-GGUF/DeepSeek-R1-UD-Q2_K_XL/ --model_path deepseek-ai/DeepSeek-R1 --model_name unsloth/DeepSeek-R1-UD-Q2_K_XL --cpu_infer 30 --max_new_tokens 8192 --cache_lens 32768 --total_context 32768 --cache_q4 true --temperature 0.6 --top_p 0.95 --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu.yaml --force_think --use_cuda_graph --port 10002 --web True

Traceback (most recent call last):
File "/usr/local/anaconda3/envs/ktransformers/bin/ktransformers", line 5, in
from ktransformers.server.main import main
File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/main.py", line 11, in
from ktransformers.server.args import ArgumentParser
File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in
from ktransformers.util.utils import get_free_ports
File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/util/utils.py", line 17, in
from ktransformers.models.custom_cache import StaticCache
File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 15, in
from ktransformers.server.balance_serve.settings import sched_ext
File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in
import sched_ext
ModuleNotFoundError: No module named 'sched_ext'

<!-- gh-comment-id:2773824188 --> @olproff commented on GitHub (Apr 2, 2025): +1 Hello, i have the same issue: 1) git pull && sh install.sh - everything all ok run ktransformers and there is i have that issue: PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True ktransformers --gguf_path ~/deepseek/unsloth/DeepSeek-R1-GGUF/DeepSeek-R1-UD-Q2_K_XL/ --model_path deepseek-ai/DeepSeek-R1 --model_name unsloth/DeepSeek-R1-UD-Q2_K_XL --cpu_infer 30 --max_new_tokens 8192 --cache_lens 32768 --total_context 32768 --cache_q4 true --temperature 0.6 --top_p 0.95 --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu.yaml --force_think --use_cuda_graph --port 10002 --web True Traceback (most recent call last): File "/usr/local/anaconda3/envs/ktransformers/bin/ktransformers", line 5, in <module> from ktransformers.server.main import main File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/main.py", line 11, in <module> from ktransformers.server.args import ArgumentParser File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in <module> from ktransformers.util.utils import get_free_ports File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/util/utils.py", line 17, in <module> from ktransformers.models.custom_cache import StaticCache File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 15, in <module> from ktransformers.server.balance_serve.settings import sched_ext File "/usr/local/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in <module> import sched_ext ModuleNotFoundError: No module named 'sched_ext'
Author
Owner

@createthis commented on GitHub (Apr 3, 2025):

I think this may be a documentation issue. This documentation: https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/balance-serve.md#3-build-ktransformers

... does not match this documentation: https://kvcache-ai.github.io/ktransformers/en/install.html

<!-- gh-comment-id:2774012210 --> @createthis commented on GitHub (Apr 3, 2025): I think this may be a documentation issue. This documentation: https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/balance-serve.md#3-build-ktransformers ... does not match this documentation: https://kvcache-ai.github.io/ktransformers/en/install.html
Author
Owner

@jaspers1203 commented on GitHub (Apr 3, 2025):

同样的错误,环境变量设置USE_BALANCE_SERVE=1后编译很多次都是下面的错误。
如果不加则

  1. cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-.so': No such file or directory
  2. 启动: ModuleNotFoundError: No module named 'sched_ext'

[3/3] /usr/local/cuda-12.4/bin/nvcc --generate-dependencies-with-compile --dependency-output /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/TH -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda-12.4/include -I/root/miniconda3/envs/ktransformer/include/python3.11 -c -c /data/project/KTransformer/src/csrc/custom_marlin/gptq_marlin/gptq_marlin.cu -o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17
g++ -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -shared /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda-12.4/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so
CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON']
CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']
build_temp: /data/project/KTransformer/src/csrc/balance_serve/build
Traceback (most recent call last):
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in
main()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel
return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
self.run_setup()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
File "", line 468, in
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
dist.run_commands()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
self.run_command(cmd)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "", line 245, in run
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run
self.run_command("build")
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run
self.run_command(cmd_name)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command
self.distribution.run_command(command)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
cmd_obj.run()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run
_build_ext.run(self)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run
self.build_extensions()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions
build_ext.build_extensions(self)
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions
self._build_extensions_serial()
File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial
self.build_extension(ext)
File "", line 396, in build_extension
File "/root/miniconda3/envs/ktransformer/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '/data/project/KTransformer/src/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1.
error: subprocess-exited-with-error

× Building wheel for ktransformers (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /root/miniconda3/envs/ktransformer/bin/python3.11 /root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpuuffa5lo
cwd: /data/project/KTransformer/src
Building wheel for ktransformers (pyproject.toml) ... error
ERROR: Failed building wheel for ktransformers
Failed to build ktransformers
ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers)

<!-- gh-comment-id:2774124168 --> @jaspers1203 commented on GitHub (Apr 3, 2025): 同样的错误,环境变量设置USE_BALANCE_SERVE=1后编译很多次都是下面的错误。 如果不加则 1. cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-*.so*': No such file or directory 2. 启动: ModuleNotFoundError: No module named 'sched_ext' [3/3] /usr/local/cuda-12.4/bin/nvcc --generate-dependencies-with-compile --dependency-output /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/TH -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda-12.4/include -I/root/miniconda3/envs/ktransformer/include/python3.11 -c -c /data/project/KTransformer/src/csrc/custom_marlin/gptq_marlin/gptq_marlin.cu -o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 g++ -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -shared /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda-12.4/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON'] CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy'] build_temp: /data/project/KTransformer/src/csrc/balance_serve/build Traceback (most recent call last): File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module> main() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel return _build_backend().build_wheel( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir self.run_setup() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) File "<string>", line 468, in <module> File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands self.run_command(cmd) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "<string>", line 245, in run File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run self.run_command("build") File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run self.run_command(cmd_name) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run self.build_extensions() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions build_ext.build_extensions(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions self._build_extensions_serial() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial self.build_extension(ext) File "<string>", line 396, in build_extension File "/root/miniconda3/envs/ktransformer/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '/data/project/KTransformer/src/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error × Building wheel for ktransformers (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /root/miniconda3/envs/ktransformer/bin/python3.11 /root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpuuffa5lo cwd: /data/project/KTransformer/src Building wheel for ktransformers (pyproject.toml) ... error ERROR: Failed building wheel for ktransformers Failed to build ktransformers ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers)
Author
Owner

@WingsLong commented on GitHub (Apr 3, 2025):

同样的错误,环境变量设置USE_BALANCE_SERVE=1后编译很多次都是下面的错误。 如果不加则

  1. cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-.so': No such file or directory
  2. 启动: ModuleNotFoundError: No module named 'sched_ext'

[3/3] /usr/local/cuda-12.4/bin/nvcc --generate-dependencies-with-compile --dependency-output /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/TH -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda-12.4/include -I/root/miniconda3/envs/ktransformer/include/python3.11 -c -c /data/project/KTransformer/src/csrc/custom_marlin/gptq_marlin/gptq_marlin.cu -o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 g++ -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -shared /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda-12.4/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON'] CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy'] build_temp: /data/project/KTransformer/src/csrc/balance_serve/build Traceback (most recent call last): File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in main() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel return _build_backend().build_wheel( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir self.run_setup() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) File "", line 468, in File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/init.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands self.run_command(cmd) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "", line 245, in run File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run self.run_command("build") File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run self.run_command(cmd_name) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run self.build_extensions() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions build_ext.build_extensions(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions self._build_extensions_serial() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial self.build_extension(ext) File "", line 396, in build_extension File "/root/miniconda3/envs/ktransformer/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '/data/project/KTransformer/src/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error

× Building wheel for ktransformers (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. full command: /root/miniconda3/envs/ktransformer/bin/python3.11 /root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpuuffa5lo cwd: /data/project/KTransformer/src Building wheel for ktransformers (pyproject.toml) ... error ERROR: Failed building wheel for ktransformers Failed to build ktransformers ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers)

一样的错误,请求解决了吗!不知道啥问题

<!-- gh-comment-id:2774281679 --> @WingsLong commented on GitHub (Apr 3, 2025): > 同样的错误,环境变量设置USE_BALANCE_SERVE=1后编译很多次都是下面的错误。 如果不加则 > > 1. cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-_.so_': No such file or directory > 2. 启动: ModuleNotFoundError: No module named 'sched_ext' > > [3/3] /usr/local/cuda-12.4/bin/nvcc --generate-dependencies-with-compile --dependency-output /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o.d -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/TH -I/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda-12.4/include -I/root/miniconda3/envs/ktransformer/include/python3.11 -c -c /data/project/KTransformer/src/csrc/custom_marlin/gptq_marlin/gptq_marlin.cu -o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -Xcompiler -fPIC -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=vLLMMarlin -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 -std=c++17 g++ -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -fPIC -O2 -isystem /root/miniconda3/envs/ktransformer/include -pthread -B /root/miniconda3/envs/ktransformer/compiler_compat -shared /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/binding.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin.o /data/project/KTransformer/src/build/temp.linux-x86_64-cpython-311/csrc/custom_marlin/gptq_marlin/gptq_marlin_repack.o -L/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/lib -L/usr/local/cuda-12.4/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-311/vLLMMarlin.cpython-311-x86_64-linux-gnu.so CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON'] CMake args: ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy'] build_temp: /data/project/KTransformer/src/csrc/balance_serve/build Traceback (most recent call last): File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in main() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel return _build_backend().build_wheel( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 438, in build_wheel return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 426, in _build return self._build_with_temp_dir( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir self.run_setup() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup exec(code, locals()) File "", line 468, in File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/**init**.py", line 117, in setup return distutils.core.setup(**attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup return run_commands(dist) ^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands dist.run_commands() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands self.run_command(cmd) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "", line 245, in run File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 379, in run self.run_command("build") File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 136, in run self.run_command(cmd_name) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 339, in run_command self.distribution.run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/dist.py", line 999, in run_command super().run_command(command) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command cmd_obj.run() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 99, in run _build_ext.run(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 365, in run self.build_extensions() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 900, in build_extensions build_ext.build_extensions(self) File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 481, in build_extensions self._build_extensions_serial() File "/root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 507, in _build_extensions_serial self.build_extension(ext) File "", line 396, in build_extension File "/root/miniconda3/envs/ktransformer/lib/python3.11/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '/data/project/KTransformer/src/csrc/balance_serve', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/data/project/KTransformer/src/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/root/miniconda3/envs/ktransformer/bin/python3.11', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu124torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error > > × Building wheel for ktransformers (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. > > note: This error originates from a subprocess, and is likely not a problem with pip. full command: /root/miniconda3/envs/ktransformer/bin/python3.11 /root/miniconda3/envs/ktransformer/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpuuffa5lo cwd: /data/project/KTransformer/src Building wheel for ktransformers (pyproject.toml) ... error ERROR: Failed building wheel for ktransformers Failed to build ktransformers ERROR: Failed to build installable wheels for some pyproject.toml based projects (ktransformers) 一样的错误,请求解决了吗!不知道啥问题
Author
Owner

@orca-zhang commented on GitHub (Apr 3, 2025):

git submodule update --init --recursive
apt install g++-13

然后:
USE_BALANCE_SERVE=1 USE_NUMA=1 sh install.sh

<!-- gh-comment-id:2774437151 --> @orca-zhang commented on GitHub (Apr 3, 2025): git submodule update --init --recursive apt install g++-13 然后: USE_BALANCE_SERVE=1 USE_NUMA=1 sh install.sh
Author
Owner

@Joluck commented on GitHub (Apr 3, 2025):

+1

I also see this at the end of the build log:

cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-*.so*': No such file or directory

same issue, have you found a solution?

<!-- gh-comment-id:2774538506 --> @Joluck commented on GitHub (Apr 3, 2025): > +1 > > I also see this at the end of the build log: > > ``` > cp: cannot stat 'csrc/balance_serve/build/third_party/prometheus-cpp/lib/libprometheus-cpp-*.so*': No such file or directory > ``` same issue, have you found a solution?
Author
Owner

@NUSTHR commented on GitHub (Apr 3, 2025):

same issue, anyone can provide some advice?

<!-- gh-comment-id:2774674598 --> @NUSTHR commented on GitHub (Apr 3, 2025): same issue, anyone can provide some advice?
Author
Owner

@jaspers1203 commented on GitHub (Apr 3, 2025):

升级cmake到3.29.0

修改CMakeLists.txt,添加:
set(CMAKE_CUDA_STANDARD 20)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

可以成功编译并生成libprometheus-cpp-.so等文件:
ll csrc/balance_serve/build/third_party/prometheus-cpp/lib
total 480
drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./
drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../
lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3*
lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0*
-rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0*
lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3*
lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0*
-rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0*

不过按照文档启动后如下面信息就不动了:
python ./src/ktransformers/server/main.py
--port 9994
--model_path deepseek-ai/DeepSeek-R1
--gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M
--optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml
--max_new_tokens 8192
--cache_lens 32768
--chunk_size 256
--max_batch_size 4
--backend_type balance_serve

2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
sched_rpc started with PID: 836934
set start method
Connected to server at tcp://localhost:48245
2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
start method already set to spawn
Connected to server at tcp://localhost:48245
Getting inference context from sched_client.

<!-- gh-comment-id:2774826538 --> @jaspers1203 commented on GitHub (Apr 3, 2025): 升级cmake到3.29.0 修改CMakeLists.txt,添加: set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON) 可以成功编译并生成libprometheus-cpp-.so等文件: ll csrc/balance_serve/build/third_party/prometheus-cpp/lib total 480 drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./ drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../ lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0* -rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0* lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0* -rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0* 不过按照文档启动后如下面信息就不动了: python ./src/ktransformers/server/main.py \ --port 9994 \ --model_path deepseek-ai/DeepSeek-R1 \ --gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M \ --optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml \ --max_new_tokens 8192 \ --cache_lens 32768 \ --chunk_size 256 \ --max_batch_size 4 \ --backend_type balance_serve 2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 836934 set start method Connected to server at tcp://localhost:48245 2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48245 Getting inference context from sched_client.
Author
Owner

@Joluck commented on GitHub (Apr 3, 2025):

升级cmake到3.29.0

修改CMakeLists.txt,添加: set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON)

可以成功编译并生成libprometheus-cpp-.so等文件: ll csrc/balance_serve/build/third_party/prometheus-cpp/lib total 480 drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./ drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../ lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0* -rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0* lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0* -rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0*

不过按照文档启动后如下面信息就不动了: python ./src/ktransformers/server/main.py --port 9994 --model_path deepseek-ai/DeepSeek-R1 --gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml --max_new_tokens 8192 --cache_lens 32768 --chunk_size 256 --max_batch_size 4 --backend_type balance_serve

2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 836934 set start method Connected to server at tcp://localhost:48245 2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48245 Getting inference context from sched_client.

cuda一定要12.4吗?目前12.8 总是cmake报错

<!-- gh-comment-id:2774851770 --> @Joluck commented on GitHub (Apr 3, 2025): > 升级cmake到3.29.0 > > 修改CMakeLists.txt,添加: set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON) > > 可以成功编译并生成libprometheus-cpp-.so等文件: ll csrc/balance_serve/build/third_party/prometheus-cpp/lib total 480 drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./ drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../ lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0* -rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0* lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0* -rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0* > > 不过按照文档启动后如下面信息就不动了: python ./src/ktransformers/server/main.py --port 9994 --model_path deepseek-ai/DeepSeek-R1 --gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml --max_new_tokens 8192 --cache_lens 32768 --chunk_size 256 --max_batch_size 4 --backend_type balance_serve > > 2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 836934 set start method Connected to server at tcp://localhost:48245 2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48245 Getting inference context from sched_client. cuda一定要12.4吗?目前12.8 总是cmake报错
Author
Owner

@NUSTHR commented on GitHub (Apr 3, 2025):

git submodule update --init --recursive apt install g++-13

然后: USE_BALANCE_SERVE=1 USE_NUMA=1 sh install.sh

do you succeed in running it?

<!-- gh-comment-id:2774944465 --> @NUSTHR commented on GitHub (Apr 3, 2025): > git submodule update --init --recursive apt install g++-13 > > 然后: USE_BALANCE_SERVE=1 USE_NUMA=1 sh install.sh do you succeed in running it?
Author
Owner

@NUSTHR commented on GitHub (Apr 3, 2025):

升级cmake到3.29.0

修改CMakeLists.txt,添加: set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON)

可以成功编译并生成libprometheus-cpp-.so等文件: ll csrc/balance_serve/build/third_party/prometheus-cpp/lib total 480 drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./ drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../ lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0* -rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0* lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0* -rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0*

不过按照文档启动后如下面信息就不动了: python ./src/ktransformers/server/main.py --port 9994 --model_path deepseek-ai/DeepSeek-R1 --gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml --max_new_tokens 8192 --cache_lens 32768 --chunk_size 256 --max_batch_size 4 --backend_type balance_serve

2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 836934 set start method Connected to server at tcp://localhost:48245 2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48245 Getting inference context from sched_client.

hey bro, could you access the model now?

<!-- gh-comment-id:2775017116 --> @NUSTHR commented on GitHub (Apr 3, 2025): > 升级cmake到3.29.0 > > 修改CMakeLists.txt,添加: set(CMAKE_CUDA_STANDARD 20) set(CMAKE_CUDA_STANDARD_REQUIRED ON) > > 可以成功编译并生成libprometheus-cpp-.so等文件: ll csrc/balance_serve/build/third_party/prometheus-cpp/lib total 480 drwxr-xr-x 2 root root 4096 Apr 3 10:46 ./ drwxr-xr-x 8 root root 4096 Apr 3 11:22 ../ lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-core.so -> libprometheus-cpp-core.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-core.so.1.3 -> libprometheus-cpp-core.so.1.3.0* -rwxr-xr-x 1 root root 221928 Apr 3 10:46 libprometheus-cpp-core.so.1.3.0* lrwxrwxrwx 1 root root 29 Apr 3 10:46 libprometheus-cpp-pull.so -> libprometheus-cpp-pull.so.1.3* lrwxrwxrwx 1 root root 31 Apr 3 10:46 libprometheus-cpp-pull.so.1.3 -> libprometheus-cpp-pull.so.1.3.0* -rwxr-xr-x 1 root root 254960 Apr 3 10:46 libprometheus-cpp-pull.so.1.3.0* > > 不过按照文档启动后如下面信息就不动了: python ./src/ktransformers/server/main.py --port 9994 --model_path deepseek-ai/DeepSeek-R1 --gguf_path ./DeepSeek-R1-GGUF/DeepSeek-R1-Q4_K_M --optimize_config_path ./src/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-4.yaml --max_new_tokens 8192 --cache_lens 32768 --chunk_size 256 --max_batch_size 4 --backend_type balance_serve > > 2025-04-03 15:37:14,906 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 836934 set start method Connected to server at tcp://localhost:48245 2025-04-03 15:37:19,423 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48245 Getting inference context from sched_client. hey bro, could you access the model now?
Author
Owner

@git-shan commented on GitHub (Apr 3, 2025):

File "/home/mtg/miniconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in
import sched_ext
ModuleNotFoundError: No module named 'sched_ext'

<!-- gh-comment-id:2775653794 --> @git-shan commented on GitHub (Apr 3, 2025): File "/home/mtg/miniconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in <module> import sched_ext ModuleNotFoundError: No module named 'sched_ext'
Author
Owner

@git-shan commented on GitHub (Apr 3, 2025):

subprocess.CalledProcessError: Command '['cmake', '/home/deepseek/mktr/ktransformers/csrc/ktransformers_ext', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/deepseek/mktr/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/mtg/miniconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu128torch26fancy']' returned non-zero exit status 1.
error: subprocess-exited-with-error

<!-- gh-comment-id:2775740700 --> @git-shan commented on GitHub (Apr 3, 2025): subprocess.CalledProcessError: Command '['cmake', '/home/deepseek/mktr/ktransformers/csrc/ktransformers_ext', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/deepseek/mktr/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/mtg/miniconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu128torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error
Author
Owner

@git-shan commented on GitHub (Apr 3, 2025):

issue on cmake csrc/balance_serve, CUDA 12.8 does not work

<!-- gh-comment-id:2775917675 --> @git-shan commented on GitHub (Apr 3, 2025): issue on cmake csrc/balance_serve, CUDA 12.8 does not work
Author
Owner

@olproff commented on GitHub (Apr 3, 2025):

subprocess.CalledProcessError: Command '['cmake', '/home/deepseek/mktr/ktransformers/csrc/ktransformers_ext', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/deepseek/mktr/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/mtg/miniconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu128torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error

same issue

<!-- gh-comment-id:2776647128 --> @olproff commented on GitHub (Apr 3, 2025): > subprocess.CalledProcessError: Command '['cmake', '/home/deepseek/mktr/ktransformers/csrc/ktransformers_ext', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/deepseek/mktr/ktransformers/build/lib.linux-x86_64-cpython-311/', '-DPYTHON_EXECUTABLE=/home/mtg/miniconda3/envs/ktransformers/bin/python', '-DCMAKE_BUILD_TYPE=Release', '-DKTRANSFORMERS_USE_CUDA=ON', '-DLLAMA_NATIVE=ON', '-DEXAMPLE_VERSION_INFO=0.2.4+cu128torch26fancy']' returned non-zero exit status 1. error: subprocess-exited-with-error same issue
Author
Owner

@devnen commented on GitHub (Apr 3, 2025):

Same issue as everyone else. Here is my command:

python ktransformers/server/main.py
--model_path deepseek-ai/DeepSeek-V3-0324
--gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL
--cpu_infer 30
--port 10002
--web True

Here is the error:

Traceback (most recent call last):
File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in
from ktransformers.server.args import ArgumentParser
File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in
from ktransformers.util.utils import get_free_ports
File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in
from ktransformers.models.custom_cache import StaticCache
File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in
from ktransformers.server.balance_serve.settings import sched_ext
File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in
import sched_ext
ModuleNotFoundError: No module named 'sched_ext'

I have tried compiling with and without "balance serve" option:

USE_BALANCE_SERVE=1 bash ./install.sh
and
bash ./install.sh

<!-- gh-comment-id:2777104614 --> @devnen commented on GitHub (Apr 3, 2025): Same issue as everyone else. Here is my command: python ktransformers/server/main.py \ --model_path deepseek-ai/DeepSeek-V3-0324 \ --gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL \ --cpu_infer 30 \ --port 10002 \ --web True Here is the error: Traceback (most recent call last): File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in <module> from ktransformers.server.args import ArgumentParser File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in <module> from ktransformers.util.utils import get_free_ports File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in <module> from ktransformers.models.custom_cache import StaticCache File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in <module> from ktransformers.server.balance_serve.settings import sched_ext File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in <module> import sched_ext ModuleNotFoundError: No module named 'sched_ext' I have tried compiling with and without "balance serve" option: USE_BALANCE_SERVE=1 bash ./install.sh and bash ./install.sh
Author
Owner

@CYSTEV-chn commented on GitHub (Apr 4, 2025):

Same issue as everyone else. Here is my command:

python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3-0324 --gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL --cpu_infer 30 --port 10002 --web True

Here is the error:

Traceback (most recent call last): File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in from ktransformers.server.args import ArgumentParser File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in from ktransformers.models.custom_cache import StaticCache File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in from ktransformers.server.balance_serve.settings import sched_ext File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in import sched_ext ModuleNotFoundError: No module named 'sched_ext'

I have tried compiling with and without "balance serve" option:

USE_BALANCE_SERVE=1 bash ./install.sh and bash ./install.sh

change your command as :python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3 --gguf_path /home/user/models_gguf/DeepSeek-V3 --cpu_infer 30 --port 10002 --web True
and rename your folds name as DeepSeek-V3. try it.

<!-- gh-comment-id:2778065967 --> @CYSTEV-chn commented on GitHub (Apr 4, 2025): > Same issue as everyone else. Here is my command: > > python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3-0324 --gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL --cpu_infer 30 --port 10002 --web True > > Here is the error: > > Traceback (most recent call last): File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in from ktransformers.server.args import ArgumentParser File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in from ktransformers.models.custom_cache import StaticCache File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in from ktransformers.server.balance_serve.settings import sched_ext File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in import sched_ext ModuleNotFoundError: No module named 'sched_ext' > > I have tried compiling with and without "balance serve" option: > > USE_BALANCE_SERVE=1 bash ./install.sh and bash ./install.sh change your command as :`python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3 --gguf_path /home/user/models_gguf/DeepSeek-V3 --cpu_infer 30 --port 10002 --web True` and rename your folds name as DeepSeek-V3. try it.
Author
Owner

@bboowx commented on GitHub (Apr 4, 2025):

(ktransformers) wangjian@tufai:~$ python -m ktransformers.local_chat --model_path /home/wangjian/models/R1 --gguf_path /home/wangjian/models/R1-GGUF/DeepSeek-R1-UD-Q2_K_XL 2.51 --optimize_config_path /home/wangjian/models/Chat.yaml –max_new_tokens 4096 --cpu_infer 16 --model_name DeepSeek-R1
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/local_chat.py", line 25, in
from ktransformers.optimize.optimize import optimize_and_load_gguf
File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/optimize/optimize.py", line 16, in
from ktransformers.util.utils import set_module, load_weights
File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/util/utils.py", line 17, in
from ktransformers.models.custom_cache import StaticCache
File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 15, in
from ktransformers.server.balance_serve.settings import sched_ext
File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in
import sched_ext
ModuleNotFoundError: No module named 'sched_ext'

运行模型一样报错~~

<!-- gh-comment-id:2778368471 --> @bboowx commented on GitHub (Apr 4, 2025): (ktransformers) wangjian@tufai:~$ python -m ktransformers.local_chat --model_path /home/wangjian/models/R1 --gguf_path /home/wangjian/models/R1-GGUF/DeepSeek-R1-UD-Q2_K_XL 2.51 --optimize_config_path /home/wangjian/models/Chat.yaml –max_new_tokens 4096 --cpu_infer 16 --model_name DeepSeek-R1 Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/local_chat.py", line 25, in <module> from ktransformers.optimize.optimize import optimize_and_load_gguf File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/optimize/optimize.py", line 16, in <module> from ktransformers.util.utils import set_module, load_weights File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/util/utils.py", line 17, in <module> from ktransformers.models.custom_cache import StaticCache File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 15, in <module> from ktransformers.server.balance_serve.settings import sched_ext File "/home/wangjian/anaconda3/envs/ktransformers/lib/python3.11/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in <module> import sched_ext ModuleNotFoundError: No module named 'sched_ext' =========================================================== 运行模型一样报错~~
Author
Owner

@devnen commented on GitHub (Apr 4, 2025):

Same issue as everyone else. Here is my command:
python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3-0324 --gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL --cpu_infer 30 --port 10002 --web True
Here is the error:
Traceback (most recent call last): File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in from ktransformers.server.args import ArgumentParser File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in from ktransformers.models.custom_cache import StaticCache File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in from ktransformers.server.balance_serve.settings import sched_ext File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in import sched_ext ModuleNotFoundError: No module named 'sched_ext'
I have tried compiling with and without "balance serve" option:
USE_BALANCE_SERVE=1 bash ./install.sh and bash ./install.sh

change your command as :python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3 --gguf_path /home/user/models_gguf/DeepSeek-V3 --cpu_infer 30 --port 10002 --web True and rename your folds name as DeepSeek-V3. try it.

Thank you for responding. I tried changing the command, but unfortunately, that generated the same error.

I've managed to get it running by modifying the Python code in a few places.

I am now trying to construct the yaml and the command line to take advantage of 192GB vRAM (8 x RTX 3090) and 192GB DDR5 RAM. The goal is maximum tokens per second. I'm open to any suggestions. I am getting 1.6 tokens/sec. with the standard 8 GPUs YAML settings file and a DeepSeek-V3-0324-UD-IQ2_XXS quant from Unsloth.

python /home/user/deepseek/ktransformers/ktransformers/server/main.py
--model_path deepseek-ai/DeepSeek-V3
--gguf_path /home/user/models_gguf/DeepSeek-V3
--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-8.yaml
--cpu_infer 30
--port 10002
--backend_type ktransformers
--force_think

Here's what I have changed:

  1. In ~/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py:

    • Modified line 13 to add a try/except block around the import sched_ext statement:
    try:
        import sched_ext
    except ImportError:
        sched_ext = None
        print("Warning: sched_ext module not found, balance_serve functionality will be limited")
    
  2. In ~/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py:

    • Added a dummy implementation for the missing module:
    try:
        from ktransformers.server.balance_serve.settings import sched_ext
    except ImportError:
        # Create dummy class to stand in for missing module
        class DummyModule:
            class InferenceContext:
                pass
        sched_ext = DummyModule()
    
    • Removed type hints in the KDeepSeekV3Cache class:
    # Changed from:
    def load(self, inference_context: sched_ext.InferenceContext):
    # To:
    def load(self, inference_context):
    
  3. Removed the --web True flag from the command since the web interface files were missing

The root issue was a missing C extension module (sched_ext) that's required for the balance_serve functionality.

<!-- gh-comment-id:2778734503 --> @devnen commented on GitHub (Apr 4, 2025): > > Same issue as everyone else. Here is my command: > > python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3-0324 --gguf_path /home/user/models_gguf/DeepSeek-V3-0324-UD-Q2_K_XL --cpu_infer 30 --port 10002 --web True > > Here is the error: > > Traceback (most recent call last): File "/home/user/deepseek/ktransformers/ktransformers/server/main.py", line 11, in from ktransformers.server.args import ArgumentParser File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/util/utils.py", line 17, in from ktransformers.models.custom_cache import StaticCache File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py", line 15, in from ktransformers.server.balance_serve.settings import sched_ext File "/home/user/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py", line 13, in import sched_ext ModuleNotFoundError: No module named 'sched_ext' > > I have tried compiling with and without "balance serve" option: > > USE_BALANCE_SERVE=1 bash ./install.sh and bash ./install.sh > > change your command as :`python ktransformers/server/main.py --model_path deepseek-ai/DeepSeek-V3 --gguf_path /home/user/models_gguf/DeepSeek-V3 --cpu_infer 30 --port 10002 --web True` and rename your folds name as DeepSeek-V3. try it. Thank you for responding. I tried changing the command, but unfortunately, that generated the same error. I've managed to get it running by modifying the Python code in a few places. I am now trying to construct the yaml and the command line to take advantage of 192GB vRAM (8 x RTX 3090) and 192GB DDR5 RAM. The goal is maximum tokens per second. I'm open to any suggestions. I am getting 1.6 tokens/sec. with the standard 8 GPUs YAML settings file and a DeepSeek-V3-0324-UD-IQ2_XXS quant from Unsloth. python /home/user/deepseek/ktransformers/ktransformers/server/main.py \ --model_path deepseek-ai/DeepSeek-V3 \ --gguf_path /home/user/models_gguf/DeepSeek-V3 \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-8.yaml \ --cpu_infer 30 \ --port 10002 \ --backend_type ktransformers \ --force_think Here's what I have changed: 1. In `~/deepseek/venv/lib/python3.10/site-packages/ktransformers/server/balance_serve/settings.py`: - Modified line 13 to add a try/except block around the `import sched_ext` statement: ```python try: import sched_ext except ImportError: sched_ext = None print("Warning: sched_ext module not found, balance_serve functionality will be limited") ``` 2. In `~/deepseek/venv/lib/python3.10/site-packages/ktransformers/models/custom_cache.py`: - Added a dummy implementation for the missing module: ```python try: from ktransformers.server.balance_serve.settings import sched_ext except ImportError: # Create dummy class to stand in for missing module class DummyModule: class InferenceContext: pass sched_ext = DummyModule() ``` - Removed type hints in the KDeepSeekV3Cache class: ```python # Changed from: def load(self, inference_context: sched_ext.InferenceContext): # To: def load(self, inference_context): ``` 3. Removed the `--web True` flag from the command since the web interface files were missing The root issue was a missing C extension module (`sched_ext`) that's required for the balance_serve functionality.
Author
Owner

@CYSTEV-chn commented on GitHub (Apr 4, 2025):

--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-8.yaml
this command is used for KT0.2.3 ,
if you sucessfully installl KT0.2.4 ,
you should use : DeepSeek-V3-Chat-fp8-linear-ggml-experts-serve.yaml
or
DeepSeek-V3-Chat-serve.yaml
the two yaml all [add balance-serve]
you can check origin code Last commit message : https://github.com/kvcache-ai/ktransformers/tree/main/ktransformers/optimize/optimize_rules

i think this maybe the reason of error.
i once the same error as you.

<!-- gh-comment-id:2779147566 --> @CYSTEV-chn commented on GitHub (Apr 4, 2025): --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-multi-gpu-8.yaml this command is used for KT0.2.3 , if you sucessfully installl KT0.2.4 , you should use : DeepSeek-V3-Chat-fp8-linear-ggml-experts-serve.yaml or DeepSeek-V3-Chat-serve.yaml the two yaml all [add balance-serve] you can check origin code Last commit message : [https://github.com/kvcache-ai/ktransformers/tree/main/ktransformers/optimize/optimize_rules](url) i think this maybe the reason of error. i once the same error as you.
Author
Owner

@johndaily23 commented on GitHub (Apr 7, 2025):

I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make

<!-- gh-comment-id:2782160460 --> @johndaily23 commented on GitHub (Apr 7, 2025): I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make
Author
Owner

@NUSTHR commented on GitHub (Apr 7, 2025):

I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make

Hey bro. Did you revise all the CMake files? or just some of them?

<!-- gh-comment-id:2782215075 --> @NUSTHR commented on GitHub (Apr 7, 2025): > I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make Hey bro. Did you revise all the CMake files? or just some of them?
Author
Owner

@KathySkyer commented on GitHub (Apr 7, 2025):

I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make

Hey bro. Did you revise all the CMake files? or just some of them?

I got same issue, did you try it?and succed?

<!-- gh-comment-id:2782820857 --> @KathySkyer commented on GitHub (Apr 7, 2025): > > I got it running successfully by modifying from CXX11_ABI=0 to CXX11_ABI=1 in multiple cmake and .make files (search the whole codebase), and don't forget to set USE_BALANCE_SERVE=1 env before make > > Hey bro. Did you revise all the CMake files? or just some of them? I got same issue, did you try it?and succed?
Author
Owner

@lsm03624 commented on GitHub (Apr 8, 2025):

解决了一个个坑,又来一个坑,bug太多了。

<!-- gh-comment-id:2785237906 --> @lsm03624 commented on GitHub (Apr 8, 2025): 解决了一个个坑,又来一个坑,bug太多了。
Author
Owner

@AlbertG123 commented on GitHub (Apr 12, 2025):

用[devnen] 的方法,确实可以。把需要用到sched_ext的地方都拿掉.
bash ./install.sh 就可以build pass.
执行python ktransformers.local_chat --model_path deepseek-ai/DeepSeek-V2-Lite-Chat --gguf_path ./DeepSeek-V2-Lite-Chat-GGUF 可以pass. 可以正常chat.

<!-- gh-comment-id:2798843547 --> @AlbertG123 commented on GitHub (Apr 12, 2025): 用[devnen] 的方法,确实可以。把需要用到sched_ext的地方都拿掉. bash ./install.sh 就可以build pass. 执行python ktransformers.local_chat --model_path deepseek-ai/DeepSeek-V2-Lite-Chat --gguf_path ./DeepSeek-V2-Lite-Chat-GGUF 可以pass. 可以正常chat.
Author
Owner

@alfiy commented on GitHub (Apr 22, 2025):

我目前已经成功配置好ktransformers环境,但是运行模型时又出现,No module named 'sched_ext'错误。

<!-- gh-comment-id:2819778205 --> @alfiy commented on GitHub (Apr 22, 2025): 我目前已经成功配置好ktransformers环境,但是运行模型时又出现,No module named 'sched_ext'错误。
Author
Owner

@imjamespond commented on GitHub (May 5, 2025):

wsl ubuntu22 py311 simple install.sh同报这个错
NameError: name 'sched_ext' is not defined

<!-- gh-comment-id:2850381300 --> @imjamespond commented on GitHub (May 5, 2025): wsl ubuntu22 py311 simple install.sh同报这个错 `NameError: name 'sched_ext' is not defined`
Author
Owner

@chengcheng84 commented on GitHub (May 10, 2025):

no balance_serve
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/python/ktransformers/ktransformers/local_chat.py", line 25, in <module>
    from ktransformers.optimize.optimize import optimize_and_load_gguf
  File "/home/python/ktransformers/ktransformers/optimize/optimize.py", line 16, in <module>
    from ktransformers.util.utils import set_module, load_weights
  File "/home/python/ktransformers/ktransformers/util/utils.py", line 28, in <module>
    from ktransformers.models.custom_cache import StaticCache
  File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 278, in <module>
    class KGQACache(nn.Module):
  File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 296, in KGQACache
    def load(self, inference_context: sched_ext.InferenceContext):
NameError: name 'sched_ext' is not defined```
<!-- gh-comment-id:2868300253 --> @chengcheng84 commented on GitHub (May 10, 2025): ```python@localhost:~/ktransformers$ python -m ktransformers.local_chat --model_path /mnt/c/Users/Administrator/Downloads/Qwen3-30B-A3B --gguf_path ./ no balance_serve Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/python/ktransformers/ktransformers/local_chat.py", line 25, in <module> from ktransformers.optimize.optimize import optimize_and_load_gguf File "/home/python/ktransformers/ktransformers/optimize/optimize.py", line 16, in <module> from ktransformers.util.utils import set_module, load_weights File "/home/python/ktransformers/ktransformers/util/utils.py", line 28, in <module> from ktransformers.models.custom_cache import StaticCache File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 278, in <module> class KGQACache(nn.Module): File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 296, in KGQACache def load(self, inference_context: sched_ext.InferenceContext): NameError: name 'sched_ext' is not defined```
Author
Owner

@TTThanos commented on GitHub (May 12, 2025):

no balance_serve
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/python/ktransformers/ktransformers/local_chat.py", line 25, in <module>
    from ktransformers.optimize.optimize import optimize_and_load_gguf
  File "/home/python/ktransformers/ktransformers/optimize/optimize.py", line 16, in <module>
    from ktransformers.util.utils import set_module, load_weights
  File "/home/python/ktransformers/ktransformers/util/utils.py", line 28, in <module>
    from ktransformers.models.custom_cache import StaticCache
  File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 278, in <module>
    class KGQACache(nn.Module):
  File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 296, in KGQACache
    def load(self, inference_context: sched_ext.InferenceContext):
NameError: name 'sched_ext' is not defined```

我遇到了同样的问题
I have the same problem as above

<!-- gh-comment-id:2870974616 --> @TTThanos commented on GitHub (May 12, 2025): > ``` > no balance_serve > Traceback (most recent call last): > File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main > return _run_code(code, main_globals, None, > File "/usr/lib/python3.10/runpy.py", line 86, in _run_code > exec(code, run_globals) > File "/home/python/ktransformers/ktransformers/local_chat.py", line 25, in <module> > from ktransformers.optimize.optimize import optimize_and_load_gguf > File "/home/python/ktransformers/ktransformers/optimize/optimize.py", line 16, in <module> > from ktransformers.util.utils import set_module, load_weights > File "/home/python/ktransformers/ktransformers/util/utils.py", line 28, in <module> > from ktransformers.models.custom_cache import StaticCache > File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 278, in <module> > class KGQACache(nn.Module): > File "/home/python/ktransformers/ktransformers/models/custom_cache.py", line 296, in KGQACache > def load(self, inference_context: sched_ext.InferenceContext): > NameError: name 'sched_ext' is not defined``` > ``` 我遇到了同样的问题 I have the same problem as above
Author
Owner

@AlbertG123 commented on GitHub (May 12, 2025):

用[devnen] 的方法,确实可以。把需要用到sched_ext的地方都拿掉. bash ./install.sh 就可以build pass. 执行python ktransformers.local_chat --model_path deepseek-ai/DeepSeek-V2-Lite-Chat --gguf_path ./DeepSeek-V2-Lite-Chat-GGUF 可以pass. 可以正常chat.

0.24版本可以用这个办法解决,升级到0.3版本之后,就不行了.

<!-- gh-comment-id:2871076883 --> @AlbertG123 commented on GitHub (May 12, 2025): > 用[devnen] 的方法,确实可以。把需要用到sched_ext的地方都拿掉. bash ./install.sh 就可以build pass. 执行python ktransformers.local_chat --model_path deepseek-ai/DeepSeek-V2-Lite-Chat --gguf_path ./DeepSeek-V2-Lite-Chat-GGUF 可以pass. 可以正常chat. 0.24版本可以用这个办法解决,升级到0.3版本之后,就不行了.
Author
Owner

@hahali-li commented on GitHub (May 13, 2025):

Is there a solution for the issues that occurred in version v0.3?

<!-- gh-comment-id:2875190366 --> @hahali-li commented on GitHub (May 13, 2025): Is there a solution for the issues that occurred in version v0.3?
Author
Owner

@kuku-jiusgan commented on GitHub (May 14, 2025):

no balance_serve
Traceback (most recent call last):
File "/home/zoutengda/KT-conda/ktransformers/ktransformers/server/main.py", line 10, in
from ktransformers.server.args import ArgumentParser
File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in
from ktransformers.util.utils import get_free_ports
File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/util/utils.py", line 27, in
from ktransformers.models.custom_cache import StaticCache
File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 278, in
class KGQACache(nn.Module):
File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 296, in KGQACache
def load(self, inference_context: sched_ext.InferenceContext):
^^^^^^^^^
NameError: name 'sched_ext' is not defined

一样的问题(安装时使用了USE_BALANCE_SERVE=1),有无解决办法?

<!-- gh-comment-id:2879499865 --> @kuku-jiusgan commented on GitHub (May 14, 2025): no balance_serve Traceback (most recent call last): File "/home/zoutengda/KT-conda/ktransformers/ktransformers/server/main.py", line 10, in <module> from ktransformers.server.args import ArgumentParser File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in <module> from ktransformers.util.utils import get_free_ports File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/util/utils.py", line 27, in <module> from ktransformers.models.custom_cache import StaticCache File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 278, in <module> class KGQACache(nn.Module): File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 296, in KGQACache def load(self, inference_context: sched_ext.InferenceContext): ^^^^^^^^^ NameError: name 'sched_ext' is not defined 一样的问题(安装时使用了USE_BALANCE_SERVE=1),有无解决办法?
Author
Owner

@KathySkyer commented on GitHub (May 14, 2025):

no balance_serve Traceback (most recent call last): File "/home/zoutengda/KT-conda/ktransformers/ktransformers/server/main.py", line 10, in from ktransformers.server.args import ArgumentParser File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/util/utils.py", line 27, in from ktransformers.models.custom_cache import StaticCache File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 278, in class KGQACache(nn.Module): File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 296, in KGQACache def load(self, inference_context: sched_ext.InferenceContext): ^^^^^^^^^ NameError: name 'sched_ext' is not defined

一样的问题(安装时使用了USE_BALANCE_SERVE=1),有无解决办法?

回退到0.24版本就没有这个问题了,0.3不知道怎么解

<!-- gh-comment-id:2879545771 --> @KathySkyer commented on GitHub (May 14, 2025): > no balance_serve Traceback (most recent call last): File "/home/zoutengda/KT-conda/ktransformers/ktransformers/server/main.py", line 10, in from ktransformers.server.args import ArgumentParser File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/server/args.py", line 3, in from ktransformers.util.utils import get_free_ports File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/util/utils.py", line 27, in from ktransformers.models.custom_cache import StaticCache File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 278, in class KGQACache(nn.Module): File "/home/zoutengda/anaconda3/envs/kt0512/lib/python3.11/site-packages/ktransformers/models/custom_cache.py", line 296, in KGQACache def load(self, inference_context: sched_ext.InferenceContext): ^^^^^^^^^ NameError: name 'sched_ext' is not defined > > 一样的问题(安装时使用了USE_BALANCE_SERVE=1),有无解决办法? 回退到0.24版本就没有这个问题了,0.3不知道怎么解
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#718
No description provided.