[GH-ISSUE #1056] [Bug] v0.2.4post1 runs, but does not open port #744

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

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

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed.
  • 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed.

Describe the bug

I run:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1000 \
  --cache_lens 32768 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --backend_type balance_serve

result:

2025-04-05 19:51:53,699 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
sched_rpc started with PID: 7129
set start method
Connected to server at tcp://localhost:48033
2025-04-05 19:51:55,945 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
start method already set to spawn
Connected to server at tcp://localhost:48033
Getting inference context from sched_client.

Then nothing happens.

Reproduction

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1000 \
  --cache_lens 32768 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --backend_type balance_serve

Environment

OS: ubuntu 24.04.02
cuda:

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Fri_Feb_21_20:23:50_PST_2025
Cuda compilation tools, release 12.8, V12.8.93
Build cuda_12.8.r12.8/compiler.35583870_0

I have a 24gb 3090 gpu.

I have 768gb ram.

I'm running dual 9355 epyc CPUs, but I didn't specify USE_NUMA=1 during build because I have less than 1TB ram.

Originally created by @createthis on GitHub (Apr 5, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1056 ### Checklist - [x] 1. I have searched related issues but cannot get the expected help. - [x] 2. The bug has not been fixed in the latest version. - [x] 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback. - [x] 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed. - [x] 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed. ### Describe the bug I run: ```bash python ktransformers/server/main.py \ --port 11434 \ --model_path deepseek-ai/DeepSeek-V3-0324 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \ --max_new_tokens 1000 \ --cache_lens 32768 \ --chunk_size 256 \ --max_batch_size 4 \ --backend_type balance_serve ``` result: ``` 2025-04-05 19:51:53,699 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer sched_rpc started with PID: 7129 set start method Connected to server at tcp://localhost:48033 2025-04-05 19:51:55,945 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend found flashinfer start method already set to spawn Connected to server at tcp://localhost:48033 Getting inference context from sched_client. ``` Then nothing happens. ### Reproduction ``` python ktransformers/server/main.py \ --port 11434 \ --model_path deepseek-ai/DeepSeek-V3-0324 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \ --max_new_tokens 1000 \ --cache_lens 32768 \ --chunk_size 256 \ --max_batch_size 4 \ --backend_type balance_serve ``` ### Environment OS: ubuntu 24.04.02 cuda: ``` nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2025 NVIDIA Corporation Built on Fri_Feb_21_20:23:50_PST_2025 Cuda compilation tools, release 12.8, V12.8.93 Build cuda_12.8.r12.8/compiler.35583870_0 ``` I have a 24gb 3090 gpu. I have 768gb ram. I'm running dual 9355 epyc CPUs, but I didn't specify `USE_NUMA=1` during build because I have less than 1TB ram.
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

debian?

<!-- gh-comment-id:2781082308 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): debian?
Author
Owner

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

debian?

ubuntu 24.04.02

<!-- gh-comment-id:2781085858 --> @createthis commented on GitHub (Apr 5, 2025): > debian? ubuntu 24.04.02
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

I bet your problem is somehow connected to the flashinfer that you installed afterwards. As far as I understood they modified the flashinfer and named it custom_flashinfer. So you have to use their implementation.

<!-- gh-comment-id:2781087744 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): I bet your problem is somehow connected to the flashinfer that you installed afterwards. As far as I understood they modified the flashinfer and named it custom_flashinfer. So you have to use their implementation.
Author
Owner

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

When I run with:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --temperature 0.3 \
  --backend_type ktransformers

It starts, but when I run a query I get this:

