[GH-ISSUE #1269] [Question] benchmark with evalscope failed #859

Open
opened 2026-10-29 14:45:28 +00:00 by bsakaguchi · 7 comments
Owner

Originally created by @ant-ob-hengtang on GitHub (May 7, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1269

I meet a CUDA error when running benchmark with evalscope QAQ~
cmd:

evalscope perf     --url "http://127.0.0.1:10002/v1/chat/completions"     --parallel 1     --model DeepSeek-Coder-V2-Instruct     --number 4     --api openai     --dataset openqa     --stream     --tokenizer-path /data/modelscope/ds-r1

err logs:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 249, in run_engine
    engine.loop()
  File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 227, in loop
    generated_tokens, probs = self.sampling( self.model_runner.output)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 191, in sampling
    generated_tokens, probs=self.sampler(logit, sample_options)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/balance_serve/inference/sampling/sampler.py", line 97, in forward
    temperature_0_idx = torch.where(sampling_config.temperatures == 0)[0]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

terminate called after throwing an instance of 'c10::Error'
  what():  CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Exception raised from c10_cuda_check_implementation at ../c10/cuda/CUDAException.cpp:43 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x96 (0x7fdf8b76c446 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&) + 0x64 (0x7fdf8b7166e4 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x118 (0x7fdf8bb5ba18 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #3: <unknown function> + 0x28d2c (0x7fdf8bb2bd2c in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #4: <unknown function> + 0x29011 (0x7fdf8bb2c011 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #5: <unknown function> + 0x820d88 (0x7fdf8a620d88 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #6: <unknown function> + 0x5fc138 (0x7fdf8a3fc138 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #7: <unknown function> + 0x6f66d (0x7fdf8b74d66d in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #8: c10::TensorImpl::~TensorImpl() + 0x21b (0x7fdf8b74637b in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #9: c10::TensorImpl::~TensorImpl() + 0x9 (0x7fdf8b746529 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #10: <unknown function> + 0x8c9c38 (0x7fdf8a6c9c38 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #11: THPVariable_subclass_dealloc(_object*) + 0x2c6 (0x7fdf8a6c9f86 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #12: <unknown function> + 0x1c8123 (0x56245adc8123 in /opt/conda/bin/python3.11)
frame #13: <unknown function> + 0x1d553c (0x56245add553c in /opt/conda/bin/python3.11)
frame #14: <unknown function> + 0x230178 (0x56245ae30178 in /opt/conda/bin/python3.11)
frame #15: <unknown function> + 0x1d53a2 (0x56245add53a2 in /opt/conda/bin/python3.11)
frame #16: <unknown function> + 0x1d53a2 (0x56245add53a2 in /opt/conda/bin/python3.11)
frame #17: <unknown function> + 0x230178 (0x56245ae30178 in /opt/conda/bin/python3.11)
frame #18: <unknown function> + 0x22fefb (0x56245ae2fefb in /opt/conda/bin/python3.11)
frame #19: <unknown function> + 0x22ffce (0x56245ae2ffce in /opt/conda/bin/python3.11)
frame #20: <unknown function> + 0x210b1f (0x56245ae10b1f in /opt/conda/bin/python3.11)
frame #21: <unknown function> + 0x20f3b7 (0x56245ae0f3b7 in /opt/conda/bin/python3.11)
frame #22: <unknown function> + 0x20f3f2 (0x56245ae0f3f2 in /opt/conda/bin/python3.11)
frame #23: <unknown function> + 0x20f3f2 (0x56245ae0f3f2 in /opt/conda/bin/python3.11)
frame #24: <unknown function> + 0x21e074 (0x56245ae1e074 in /opt/conda/bin/python3.11)
frame #25: _PyEval_EvalFrameDefault + 0x478a (0x56245ade808a in /opt/conda/bin/python3.11)
frame #26: <unknown function> + 0x29ac5d (0x56245ae9ac5d in /opt/conda/bin/python3.11)
frame #27: PyEval_EvalCode + 0x9f (0x56245ae9a39f in /opt/conda/bin/python3.11)

ENV

cpu:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  2
Core(s) per socket:  32
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               143
Model name:          Intel(R) Xeon(R) Gold 6462C

GPU:
L20 * 8 (just use 1)

mem:
2T DDR5 5600 MT/s

docker images:

approachingai/ktransformers:v0.2.4post1-AVX512

to use 2cpus and NUMA, I build ktransformers in container again by

env USE_BALANCE_SERVE=1 USE_NUMA=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh
Originally created by @ant-ob-hengtang on GitHub (May 7, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1269 I meet a CUDA error when running benchmark with evalscope QAQ~ cmd: ``` evalscope perf --url "http://127.0.0.1:10002/v1/chat/completions" --parallel 1 --model DeepSeek-Coder-V2-Instruct --number 4 --api openai --dataset openqa --stream --tokenizer-path /data/modelscope/ds-r1 ``` err logs: ``` Traceback (most recent call last): File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/opt/conda/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 249, in run_engine engine.loop() File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 227, in loop generated_tokens, probs = self.sampling( self.model_runner.output) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 191, in sampling generated_tokens, probs=self.sampler(logit, sample_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/ktransformers/server/balance_serve/inference/sampling/sampler.py", line 97, in forward temperature_0_idx = torch.where(sampling_config.temperatures == 0)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. terminate called after throwing an instance of 'c10::Error' what(): CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. Exception raised from c10_cuda_check_implementation at ../c10/cuda/CUDAException.cpp:43 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x96 (0x7fdf8b76c446 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&) + 0x64 (0x7fdf8b7166e4 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so) frame #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x118 (0x7fdf8bb5ba18 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #3: <unknown function> + 0x28d2c (0x7fdf8bb2bd2c in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #4: <unknown function> + 0x29011 (0x7fdf8bb2c011 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #5: <unknown function> + 0x820d88 (0x7fdf8a620d88 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #6: <unknown function> + 0x5fc138 (0x7fdf8a3fc138 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #7: <unknown function> + 0x6f66d (0x7fdf8b74d66d in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so) frame #8: c10::TensorImpl::~TensorImpl() + 0x21b (0x7fdf8b74637b in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so) frame #9: c10::TensorImpl::~TensorImpl() + 0x9 (0x7fdf8b746529 in /opt/conda/lib/python3.11/site-packages/torch/lib/libc10.so) frame #10: <unknown function> + 0x8c9c38 (0x7fdf8a6c9c38 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #11: THPVariable_subclass_dealloc(_object*) + 0x2c6 (0x7fdf8a6c9f86 in /opt/conda/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #12: <unknown function> + 0x1c8123 (0x56245adc8123 in /opt/conda/bin/python3.11) frame #13: <unknown function> + 0x1d553c (0x56245add553c in /opt/conda/bin/python3.11) frame #14: <unknown function> + 0x230178 (0x56245ae30178 in /opt/conda/bin/python3.11) frame #15: <unknown function> + 0x1d53a2 (0x56245add53a2 in /opt/conda/bin/python3.11) frame #16: <unknown function> + 0x1d53a2 (0x56245add53a2 in /opt/conda/bin/python3.11) frame #17: <unknown function> + 0x230178 (0x56245ae30178 in /opt/conda/bin/python3.11) frame #18: <unknown function> + 0x22fefb (0x56245ae2fefb in /opt/conda/bin/python3.11) frame #19: <unknown function> + 0x22ffce (0x56245ae2ffce in /opt/conda/bin/python3.11) frame #20: <unknown function> + 0x210b1f (0x56245ae10b1f in /opt/conda/bin/python3.11) frame #21: <unknown function> + 0x20f3b7 (0x56245ae0f3b7 in /opt/conda/bin/python3.11) frame #22: <unknown function> + 0x20f3f2 (0x56245ae0f3f2 in /opt/conda/bin/python3.11) frame #23: <unknown function> + 0x20f3f2 (0x56245ae0f3f2 in /opt/conda/bin/python3.11) frame #24: <unknown function> + 0x21e074 (0x56245ae1e074 in /opt/conda/bin/python3.11) frame #25: _PyEval_EvalFrameDefault + 0x478a (0x56245ade808a in /opt/conda/bin/python3.11) frame #26: <unknown function> + 0x29ac5d (0x56245ae9ac5d in /opt/conda/bin/python3.11) frame #27: PyEval_EvalCode + 0x9f (0x56245ae9a39f in /opt/conda/bin/python3.11) ``` ENV ``` cpu: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Thread(s) per core: 2 Core(s) per socket: 32 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 143 Model name: Intel(R) Xeon(R) Gold 6462C GPU: L20 * 8 (just use 1) mem: 2T DDR5 5600 MT/s ``` docker images: ``` approachingai/ktransformers:v0.2.4post1-AVX512 ``` to use 2cpus and NUMA, I build ktransformers in container again by ``` env USE_BALANCE_SERVE=1 USE_NUMA=1 PYTHONPATH="$(which python)" PATH="$(dirname $(which python)):$PATH" bash ./install.sh ```
Author
Owner

@ant-ob-hengtang commented on GitHub (May 7, 2025):

and my start cmd is
ktransformers --model_path /data/modelscope/ds-r1 --gguf_path /data/modelscope/ds-r1-q4km/DeepSeek-R1-Q4_K_M --cpu_infer 65 --port 10002 --max_new_tokens 16384 --model_name deepseek-r1 --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml --cache_lens 65536 --chunk_size 256 --cache_q4 true --max_batch_size 4 --force_think --backend_type balance_serve

anyone else meet this err? 中文交流也很ok

<!-- gh-comment-id:2857217012 --> @ant-ob-hengtang commented on GitHub (May 7, 2025): and my start cmd is ktransformers --model_path /data/modelscope/ds-r1 --gguf_path /data/modelscope/ds-r1-q4km/DeepSeek-R1-Q4_K_M --cpu_infer 65 --port 10002 --max_new_tokens 16384 --model_name deepseek-r1 --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml --cache_lens 65536 --chunk_size 256 --cache_q4 true --max_batch_size 4 --force_think --backend_type balance_serve anyone else meet this err? 中文交流也很ok
Author
Owner

@liuwenzhoa commented on GitHub (May 7, 2025):

一样的错误,我是用的是 unsloth/Qwen3-30B-A3B-128K-GGUF-IQ2_XXS,换成Q2_K_L就好了。

2025-05-07 13:07:33,117 INFO /root/autodl-tmp/ktransformers/ktransformers/server/main.py[23]: Creating SQL tables
2025-05-07 13:07:33,121 INFO /root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/api/openai/assistants/assistants.py[75]: Creating default assistant
INFO: Started server process [154315]
INFO: Waiting for application startup.
Queue Proxy Started
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:10002 (Press CTRL+C to quit)
/root/miniconda3/envs/kt311/lib/python3.11/site-packages/pydantic/main.py:519: UserWarning: Pydantic serializer warnings:
PydanticSerializationUnexpectedValue(Expected list[dict[str, any]] - serialized value may not be as expected [input_value={}, input_type=dict])
return self.pydantic_serializer.to_json(
2025-05-07 13:08:16,440 DEBUG /root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[418]: get input ids of shape torch.Size([1, 16])
add query id: 1, batch.query_lengths: 16, batch_query_tokens: torch.Size([516]), batch.block_indexes: tensor([0, 1, 2], dtype=torch.int32)
prefill_batch_i: 16,
padded_batch_size 57 capture_padded_batch_size 57
Model execution time (GPU): 1249.500 ms, 0.800 tokens/s
2025-05-07 13:08:17,723 - INFO - flashinfer.jit: Loading JIT ops: sampling
2025-05-07 13:08:17,833 - INFO - flashinfer.jit: Finished loading JIT ops: sampling
59693
decode_batch_i: 1,
padded_batch_size 57 capture_padded_batch_size 57
Model execution time (GPU): 352.752 ms, 2.835 tokens/s
Process SpawnProcess-1:
Traceback (most recent call last):
File "/root/miniconda3/envs/kt311/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/root/miniconda3/envs/kt311/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 282, in run_engine
engine.loop()
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 260, in loop
generated_tokens, probs = self.sampling( self.model_runner.output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 224, in sampling
generated_tokens, probs=self.sampler(logit, sample_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/balance_serve/inference/sampling/sampler.py", line 97, in forward
temperature_0_idx = torch.where(sampling_config.temperatures == 0)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

terminate called after throwing an instance of 'c10::Error'
what(): CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

Exception raised from c10_cuda_check_implementation at /pytorch/c10/cuda/CUDAException.cpp:43 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) + 0x98 (0x7f93edd785e8 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0xe0 (0x7f93edd0d4a2 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x3c2 (0x7f93ee10b422 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #3: + 0x32953 (0x7f93ee0e7953 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #4: + 0x32b01 (0x7f93ee0e7b01 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so)
frame #5: + 0x66c7f2 (0x7f93e59bb7f2 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #6: + 0x457608 (0x7f93e57a6608 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #7: + 0x7b385 (0x7f93edd59385 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #8: c10::TensorImpl::~TensorImpl() + 0x9 (0x7f93edd52f39 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so)
frame #9: + 0x7182b8 (0x7f93e5a672b8 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #10: + 0x7186d1 (0x7f93e5a676d1 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so)
frame #11: /root/miniconda3/envs/kt311/bin/python() [0x4f5eb7]
frame #12: /root/miniconda3/envs/kt311/bin/python() [0x5031bf]
frame #13: /root/miniconda3/envs/kt311/bin/python() [0x55f246]
frame #14: /root/miniconda3/envs/kt311/bin/python() [0x50302a]
frame #15: /root/miniconda3/envs/kt311/bin/python() [0x5031bf]
frame #16: /root/miniconda3/envs/kt311/bin/python() [0x55f246]
frame #17: /root/miniconda3/envs/kt311/bin/python() [0x55ef87]
frame #18: /root/miniconda3/envs/kt311/bin/python() [0x55f040]
frame #19: /root/miniconda3/envs/kt311/bin/python() [0x541355]
frame #20: /root/miniconda3/envs/kt311/bin/python() [0x53fd88]
frame #21: /root/miniconda3/envs/kt311/bin/python() [0x53fdc4]
frame #22: /root/miniconda3/envs/kt311/bin/python() [0x53fdc4]
frame #23: /root/miniconda3/envs/kt311/bin/python() [0x54e833]
frame #24: _PyEval_EvalFrameDefault + 0x46f9 (0x515ac9 in /root/miniconda3/envs/kt311/bin/python)
frame #25: /root/miniconda3/envs/kt311/bin/python() [0x5cc3aa]
frame #26: PyEval_EvalCode + 0x9f (0x5cba7f in /root/miniconda3/envs/kt311/bin/python)
frame #27: /root/miniconda3/envs/kt311/bin/python() [0x5ecba7]
frame #28: /root/miniconda3/envs/kt311/bin/python() [0x5e8740]
frame #29: PyRun_StringFlags + 0x5f (0x5db24f in /root/miniconda3/envs/kt311/bin/python)
frame #30: PyRun_SimpleStringFlags + 0x3b (0x5daffb in /root/miniconda3/envs/kt311/bin/python)
frame #31: Py_RunMain + 0x388 (0x5f7498 in /root/miniconda3/envs/kt311/bin/python)
frame #32: Py_BytesMain + 0x39 (0x5bc149 in /root/miniconda3/envs/kt311/bin/python)
frame #33: + 0x29d90 (0x7f93f0556d90 in /lib/x86_64-linux-gnu/libc.so.6)
frame #34: __libc_start_main + 0x80 (0x7f93f0556e40 in /lib/x86_64-linux-gnu/libc.so.6)
frame #35: /root/miniconda3/envs/kt311/bin/python() [0x5bbf93]

<!-- gh-comment-id:2857575851 --> @liuwenzhoa commented on GitHub (May 7, 2025): 一样的错误,我是用的是 unsloth/Qwen3-30B-A3B-128K-GGUF-IQ2_XXS,换成Q2_K_L就好了。 2025-05-07 13:07:33,117 INFO /root/autodl-tmp/ktransformers/ktransformers/server/main.py[23]: Creating SQL tables 2025-05-07 13:07:33,121 INFO /root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/api/openai/assistants/assistants.py[75]: Creating default assistant INFO: Started server process [154315] INFO: Waiting for application startup. Queue Proxy Started INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:10002 (Press CTRL+C to quit) /root/miniconda3/envs/kt311/lib/python3.11/site-packages/pydantic/main.py:519: UserWarning: Pydantic serializer warnings: PydanticSerializationUnexpectedValue(Expected `list[dict[str, any]]` - serialized value may not be as expected [input_value={}, input_type=dict]) return self.__pydantic_serializer__.to_json( 2025-05-07 13:08:16,440 DEBUG /root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[418]: get input ids of shape torch.Size([1, 16]) add query id: 1, batch.query_lengths: 16, batch_query_tokens: torch.Size([516]), batch.block_indexes: tensor([0, 1, 2], dtype=torch.int32) prefill_batch_i: 16, padded_batch_size 57 capture_padded_batch_size 57 Model execution time (GPU): 1249.500 ms, 0.800 tokens/s 2025-05-07 13:08:17,723 - INFO - flashinfer.jit: Loading JIT ops: sampling 2025-05-07 13:08:17,833 - INFO - flashinfer.jit: Finished loading JIT ops: sampling 59693 decode_batch_i: 1, padded_batch_size 57 capture_padded_batch_size 57 Model execution time (GPU): 352.752 ms, 2.835 tokens/s Process SpawnProcess-1: Traceback (most recent call last): File "/root/miniconda3/envs/kt311/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/root/miniconda3/envs/kt311/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 282, in run_engine engine.loop() File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 260, in loop generated_tokens, probs = self.sampling( self.model_runner.output) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/backend/interfaces/balance_serve.py", line 224, in sampling generated_tokens, probs=self.sampler(logit, sample_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/kt311/lib/python3.11/site-packages/ktransformers/server/balance_serve/inference/sampling/sampler.py", line 97, in forward temperature_0_idx = torch.where(sampling_config.temperatures == 0)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. terminate called after throwing an instance of 'c10::Error' what(): CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. Exception raised from c10_cuda_check_implementation at /pytorch/c10/cuda/CUDAException.cpp:43 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x98 (0x7f93edd785e8 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xe0 (0x7f93edd0d4a2 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so) frame #2: c10::cuda::c10_cuda_check_implementation(int, char const*, char const*, int, bool) + 0x3c2 (0x7f93ee10b422 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #3: <unknown function> + 0x32953 (0x7f93ee0e7953 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #4: <unknown function> + 0x32b01 (0x7f93ee0e7b01 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10_cuda.so) frame #5: <unknown function> + 0x66c7f2 (0x7f93e59bb7f2 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #6: <unknown function> + 0x457608 (0x7f93e57a6608 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #7: <unknown function> + 0x7b385 (0x7f93edd59385 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so) frame #8: c10::TensorImpl::~TensorImpl() + 0x9 (0x7f93edd52f39 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libc10.so) frame #9: <unknown function> + 0x7182b8 (0x7f93e5a672b8 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #10: <unknown function> + 0x7186d1 (0x7f93e5a676d1 in /root/miniconda3/envs/kt311/lib/python3.11/site-packages/torch/lib/libtorch_python.so) frame #11: /root/miniconda3/envs/kt311/bin/python() [0x4f5eb7] frame #12: /root/miniconda3/envs/kt311/bin/python() [0x5031bf] frame #13: /root/miniconda3/envs/kt311/bin/python() [0x55f246] frame #14: /root/miniconda3/envs/kt311/bin/python() [0x50302a] frame #15: /root/miniconda3/envs/kt311/bin/python() [0x5031bf] frame #16: /root/miniconda3/envs/kt311/bin/python() [0x55f246] frame #17: /root/miniconda3/envs/kt311/bin/python() [0x55ef87] frame #18: /root/miniconda3/envs/kt311/bin/python() [0x55f040] frame #19: /root/miniconda3/envs/kt311/bin/python() [0x541355] frame #20: /root/miniconda3/envs/kt311/bin/python() [0x53fd88] frame #21: /root/miniconda3/envs/kt311/bin/python() [0x53fdc4] frame #22: /root/miniconda3/envs/kt311/bin/python() [0x53fdc4] frame #23: /root/miniconda3/envs/kt311/bin/python() [0x54e833] frame #24: _PyEval_EvalFrameDefault + 0x46f9 (0x515ac9 in /root/miniconda3/envs/kt311/bin/python) frame #25: /root/miniconda3/envs/kt311/bin/python() [0x5cc3aa] frame #26: PyEval_EvalCode + 0x9f (0x5cba7f in /root/miniconda3/envs/kt311/bin/python) frame #27: /root/miniconda3/envs/kt311/bin/python() [0x5ecba7] frame #28: /root/miniconda3/envs/kt311/bin/python() [0x5e8740] frame #29: PyRun_StringFlags + 0x5f (0x5db24f in /root/miniconda3/envs/kt311/bin/python) frame #30: PyRun_SimpleStringFlags + 0x3b (0x5daffb in /root/miniconda3/envs/kt311/bin/python) frame #31: Py_RunMain + 0x388 (0x5f7498 in /root/miniconda3/envs/kt311/bin/python) frame #32: Py_BytesMain + 0x39 (0x5bc149 in /root/miniconda3/envs/kt311/bin/python) frame #33: <unknown function> + 0x29d90 (0x7f93f0556d90 in /lib/x86_64-linux-gnu/libc.so.6) frame #34: __libc_start_main + 0x80 (0x7f93f0556e40 in /lib/x86_64-linux-gnu/libc.so.6) frame #35: /root/miniconda3/envs/kt311/bin/python() [0x5bbf93]
Author
Owner

@jizhilong commented on GitHub (May 7, 2025):

Hi, please do a favor to wrap logs/codes/traceback texts in a proper markdown fenced code block, such that:

  1. all paticipants can copy the raw text with a simple click.
  2. content get highlighted according to syntax if possible.
  3. texts like #34 prevented from incorrectly rendered into a reference to other issues.
<!-- gh-comment-id:2857630607 --> @jizhilong commented on GitHub (May 7, 2025): Hi, please do a favor to wrap logs/codes/traceback texts in a proper [markdown fenced code block](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks), such that: 1. all paticipants can copy the raw text with a simple click. 2. content get highlighted according to syntax if possible. 3. texts like `#34` prevented from incorrectly rendered into a reference to other issues.
Author
Owner

@ant-ob-hengtang commented on GitHub (May 8, 2025):

Hi, please do a favor to wrap logs/codes/traceback texts in a proper markdown fenced code block, such that:你好,请帮个忙将日志/代码/回溯文本包装在适当的 markdown 隔离代码块中,例如:

  1. all paticipants can copy the raw text with a simple click.所有参与者只需单击即可复制原始文本。
  2. content get highlighted according to syntax if possible.如果可能的话,内容会根据语法突出显示。
  3. texts like #34 prevented from incorrectly rendered into a reference to other issues.像 #34 这样的文本不会被错误地渲染成对其他问题的引用。

oh sry for my bad format ~ i have edit my question by some markdown format. Thanks for your advices

<!-- gh-comment-id:2861171696 --> @ant-ob-hengtang commented on GitHub (May 8, 2025): > Hi, please do a favor to wrap logs/codes/traceback texts in a proper [markdown fenced code block](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks), such that:你好,请帮个忙将日志/代码/回溯文本包装在适当的 [markdown 隔离代码块](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)中,例如: > > 1. all paticipants can copy the raw text with a simple click.所有参与者只需单击即可复制原始文本。 > 2. content get highlighted according to syntax if possible.如果可能的话,内容会根据语法突出显示。 > 3. texts like `#34` prevented from incorrectly rendered into a reference to other issues.像 `#34` 这样的文本不会被错误地渲染成对其他问题的引用。 oh sry for my bad format ~ i have edit my question by some markdown format. Thanks for your advices
Author
Owner

@ant-ob-hengtang commented on GitHub (May 8, 2025):

@liuwenzhoa 这个模型的格式我有点一知半解,您这个前后两个模型是什么区别呢?
是模型大小变了,然后就避免了CUDA error: an illegal memory access was encountered ?

<!-- gh-comment-id:2861176945 --> @ant-ob-hengtang commented on GitHub (May 8, 2025): @liuwenzhoa 这个模型的格式我有点一知半解,您这个前后两个模型是什么区别呢? 是模型大小变了,然后就避免了CUDA error: an illegal memory access was encountered ?
Author
Owner

@Atream commented on GitHub (May 9, 2025):

Could you tell me whether this bug occurs occasionally or frequently? Could you attempt to send several requests via the API to see if it still causes an error?
请问这个bug是偶发性出现还是经常出现,能否尝试用api发送几个请求,看看是否仍然会报错。

<!-- gh-comment-id:2865346908 --> @Atream commented on GitHub (May 9, 2025): Could you tell me whether this bug occurs occasionally or frequently? Could you attempt to send several requests via the API to see if it still causes an error? 请问这个bug是偶发性出现还是经常出现,能否尝试用api发送几个请求,看看是否仍然会报错。
Author
Owner

@ant-ob-hengtang commented on GitHub (May 15, 2025):

Could you tell me whether this bug occurs occasionally or frequently? Could you attempt to send several requests via the API to see if it still causes an error? 请问这个bug是偶发性出现还是经常出现,能否尝试用api发送几个请求,看看是否仍然会报错。

你好,很抱歉才看到您的回复~我个人单独发送api是不会遇到这个问题的,之后没有再研究这个事情了 sry

<!-- gh-comment-id:2882740988 --> @ant-ob-hengtang commented on GitHub (May 15, 2025): > Could you tell me whether this bug occurs occasionally or frequently? Could you attempt to send several requests via the API to see if it still causes an error? 请问这个bug是偶发性出现还是经常出现,能否尝试用api发送几个请求,看看是否仍然会报错。 你好,很抱歉才看到您的回复~我个人单独发送api是不会遇到这个问题的,之后没有再研究这个事情了 sry
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#859
No description provided.