[GH-ISSUE #1885] Capture cuda graph failed: Assertion error when Running DeepSeek V3.2 with SGLang and KT-Kernel #1176

Open
opened 2026-10-29 14:49:36 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @merries711 on GitHub (Mar 13, 2026).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1885

Reminder

  • I have read the above rules and searched the existing issues.

System Info

CPU: INTEL(R) XEON(R) GOLD 6530 x2
GPU: NVIDIA RTX PRO 4500 Blackwell 32GB [ GB203GL ] x2
RAM: 1TB DDR5

KTransformers CLI v0.1.0

Python 3.11.14
平台 Linux 6.12.63+deb13-amd64
CUDA 13.1

Packages:

kt-kernel 0.5.2.post1
sglang-kt 0.5.2.post2 (sglang-kt)

installed from source .

Reproduction

I followed the tutorial and ran DeepSeek V3.2 with SGLang and KT-Kernel, but it prompted the following error; how should I adjust it? Additionally, can I run the DeepSeek V3.2 gguf of unsloth with the current kt-kernel?

[2026-03-13 17:36:44 TP1] Capture cuda graph begin. This can take up to several minutes. avail mem=13.54 GB
[2026-03-13 17:36:44 TP0] Capture cuda graph begin. This can take up to several minutes. avail mem=13.51 GB
[2026-03-13 17:36:44 TP0] Capture cuda graph bs [1, 2, 4, 8, 12, 16]
Capturing batches (bs=16 avail_mem=13.46 GB):   0%|                                                                                                                                                                                                     | 0/6 [00:00<?, ?it/s][2026-03-13 17:36:45 TP0] Entering DeepGEMM JIT Pre-Compile session. It may take a long time (typically 10-20 mins) if you have not run `sglang.compile_deep_gemm`. It is recommended to run `sglang.compile_deep_gemm` with same args as `sglang.launch_server` for pre-compilation to reduce the overhead if you have not run it before. For example: `python3 -m sglang.compile_deep_gemm --model deepseek-ai/DeepSeek-V3 --tp 8 --trust-remote-code`
[2026-03-13 17:36:45 TP0] Try DeepGEMM JIT Compiling for <GEMM_NT_F8F8BF16> N=2112, K=7168, num_groups=1 with all Ms. It only takes a little time (typically 1 sec) if you have run `python3 -m sglang.compile_deep_gemm`.
[2026-03-13 17:36:45 TP0] Required memory for warmup: 0.18792724609375GB, Available memory: 13.4566650390625GB
DeepGEMM warmup:   0%|                                                                                                                                                                                                                              | 0/16384 [00:00<?, ?it/s]
Capturing batches (bs=16 avail_mem=13.46 GB):   0%|                                                                                                                                                                                                     | 0/6 [00:00<?, ?it/s]
[2026-03-13 17:36:45 TP1] Scheduler hit an exception: Traceback (most recent call last):
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 567, in __init__
    self.capture()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 723, in capture
    _capture_one_stream()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 710, in _capture_one_stream
    ) = self.capture_one_batch_size(bs, forward, stream_idx)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 929, in capture_one_batch_size
    run_once()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 916, in run_once
    logits_output_or_pp_proxy_tensors = forward(
                                        ^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2999, in forward
    hidden_states = self.model(
                    ^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2750, in forward
    hidden_states, residual = layer(
                              ^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2414, in forward
    hidden_states = self.self_attn(
                    ^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1380, in forward
    s = self.forward_prepare(
        ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1434, in forward_prepare
    inner_state = self.forward_absorb_prepare(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1552, in forward_absorb_prepare
    .fetch_qkv_latent()
     ^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/communicator.py", line 229, in fetch_qkv_latent
    return self.attn_inputs_.fetch_qkv_latent()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/communicator.py", line 163, in fetch_qkv_latent
    self.qkv_latent_ = self.qkv_latent_func(
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1503, in prepare_qkv_latent
    qkv_latent = self.fused_qkv_a_proj_with_mqa(hidden_states)[0]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/linear.py", line 266, in forward
    output = self.quant_method.apply(self, x, bias)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8.py", line 641, in apply
    return self.w8a8_block_fp8_linear(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_utils.py", line 488, in deepgemm_w8a8_block_fp8_linear_with_fallback
    output = w8a8_block_fp8_matmul_deepgemm(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_kernel.py", line 1101, in w8a8_block_fp8_matmul_deepgemm
    deep_gemm_fp8_fp8_bf16_nt(A, As, B, Bs, C)
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/_ops.py", line 1255, in __call__
    return self._op(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_kernel.py", line 118, in deep_gemm_fp8_fp8_bf16_nt
    deep_gemm_wrapper.gemm_nt_f8f8bf16((A, As), (B, Bs), C)
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/deep_gemm_wrapper/entrypoint.py", line 98, in gemm_nt_f8f8bf16
    deep_gemm.fp8_gemm_nt(
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/deep_gemm/__init__.py", line 50, in _fn
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/_ops.py", line 1255, in __call__
    return self._op(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Assertion error (_deps/repo-deepgemm-src/csrc/apis/../jit_kernels/impls/../heuristics/../../utils/layout.hpp:56): Unknown recipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 3118, in run_scheduler_process
    scheduler = Scheduler(
                ^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 363, in __init__
    self.init_model_worker()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 559, in init_model_worker
    self.init_tp_model_worker()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 517, in init_tp_model_worker
    self.tp_worker = TpModelWorker(
                     ^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/tp_worker.py", line 247, in __init__
    self._init_model_runner()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/tp_worker.py", line 330, in _init_model_runner
    self._model_runner = ModelRunner(
                         ^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 415, in __init__
    self.initialize(min_per_gpu_memory)
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 611, in initialize
    self.init_device_graphs()
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 2149, in init_device_graphs
    self.graph_runner = graph_runners[self.device](self)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 569, in __init__
    raise Exception(
Exception: Capture cuda graph failed: Assertion error (_deps/repo-deepgemm-src/csrc/apis/../jit_kernels/impls/../heuristics/../../utils/layout.hpp:56): Unknown recipe
Possible solutions:
1. set --mem-fraction-static to a smaller value (e.g., 0.8 or 0.7)
2. set --cuda-graph-max-bs to a smaller value (e.g., 16)
3. disable torch compile by not using --enable-torch-compile
4. disable CUDA graph by --disable-cuda-graph. (Not recommended. Huge performance loss)
Open an issue on GitHub https://github.com/sgl-project/sglang/issues/new/choose

Furthermore, when I was running MiniMax-M2.1 with Native Precision using SGLang and KT-Kernel, the speed was very slow — less than 1 TPS — and it crashed after just two queries.

[2026-03-15 16:21:20] INFO:     Started server process [6254]
[2026-03-15 16:21:20] INFO:     Waiting for application startup.
[2026-03-15 16:21:20] Using default chat sampling params from model generation config: {'repetition_penalty': 1.0, 'temperature': 1.0, 'top_k': 40, 'top_p': 0.95}
[2026-03-15 16:21:20] INFO:     Application startup complete.
[2026-03-15 16:21:20] INFO:     Uvicorn running on http://0.0.0.0:31666 (Press CTRL+C to quit)
/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/fastapi/routing.py:116: FastAPIDeprecationWarning: ORJSONResponse is deprecated, FastAPI now serializes data directly to JSON bytes via Pydantic when a return type or response model is set, which is faster and doesn't need a custom response class. Read more in the FastAPI docs: https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model and https://fastapi.tiangolo.com/tutorial/response-model/
  response = await f(request)
[2026-03-15 16:22:54] INFO:     192.168.1.100:60372 - "GET /v1/models HTTP/1.1" 200 OK
[2026-03-15 16:25:43 TP0] Prefill batch, #new-seq: 1, #new-token: 44, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0, input throughput (token/s): 0.00, cuda graph: False
[2026-03-15 16:26:43 TP0] Decode batch, #running-req: 1, #token: 85, token usage: 0.00, cuda graph: True, gen throughput (token/s): 0.10, #queue-req: 0
[2026-03-15 16:27:44 TP0] Decode batch, #running-req: 1, #token: 125, token usage: 0.01, cuda graph: True, gen throughput (token/s): 0.66, #queue-req: 0
[2026-03-15 16:28:22] INFO:     127.0.0.1:53216 - "POST /v1/chat/completions HTTP/1.1" 200 OK
[2026-03-15 16:29:07 TP0] Prefill batch, #new-seq: 1, #new-token: 16, #cached-token: 31, token usage: 0.00, #running-req: 0, #queue-req: 0, input throughput (token/s): 0.22, cuda graph: False
[2026-03-15 16:29:20] Initialization failed. warmup error: Traceback (most recent call last):
  File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/entrypoints/http_server.py", line 1745, in _execute_server_warmup
    assert res.status_code == 200, f"{res=}, {res.text=}"
           ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: res=<Response [502]>, res.text=''

Killed

Others

python -m sglang.launch_server
--host 0.0.0.0
--port 31666
--model /nas/DeepSeek-V3.2
--kt-weight-path /models/deepseek-v3.2-INT4
--kt-cpuinfer 30
--kt-threadpool-count 4
--kt-num-gpu-experts 4
--attention-backend triton
--trust-remote-code
--mem-fraction-static 0.7
--chunked-prefill-size 2048
--max-running-requests 16
--max-total-tokens 8192
--served-model-name DeepSeek-V3.2
--enable-mixed-chunk
--tensor-parallel-size 2
--enable-p2p-check
--disable-shared-experts-fusion
--kt-method AMXINT4

python -m sglang.launch_server
--host 0.0.0.0 --port 31666
--model /models/MiniMax-M2.1
--kt-weight-path /models/MiniMax-M2.1
--kt-cpuinfer 60 --kt-threadpool-count 2
--kt-num-gpu-experts 24 --kt-method FP8
--kt-gpu-prefill-token-threshold 4096
--attention-backend flashinfer --trust-remote-code
--mem-fraction-static 0.8 --chunked-prefill-size 8192
--max-running-requests 16 --max-total-tokens 20000
--enable-mixed-chunk --tensor-parallel-size 2
--enable-p2p-check --served-model-name MiniMax-M2.1
--disable-shared-experts-fusion --fp8-gemm-backend triton

Image
Originally created by @merries711 on GitHub (Mar 13, 2026). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1885 ### Reminder - [x] I have read the above rules and searched the existing issues. ### System Info CPU: INTEL(R) XEON(R) GOLD 6530 x2 GPU: NVIDIA RTX PRO 4500 Blackwell 32GB [ GB203GL ] x2 RAM: 1TB DDR5 KTransformers CLI v0.1.0 Python 3.11.14 平台 Linux 6.12.63+deb13-amd64 CUDA 13.1 Packages: kt-kernel 0.5.2.post1 sglang-kt 0.5.2.post2 (sglang-kt) installed from source . ### Reproduction I followed the tutorial and ran DeepSeek V3.2 with SGLang and KT-Kernel, but it prompted the following error; how should I adjust it? Additionally, can I run the DeepSeek V3.2 gguf of unsloth with the current kt-kernel? ```text [2026-03-13 17:36:44 TP1] Capture cuda graph begin. This can take up to several minutes. avail mem=13.54 GB [2026-03-13 17:36:44 TP0] Capture cuda graph begin. This can take up to several minutes. avail mem=13.51 GB [2026-03-13 17:36:44 TP0] Capture cuda graph bs [1, 2, 4, 8, 12, 16] Capturing batches (bs=16 avail_mem=13.46 GB): 0%| | 0/6 [00:00<?, ?it/s][2026-03-13 17:36:45 TP0] Entering DeepGEMM JIT Pre-Compile session. It may take a long time (typically 10-20 mins) if you have not run `sglang.compile_deep_gemm`. It is recommended to run `sglang.compile_deep_gemm` with same args as `sglang.launch_server` for pre-compilation to reduce the overhead if you have not run it before. For example: `python3 -m sglang.compile_deep_gemm --model deepseek-ai/DeepSeek-V3 --tp 8 --trust-remote-code` [2026-03-13 17:36:45 TP0] Try DeepGEMM JIT Compiling for <GEMM_NT_F8F8BF16> N=2112, K=7168, num_groups=1 with all Ms. It only takes a little time (typically 1 sec) if you have run `python3 -m sglang.compile_deep_gemm`. [2026-03-13 17:36:45 TP0] Required memory for warmup: 0.18792724609375GB, Available memory: 13.4566650390625GB DeepGEMM warmup: 0%| | 0/16384 [00:00<?, ?it/s] Capturing batches (bs=16 avail_mem=13.46 GB): 0%| | 0/6 [00:00<?, ?it/s] [2026-03-13 17:36:45 TP1] Scheduler hit an exception: Traceback (most recent call last): File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 567, in __init__ self.capture() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 723, in capture _capture_one_stream() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 710, in _capture_one_stream ) = self.capture_one_batch_size(bs, forward, stream_idx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 929, in capture_one_batch_size run_once() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 916, in run_once logits_output_or_pp_proxy_tensors = forward( ^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2999, in forward hidden_states = self.model( ^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2750, in forward hidden_states, residual = layer( ^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 2414, in forward hidden_states = self.self_attn( ^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1380, in forward s = self.forward_prepare( ^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1434, in forward_prepare inner_state = self.forward_absorb_prepare( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1552, in forward_absorb_prepare .fetch_qkv_latent() ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/communicator.py", line 229, in fetch_qkv_latent return self.attn_inputs_.fetch_qkv_latent() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/communicator.py", line 163, in fetch_qkv_latent self.qkv_latent_ = self.qkv_latent_func( ^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/models/deepseek_v2.py", line 1503, in prepare_qkv_latent qkv_latent = self.fused_qkv_a_proj_with_mqa(hidden_states)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/linear.py", line 266, in forward output = self.quant_method.apply(self, x, bias) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8.py", line 641, in apply return self.w8a8_block_fp8_linear( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_utils.py", line 488, in deepgemm_w8a8_block_fp8_linear_with_fallback output = w8a8_block_fp8_matmul_deepgemm( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_kernel.py", line 1101, in w8a8_block_fp8_matmul_deepgemm deep_gemm_fp8_fp8_bf16_nt(A, As, B, Bs, C) File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/_ops.py", line 1255, in __call__ return self._op(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/quantization/fp8_kernel.py", line 118, in deep_gemm_fp8_fp8_bf16_nt deep_gemm_wrapper.gemm_nt_f8f8bf16((A, As), (B, Bs), C) File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/layers/deep_gemm_wrapper/entrypoint.py", line 98, in gemm_nt_f8f8bf16 deep_gemm.fp8_gemm_nt( File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/deep_gemm/__init__.py", line 50, in _fn return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/torch/_ops.py", line 1255, in __call__ return self._op(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Assertion error (_deps/repo-deepgemm-src/csrc/apis/../jit_kernels/impls/../heuristics/../../utils/layout.hpp:56): Unknown recipe During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 3118, in run_scheduler_process scheduler = Scheduler( ^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 363, in __init__ self.init_model_worker() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 559, in init_model_worker self.init_tp_model_worker() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/scheduler.py", line 517, in init_tp_model_worker self.tp_worker = TpModelWorker( ^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/tp_worker.py", line 247, in __init__ self._init_model_runner() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/managers/tp_worker.py", line 330, in _init_model_runner self._model_runner = ModelRunner( ^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 415, in __init__ self.initialize(min_per_gpu_memory) File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 611, in initialize self.init_device_graphs() File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/model_runner.py", line 2149, in init_device_graphs self.graph_runner = graph_runners[self.device](self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/model_executor/cuda_graph_runner.py", line 569, in __init__ raise Exception( Exception: Capture cuda graph failed: Assertion error (_deps/repo-deepgemm-src/csrc/apis/../jit_kernels/impls/../heuristics/../../utils/layout.hpp:56): Unknown recipe Possible solutions: 1. set --mem-fraction-static to a smaller value (e.g., 0.8 or 0.7) 2. set --cuda-graph-max-bs to a smaller value (e.g., 16) 3. disable torch compile by not using --enable-torch-compile 4. disable CUDA graph by --disable-cuda-graph. (Not recommended. Huge performance loss) Open an issue on GitHub https://github.com/sgl-project/sglang/issues/new/choose ``` Furthermore, when I was running MiniMax-M2.1 with Native Precision using SGLang and KT-Kernel, the speed was very slow — less than 1 TPS — and it crashed after just two queries. ```text [2026-03-15 16:21:20] INFO: Started server process [6254] [2026-03-15 16:21:20] INFO: Waiting for application startup. [2026-03-15 16:21:20] Using default chat sampling params from model generation config: {'repetition_penalty': 1.0, 'temperature': 1.0, 'top_k': 40, 'top_p': 0.95} [2026-03-15 16:21:20] INFO: Application startup complete. [2026-03-15 16:21:20] INFO: Uvicorn running on http://0.0.0.0:31666 (Press CTRL+C to quit) /opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/fastapi/routing.py:116: FastAPIDeprecationWarning: ORJSONResponse is deprecated, FastAPI now serializes data directly to JSON bytes via Pydantic when a return type or response model is set, which is faster and doesn't need a custom response class. Read more in the FastAPI docs: https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model and https://fastapi.tiangolo.com/tutorial/response-model/ response = await f(request) [2026-03-15 16:22:54] INFO: 192.168.1.100:60372 - "GET /v1/models HTTP/1.1" 200 OK [2026-03-15 16:25:43 TP0] Prefill batch, #new-seq: 1, #new-token: 44, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0, input throughput (token/s): 0.00, cuda graph: False [2026-03-15 16:26:43 TP0] Decode batch, #running-req: 1, #token: 85, token usage: 0.00, cuda graph: True, gen throughput (token/s): 0.10, #queue-req: 0 [2026-03-15 16:27:44 TP0] Decode batch, #running-req: 1, #token: 125, token usage: 0.01, cuda graph: True, gen throughput (token/s): 0.66, #queue-req: 0 [2026-03-15 16:28:22] INFO: 127.0.0.1:53216 - "POST /v1/chat/completions HTTP/1.1" 200 OK [2026-03-15 16:29:07 TP0] Prefill batch, #new-seq: 1, #new-token: 16, #cached-token: 31, token usage: 0.00, #running-req: 0, #queue-req: 0, input throughput (token/s): 0.22, cuda graph: False [2026-03-15 16:29:20] Initialization failed. warmup error: Traceback (most recent call last): File "/opt/miniconda3/envs/kt-kernel/lib/python3.11/site-packages/sglang/srt/entrypoints/http_server.py", line 1745, in _execute_server_warmup assert res.status_code == 200, f"{res=}, {res.text=}" ^^^^^^^^^^^^^^^^^^^^^^ AssertionError: res=<Response [502]>, res.text='' Killed ``` ### Others python -m sglang.launch_server \ --host 0.0.0.0 \ --port 31666 \ --model /nas/DeepSeek-V3.2 \ --kt-weight-path /models/deepseek-v3.2-INT4 \ --kt-cpuinfer 30 \ --kt-threadpool-count 4 \ --kt-num-gpu-experts 4 \ --attention-backend triton \ --trust-remote-code \ --mem-fraction-static 0.7 \ --chunked-prefill-size 2048 \ --max-running-requests 16 \ --max-total-tokens 8192 \ --served-model-name DeepSeek-V3.2 \ --enable-mixed-chunk \ --tensor-parallel-size 2 \ --enable-p2p-check \ --disable-shared-experts-fusion \ --kt-method AMXINT4 python -m sglang.launch_server \ --host 0.0.0.0 --port 31666 \ --model /models/MiniMax-M2.1 \ --kt-weight-path /models/MiniMax-M2.1 \ --kt-cpuinfer 60 --kt-threadpool-count 2 \ --kt-num-gpu-experts 24 --kt-method FP8 \ --kt-gpu-prefill-token-threshold 4096 \ --attention-backend flashinfer --trust-remote-code \ --mem-fraction-static 0.8 --chunked-prefill-size 8192 \ --max-running-requests 16 --max-total-tokens 20000 \ --enable-mixed-chunk --tensor-parallel-size 2 \ --enable-p2p-check --served-model-name MiniMax-M2.1 \ --disable-shared-experts-fusion --fp8-gemm-backend triton <img width="872" height="272" alt="Image" src="https://github.com/user-attachments/assets/3afd2e0d-b26b-455d-87c0-9afeae557b5f" />
Author
Owner

@ErvinXie commented on GitHub (Mar 17, 2026):

Hi @merries711,

You have two separate issues here. Let me address them:

1. DeepSeek V3.2 — "Unknown recipe" in DeepGEMM

Your RTX PRO 4500 (GB203, Blackwell architecture) is not supported by DeepGEMM, which currently only works on Hopper (SM90) GPUs. Setting SGLANG_ENABLE_JIT_DEEPGEMM=0 is not enough — the FP8 GEMM backend still defaults to DeepGEMM.

Fix: Add --fp8-gemm-backend triton to your DeepSeek V3.2 launch command, just like you already have for MiniMax-M2.1.

2. MiniMax-M2.1 — Extremely slow (0.1 tok/s) and crash

With 2× 32GB GPUs (64GB total), running MiniMax-M2.1 is very tight. A few issues:

  • --kt-num-gpu-experts 24 puts 12 experts per GPU (with TP2), which consumes significant VRAM. Try reducing to --kt-num-gpu-experts 8 or even 4 to leave more room for KV cache.
  • --max-total-tokens 20000 may also be too high for your VRAM budget. Try 8192 first.
  • The warmup crash (502 error) likely stems from OOM during the second request's prefill. Reducing GPU expert count and max tokens should help.

You can also check GPU memory usage during startup with nvidia-smi to see how much VRAM is left after model loading.

3. Regarding Unsloth GGUF

KTransformers / kt-kernel does not support Unsloth's custom GGUF quantization types (UD format). Please use standard GGUF quantizations (e.g., Q4_K_M) or the official FP8/INT4 weights.


This reply was co-authored by an AI agent and a human.

<!-- gh-comment-id:4072910759 --> @ErvinXie commented on GitHub (Mar 17, 2026): Hi @merries711, You have two separate issues here. Let me address them: ### 1. DeepSeek V3.2 — "Unknown recipe" in DeepGEMM Your RTX PRO 4500 (GB203, Blackwell architecture) is not supported by DeepGEMM, which currently only works on Hopper (SM90) GPUs. Setting `SGLANG_ENABLE_JIT_DEEPGEMM=0` is not enough — the FP8 GEMM backend still defaults to DeepGEMM. **Fix:** Add `--fp8-gemm-backend triton` to your DeepSeek V3.2 launch command, just like you already have for MiniMax-M2.1. ### 2. MiniMax-M2.1 — Extremely slow (0.1 tok/s) and crash With 2× 32GB GPUs (64GB total), running MiniMax-M2.1 is very tight. A few issues: - **`--kt-num-gpu-experts 24`** puts 12 experts per GPU (with TP2), which consumes significant VRAM. Try reducing to `--kt-num-gpu-experts 8` or even `4` to leave more room for KV cache. - **`--max-total-tokens 20000`** may also be too high for your VRAM budget. Try `8192` first. - The warmup crash (502 error) likely stems from OOM during the second request's prefill. Reducing GPU expert count and max tokens should help. You can also check GPU memory usage during startup with `nvidia-smi` to see how much VRAM is left after model loading. ### 3. Regarding Unsloth GGUF KTransformers / kt-kernel does not support Unsloth's custom GGUF quantization types (UD format). Please use standard GGUF quantizations (e.g., Q4_K_M) or the official FP8/INT4 weights. --- *This reply was co-authored by an AI agent and a human.*
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#1176
No description provided.