Traceback (most recent call last):
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 734, in app
    await route.handle(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 74, in app
    await response(scope, receive, send)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 262, in __call__
    with collapse_excgroups():
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 266, in wrap
    await func()
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 246, in stream_response
    async for chunk in self.body_iterator:
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 80, in check_client_link
    async for event in async_events:
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 93, in to_stream_reply
    async for event in async_events:
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 87, in add_done
    async for event in async_events:
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 107, in filter_chat_chunk
    async for event in async_events:
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/api/openai/endpoints/chat.py", line 49, in inner
    async for res in interface.inference(input_message,id, create.temperature, create.top_p):
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 233, in inference
    async for v in super().inference(local_messages, thread_id, temperature, top_p):
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/transformers.py", line 405, in inference
    for t in self.prefill(input_ids, self.check_is_new(thread_id), temperature, top_p):
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 36, in generator_context
    response = gen.send(None)
               ^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 217, in prefill
    logits = chunk_prefill(input_ids[:, chunk_start:chunk_end], cache_position[chunk_start:chunk_end])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 200, in chunk_prefill
    logits = self.model(
             ^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/models/modeling_deepseek_v3.py", line 1689, in forward
    outputs = self.model(
              ^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/models.py", line 729, in forward
    layer_outputs = decoder_layer(
                    ^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/models/modeling_deepseek_v3.py", line 1206, in forward
    hidden_states, self_attn_weights, present_key_value = self.self_attn(
                                                          ^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/attention.py", line 613, in forward
    return self.forward_linux_flashinfer(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/attention.py", line 506, in forward_linux_flashinfer
    attn_output = flash_attn_func(
                  ^^^^^^^^^^^^^^^
NameError: name 'flash_attn_func' is not defined
<!-- gh-comment-id:2781088031 --> @createthis commented on GitHub (Apr 5, 2025): When I run with: ```bash python ktransformers/server/main.py \ --port 11434 \ --model_path deepseek-ai/DeepSeek-V3-0324 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --temperature 0.3 \ --backend_type ktransformers ``` It starts, but when I run a query I get this: ``` Traceback (most recent call last): File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__ raise exc File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ await self.app(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 734, in app await route.handle(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/routing.py", line 74, in app await response(scope, receive, send) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 262, in __call__ with collapse_excgroups(): File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/_utils.py", line 82, in collapse_excgroups raise exc File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 266, in wrap await func() File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/starlette/responses.py", line 246, in stream_response async for chunk in self.body_iterator: File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 80, in check_client_link async for event in async_events: File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 93, in to_stream_reply async for event in async_events: File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 87, in add_done async for event in async_events: File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/schemas/assistants/streaming.py", line 107, in filter_chat_chunk async for event in async_events: File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/api/openai/endpoints/chat.py", line 49, in inner async for res in interface.inference(input_message,id, create.temperature, create.top_p): File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 233, in inference async for v in super().inference(local_messages, thread_id, temperature, top_p): File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/transformers.py", line 405, in inference for t in self.prefill(input_ids, self.check_is_new(thread_id), temperature, top_p): File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 36, in generator_context response = gen.send(None) ^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 217, in prefill logits = chunk_prefill(input_ids[:, chunk_start:chunk_end], cache_position[chunk_start:chunk_end]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/ktransformers.py", line 200, in chunk_prefill logits = self.model( ^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/models/modeling_deepseek_v3.py", line 1689, in forward outputs = self.model( ^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/models.py", line 729, in forward layer_outputs = decoder_layer( ^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/models/modeling_deepseek_v3.py", line 1206, in forward hidden_states, self_attn_weights, present_key_value = self.self_attn( ^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/attention.py", line 613, in forward return self.forward_linux_flashinfer( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jesse/anaconda3/envs/ktransformers_mc/lib/python3.11/site-packages/ktransformers/operators/attention.py", line 506, in forward_linux_flashinfer attn_output = flash_attn_func( ^^^^^^^^^^^^^^^ NameError: name 'flash_attn_func' is not defined ```
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

have you used install.sh or the old build rules (from the prev release)?

<!-- gh-comment-id:2781088817 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): have you used install.sh or the old build rules (from the prev release)?
Author
Owner

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

have you used install.sh or the old build rules (from the prev release)?

I used this guide: https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/balance-serve.md

I also had to do this to get it to run: https://github.com/kvcache-ai/ktransformers/issues/1019#issuecomment-2781016513

<!-- gh-comment-id:2781090483 --> @createthis commented on GitHub (Apr 5, 2025): > have you used install.sh or the old build rules (from the prev release)? I used this guide: https://github.com/kvcache-ai/ktransformers/blob/main/doc/en/balance-serve.md I also had to do this to get it to run: https://github.com/kvcache-ai/ktransformers/issues/1019#issuecomment-2781016513
Author
Owner

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

Ok, I got this working:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --temperature 0.3 \
  --backend_type ktransformers

I had to do this first:

pip3 install flash_attn-2.7.4.post1+cu12torch2.6cxx11abiTRUE-cp311-cp311-linux_x86_64.whl
export CUDA_HOME=/usr/local/cuda
export TORCH_CUDA_ARCH_LIST="8.6"

Then I re-ran the above and it worked.

<!-- gh-comment-id:2781091632 --> @createthis commented on GitHub (Apr 5, 2025): Ok, I got this working: ```bash python ktransformers/server/main.py \ --port 11434 \ --model_path deepseek-ai/DeepSeek-V3-0324 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --temperature 0.3 \ --backend_type ktransformers ``` I had to do this first: ``` pip3 install flash_attn-2.7.4.post1+cu12torch2.6cxx11abiTRUE-cp311-cp311-linux_x86_64.whl export CUDA_HOME=/usr/local/cuda export TORCH_CUDA_ARCH_LIST="8.6" ``` Then I re-ran the above and it worked.
Author
Owner

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

--backend_type balance_serve is still not working though.

<!-- gh-comment-id:2781091954 --> @createthis commented on GitHub (Apr 5, 2025): `--backend_type balance_serve` is still not working though.
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

--backend_type balance_serve is still not working though.

You've done that, right?

(install.sh)

pip install third_party/custom_flashinfer/
<!-- gh-comment-id:2781092481 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): > `--backend_type balance_serve` is still not working though. You've done that, right? (install.sh) ```bash pip install third_party/custom_flashinfer/ ```
Author
Owner

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

You've done that, right?

(install.sh)

pip install third_party/custom_flashinfer/

Yes. I tried it manually just now and it had no affect.

<!-- gh-comment-id:2781093456 --> @createthis commented on GitHub (Apr 5, 2025): > You've done that, right? > > (install.sh) > > pip install third_party/custom_flashinfer/ Yes. I tried it manually just now and it had no affect.
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

You've done that, right?
(install.sh)
pip install third_party/custom_flashinfer/

Yes. I tried it manually just now and it had no affect.

Would you please post the output of

pip list

?

<!-- gh-comment-id:2781095172 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): > > You've done that, right? > > (install.sh) > > pip install third_party/custom_flashinfer/ > > Yes. I tried it manually just now and it had no affect. Would you please post the output of ```bash pip list ``` ?
Author
Owner

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

(ktransformers_mc) jesse@larry:~$ pip3 list
Package                  Version
------------------------ -----------------------------
accelerate               1.6.0
annotated-types          0.7.0
anyio                    4.9.0
blessed                  1.20.0
blobfile                 3.0.0
build                    1.2.2.post1
certifi                  2025.1.31
charset-normalizer       3.4.1
click                    8.1.8
colorlog                 6.9.0
cpufeature               0.2.1
distro                   1.9.0
einops                   0.8.1
fastapi                  0.115.12
filelock                 3.13.1
fire                     0.7.0
flash_attn               2.7.4.post1
flashinfer-python        0.2.3
fsspec                   2024.6.1
greenlet                 3.1.1
h11                      0.14.0
httpcore                 1.0.7
httpx                    0.28.1
huggingface-hub          0.30.1
idna                     3.10
Jinja2                   3.1.4
jiter                    0.9.0
jsonpatch                1.33
jsonpointer              3.0.0
ktransformers            0.2.4.post1+cu128torch26fancy
langchain                0.3.23
langchain-core           0.3.51
langchain-text-splitters 0.3.8
langsmith                0.3.24
lxml                     5.3.1
MarkupSafe               2.1.5
mpmath                   1.3.0
networkx                 3.3
ninja                    1.11.1.4
numpy                    2.2.4
nvidia-cublas-cu12       12.6.4.1
nvidia-cuda-cupti-cu12   12.6.80
nvidia-cuda-nvrtc-cu12   12.6.77
nvidia-cuda-runtime-cu12 12.6.77
nvidia-cudnn-cu12        9.5.1.17
nvidia-cufft-cu12        11.3.0.4
nvidia-curand-cu12       10.3.7.77
nvidia-cusolver-cu12     11.7.1.2
nvidia-cusparse-cu12     12.5.4.2
nvidia-cusparselt-cu12   0.6.3
nvidia-nccl-cu12         2.21.5
nvidia-nvjitlink-cu12    12.6.85
nvidia-nvtx-cu12         12.6.77
openai                   1.70.0
orjson                   3.10.16
packaging                24.2
pillow                   11.0.0
pip                      25.0
protobuf                 6.30.2
psutil                   7.0.0
pycryptodomex            3.22.0
pydantic                 2.11.2
pydantic_core            2.33.1
pyproject_hooks          1.2.0
PyYAML                   6.0.2
pyzmq                    26.4.0
regex                    2024.11.6
requests                 2.32.3
requests-toolbelt        1.0.0
safetensors              0.5.3
sentencepiece            0.2.0
setuptools               75.8.0
six                      1.17.0
sniffio                  1.3.1
SQLAlchemy               2.0.40
starlette                0.46.1
sympy                    1.13.1
tenacity                 9.1.2
termcolor                3.0.1
tiktoken                 0.9.0
tokenizers               0.19.1
torch                    2.6.0+cu126
torchaudio               2.6.0+cu126
torchvision              0.21.0+cu126
tqdm                     4.67.1
transformers             4.43.2
triton                   3.2.0
typing_extensions        4.13.1
typing-inspection        0.4.0
urllib3                  2.3.0
uvicorn                  0.34.0
wcwidth                  0.2.13
wheel                    0.45.1
zmq                      0.0.0
zstandard                0.23.0
(ktransformers_mc) jesse@larry:~$
<!-- gh-comment-id:2781098757 --> @createthis commented on GitHub (Apr 5, 2025): ```bash (ktransformers_mc) jesse@larry:~$ pip3 list Package Version ------------------------ ----------------------------- accelerate 1.6.0 annotated-types 0.7.0 anyio 4.9.0 blessed 1.20.0 blobfile 3.0.0 build 1.2.2.post1 certifi 2025.1.31 charset-normalizer 3.4.1 click 8.1.8 colorlog 6.9.0 cpufeature 0.2.1 distro 1.9.0 einops 0.8.1 fastapi 0.115.12 filelock 3.13.1 fire 0.7.0 flash_attn 2.7.4.post1 flashinfer-python 0.2.3 fsspec 2024.6.1 greenlet 3.1.1 h11 0.14.0 httpcore 1.0.7 httpx 0.28.1 huggingface-hub 0.30.1 idna 3.10 Jinja2 3.1.4 jiter 0.9.0 jsonpatch 1.33 jsonpointer 3.0.0 ktransformers 0.2.4.post1+cu128torch26fancy langchain 0.3.23 langchain-core 0.3.51 langchain-text-splitters 0.3.8 langsmith 0.3.24 lxml 5.3.1 MarkupSafe 2.1.5 mpmath 1.3.0 networkx 3.3 ninja 1.11.1.4 numpy 2.2.4 nvidia-cublas-cu12 12.6.4.1 nvidia-cuda-cupti-cu12 12.6.80 nvidia-cuda-nvrtc-cu12 12.6.77 nvidia-cuda-runtime-cu12 12.6.77 nvidia-cudnn-cu12 9.5.1.17 nvidia-cufft-cu12 11.3.0.4 nvidia-curand-cu12 10.3.7.77 nvidia-cusolver-cu12 11.7.1.2 nvidia-cusparse-cu12 12.5.4.2 nvidia-cusparselt-cu12 0.6.3 nvidia-nccl-cu12 2.21.5 nvidia-nvjitlink-cu12 12.6.85 nvidia-nvtx-cu12 12.6.77 openai 1.70.0 orjson 3.10.16 packaging 24.2 pillow 11.0.0 pip 25.0 protobuf 6.30.2 psutil 7.0.0 pycryptodomex 3.22.0 pydantic 2.11.2 pydantic_core 2.33.1 pyproject_hooks 1.2.0 PyYAML 6.0.2 pyzmq 26.4.0 regex 2024.11.6 requests 2.32.3 requests-toolbelt 1.0.0 safetensors 0.5.3 sentencepiece 0.2.0 setuptools 75.8.0 six 1.17.0 sniffio 1.3.1 SQLAlchemy 2.0.40 starlette 0.46.1 sympy 1.13.1 tenacity 9.1.2 termcolor 3.0.1 tiktoken 0.9.0 tokenizers 0.19.1 torch 2.6.0+cu126 torchaudio 2.6.0+cu126 torchvision 0.21.0+cu126 tqdm 4.67.1 transformers 4.43.2 triton 3.2.0 typing_extensions 4.13.1 typing-inspection 0.4.0 urllib3 2.3.0 uvicorn 0.34.0 wcwidth 0.2.13 wheel 0.45.1 zmq 0.0.0 zstandard 0.23.0 (ktransformers_mc) jesse@larry:~$ ```
Author
Owner

@magikRUKKOLA commented on GitHub (Apr 5, 2025):

what about

cmake --version

?

<!-- gh-comment-id:2781103108 --> @magikRUKKOLA commented on GitHub (Apr 5, 2025): what about ```bash cmake --version ``` ?
Author
Owner

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

(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ cmake --version
cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ 
<!-- gh-comment-id:2781104875 --> @createthis commented on GitHub (Apr 5, 2025): ``` (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ cmake --version cmake version 3.28.3 CMake suite maintained and supported by Kitware (kitware.com/cmake). (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ ```
Author
Owner

@datouxia commented on GitHub (Apr 6, 2025):

Try to download DeepSeek/deepseek-v3-0324 directory small size files into a directory, which must use "DeepSeek-V3" as the end part of your model_path like this one:

"--model_path /data/DeepSeek-V3",

Otherwise the server process look likes blocked forever.

<!-- gh-comment-id:2781275144 --> @datouxia commented on GitHub (Apr 6, 2025): Try to download [DeepSeek/deepseek-v3-0324 directory](https://huggingface.co/deepseek-ai/DeepSeek-V3-0324/tree/main) small size files into a directory, which must use "DeepSeek-V3" as the end part of your model_path like this one: "--model_path /data/DeepSeek-V3", Otherwise the server process look likes blocked forever.
Author
Owner

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

@datouxia I downloaded the small files and tried this:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1024 \
  --cache_lens 32768 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --temperature 0.3 \
  --backend_type balance_serve

It just hangs. Here's /data/DeepSeek-V3-0324/q4_files/Q4_K_M:

(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ ls -al /data/DeepSeek-V3-0324/q4_files/Q4_K_M
total 394951496
drwxrwxr-x 2 jesse jesse        4096 Apr  6 18:07 .
drwxrwxr-x 4 jesse jesse        4096 Apr  3 00:15 ..
-rw-rw-r-- 1 jesse jesse        1660 Apr  6 18:04 config.json
-rw-rw-r-- 1 jesse jesse        9897 Apr  6 18:06 configuration_deepseek.py
-rw-rw-r-- 1 jesse jesse 48339780320 Apr  3 00:12 DeepSeek-V3-0324-Q4_K_M-00001-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 49429396320 Apr  3 00:13 DeepSeek-V3-0324-Q4_K_M-00002-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 49527312640 Apr  3 00:11 DeepSeek-V3-0324-Q4_K_M-00003-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 48272509536 Apr  3 00:09 DeepSeek-V3-0324-Q4_K_M-00004-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 49422027488 Apr  3 00:15 DeepSeek-V3-0324-Q4_K_M-00005-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 48272509536 Apr  2 23:50 DeepSeek-V3-0324-Q4_K_M-00006-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 49429396320 Apr  2 23:43 DeepSeek-V3-0324-Q4_K_M-00007-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 46938773696 Apr  3 00:08 DeepSeek-V3-0324-Q4_K_M-00008-of-00009.gguf
-rw-rw-r-- 1 jesse jesse 14798482144 Apr  3 00:15 DeepSeek-V3-0324-Q4_K_M-00009-of-00009.gguf
-rw-rw-r-- 1 jesse jesse        1064 Apr  6 18:07 LICENSE
-rw-rw-r-- 1 jesse jesse       10655 Apr  6 18:07 README.md
(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$
<!-- gh-comment-id:2781541075 --> @createthis commented on GitHub (Apr 6, 2025): @datouxia I downloaded the small files and tried this: ```bash python ktransformers/server/main.py \ --port 11434 \ --model_path deepseek-ai/DeepSeek-V3 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \ --max_new_tokens 1024 \ --cache_lens 32768 \ --chunk_size 256 \ --max_batch_size 4 \ --temperature 0.3 \ --backend_type balance_serve ``` It just hangs. Here's `/data/DeepSeek-V3-0324/q4_files/Q4_K_M`: ```bash (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ ls -al /data/DeepSeek-V3-0324/q4_files/Q4_K_M total 394951496 drwxrwxr-x 2 jesse jesse 4096 Apr 6 18:07 . drwxrwxr-x 4 jesse jesse 4096 Apr 3 00:15 .. -rw-rw-r-- 1 jesse jesse 1660 Apr 6 18:04 config.json -rw-rw-r-- 1 jesse jesse 9897 Apr 6 18:06 configuration_deepseek.py -rw-rw-r-- 1 jesse jesse 48339780320 Apr 3 00:12 DeepSeek-V3-0324-Q4_K_M-00001-of-00009.gguf -rw-rw-r-- 1 jesse jesse 49429396320 Apr 3 00:13 DeepSeek-V3-0324-Q4_K_M-00002-of-00009.gguf -rw-rw-r-- 1 jesse jesse 49527312640 Apr 3 00:11 DeepSeek-V3-0324-Q4_K_M-00003-of-00009.gguf -rw-rw-r-- 1 jesse jesse 48272509536 Apr 3 00:09 DeepSeek-V3-0324-Q4_K_M-00004-of-00009.gguf -rw-rw-r-- 1 jesse jesse 49422027488 Apr 3 00:15 DeepSeek-V3-0324-Q4_K_M-00005-of-00009.gguf -rw-rw-r-- 1 jesse jesse 48272509536 Apr 2 23:50 DeepSeek-V3-0324-Q4_K_M-00006-of-00009.gguf -rw-rw-r-- 1 jesse jesse 49429396320 Apr 2 23:43 DeepSeek-V3-0324-Q4_K_M-00007-of-00009.gguf -rw-rw-r-- 1 jesse jesse 46938773696 Apr 3 00:08 DeepSeek-V3-0324-Q4_K_M-00008-of-00009.gguf -rw-rw-r-- 1 jesse jesse 14798482144 Apr 3 00:15 DeepSeek-V3-0324-Q4_K_M-00009-of-00009.gguf -rw-rw-r-- 1 jesse jesse 1064 Apr 6 18:07 LICENSE -rw-rw-r-- 1 jesse jesse 10655 Apr 6 18:07 README.md (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ ```
Author
Owner

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

lol. I was debugging this with DeepSeek-R1 today and it rightly pointed out that I'm using Cuda 12.8 with Pytorch built for Cuda 12.6. 🤦

I'll fix it and report back.

UPDATE1:

I installed the nightly cu128 torch and rebuilt everything:

(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ pip3 list | grep torch
ktransformers            0.2.4.post1+cu128torch28fancy
pytorch-triton           3.3.0+git96316ce5
torch                    2.8.0.dev20250406+cu128
torchaudio               2.6.0.dev20250406+cu128
torchvision              0.22.0.dev20250406+cu128
(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$

But it still hung.

Will try downgrading to Cuda 12.6 next.

UPDATE2:

Downgrading to Cuda 12.6 did not help. It still hangs.

(ktransformers_mc26) jesse@larry:~$ pip3 list | grep torch
ktransformers            0.2.4.post1+cu126torch26fancy
torch                    2.6.0+cu126
torchaudio               2.6.0+cu126
torchvision              0.21.0+cu126
(ktransformers_mc26) jesse@larry:~$ 
<!-- gh-comment-id:2781729514 --> @createthis commented on GitHub (Apr 6, 2025): lol. I was debugging this with DeepSeek-R1 today and it rightly pointed out that I'm using Cuda 12.8 with Pytorch built for Cuda 12.6. 🤦 I'll fix it and report back. UPDATE1: I installed the nightly cu128 torch and rebuilt everything: ```bash (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ pip3 list | grep torch ktransformers 0.2.4.post1+cu128torch28fancy pytorch-triton 3.3.0+git96316ce5 torch 2.8.0.dev20250406+cu128 torchaudio 2.6.0.dev20250406+cu128 torchvision 0.22.0.dev20250406+cu128 (ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ ``` But it still hung. Will try downgrading to Cuda 12.6 next. UPDATE2: Downgrading to Cuda 12.6 did not help. It still hangs. ```bash (ktransformers_mc26) jesse@larry:~$ pip3 list | grep torch ktransformers 0.2.4.post1+cu126torch26fancy torch 2.6.0+cu126 torchaudio 2.6.0+cu126 torchvision 0.21.0+cu126 (ktransformers_mc26) jesse@larry:~$ ```
Author
Owner

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

model_path

Hi @createthis, could you please post the files under model_path(deepseek-ai/DeepSeek-V3)?

<!-- gh-comment-id:2781857499 --> @qiyuxinlin commented on GitHub (Apr 7, 2025): > model_path Hi @createthis, could you please post the files under model_path(deepseek-ai/DeepSeek-V3)?
Author
Owner

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

@datouxia I just realized I misread your message. Apologies. You were correct. It's working now!

(ktransformers_mc26) jesse@larry:/data/DeepSeek-V3$ ls -al /data/DeepSeek-V3
total 7784
drwxrwxr-x 2 jesse jesse    4096 Apr  7 02:31 .
drwxr-xr-x 8 jesse jesse    4096 Apr  7 02:28 ..
-rw-rw-r-- 1 jesse jesse    1660 Apr  7 02:20 config.json
-rw-rw-r-- 1 jesse jesse    9897 Apr  7 02:21 configuration_deepseek.py
-rw-rw-r-- 1 jesse jesse    1064 Apr  7 02:21 LICENSE
-rw-rw-r-- 1 jesse jesse   75741 Apr  7 02:30 modeling_deepseek.py
-rw-rw-r-- 1 jesse jesse   10655 Apr  7 02:21 README.md
-rw-rw-r-- 1 jesse jesse    3883 Apr  7 02:31 tokenizer_config.json
-rw-rw-r-- 1 jesse jesse 7847652 Apr  7 02:30 tokenizer.json
(ktransformers_mc26) jesse@larry:/data/DeepSeek-V3$ 
python ktransformers/server/main.py \
  --port 11434 \
  --model_path /data/DeepSeek-V3 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1024 \
  --cpu_infer 62 \
  --cache_lens 131072 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --temperature 0.3 \
  --backend_type balance_serve
<!-- gh-comment-id:2781883051 --> @createthis commented on GitHub (Apr 7, 2025): @datouxia I just realized I misread your message. Apologies. You were correct. It's working now! ```bash (ktransformers_mc26) jesse@larry:/data/DeepSeek-V3$ ls -al /data/DeepSeek-V3 total 7784 drwxrwxr-x 2 jesse jesse 4096 Apr 7 02:31 . drwxr-xr-x 8 jesse jesse 4096 Apr 7 02:28 .. -rw-rw-r-- 1 jesse jesse 1660 Apr 7 02:20 config.json -rw-rw-r-- 1 jesse jesse 9897 Apr 7 02:21 configuration_deepseek.py -rw-rw-r-- 1 jesse jesse 1064 Apr 7 02:21 LICENSE -rw-rw-r-- 1 jesse jesse 75741 Apr 7 02:30 modeling_deepseek.py -rw-rw-r-- 1 jesse jesse 10655 Apr 7 02:21 README.md -rw-rw-r-- 1 jesse jesse 3883 Apr 7 02:31 tokenizer_config.json -rw-rw-r-- 1 jesse jesse 7847652 Apr 7 02:30 tokenizer.json (ktransformers_mc26) jesse@larry:/data/DeepSeek-V3$ ``` ```bash python ktransformers/server/main.py \ --port 11434 \ --model_path /data/DeepSeek-V3 \ --model_name "DeepSeek-V3-0324:671b-q4_k_m" \ --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \ --max_new_tokens 1024 \ --cpu_infer 62 \ --cache_lens 131072 \ --chunk_size 256 \ --max_batch_size 4 \ --temperature 0.3 \ --backend_type balance_serve ```
Author
Owner

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

Try to download DeepSeek/deepseek-v3-0324 directory small size files into a directory, which must use "DeepSeek-V3" as the end part of your model_path like this one:

"--model_path /data/DeepSeek-V3",

Otherwise the server process look likes blocked forever.

It works! amazing

<!-- gh-comment-id:2783155955 --> @NUSTHR commented on GitHub (Apr 7, 2025): > Try to download [DeepSeek/deepseek-v3-0324 directory](https://huggingface.co/deepseek-ai/DeepSeek-V3-0324/tree/main) small size files into a directory, which must use "DeepSeek-V3" as the end part of your model_path like this one: > > "--model_path /data/DeepSeek-V3", > > Otherwise the server process look likes blocked forever. It works! amazing
Author
Owner

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

I'm running ktransformers v0.3 and trying to run the Qwen3-235B-A22B model. I had the same issue where starting server.py would hang at Getting inference context from sched_client.

Downloading all the non-safetensor files from Qwen/Qwen3-235B-A22B into a folder and specifying that folder for --model-path fixed the issue.

<!-- gh-comment-id:2868604821 --> @hemanthpai commented on GitHub (May 10, 2025): I'm running ktransformers v0.3 and trying to run the Qwen3-235B-A22B model. I had the same issue where starting server.py would hang at Getting inference context from sched_client. Downloading all the non-safetensor files from Qwen/Qwen3-235B-A22B into a folder and specifying that folder for --model-path fixed the issue.
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#744
No description provided.