[GH-ISSUE #44] CUDA error: No kernel image is available for execution on the device #23

Closed
opened 2026-10-29 14:32:44 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Forsworns on GitHub (Aug 20, 2024).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/44

I tried the DeepSeek-V2-Lite in your container image approachingai/ktransformers:0.1.1, which is deployed on an Nvidia T4 GPU with driver 535.161.8. And I got following errors, is T4 not sufficient to run it, or should I change my driver version?

image

Originally created by @Forsworns on GitHub (Aug 20, 2024). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/44 I tried the DeepSeek-V2-Lite in your container image `approachingai/ktransformers:0.1.1`, which is deployed on an Nvidia T4 GPU with driver 535.161.8. And I got following errors, is T4 not sufficient to run it, or should I change my driver version? ![image](https://github.com/user-attachments/assets/623c2d8f-f5a8-44fd-8612-ecde2024f4df)
Author
Owner

@Azure-Tang commented on GitHub (Aug 20, 2024):

Hi, thank u for your interest.
For your problem, Your GPU Compute Capability is 7.5, which our precompiled docker only support 8.0 and higher. If you want to run ktransformers, you may follow the readme Or you can download source code and compile: section.
One more thing is that our default linear operator(marlin) only support Nvidia's Ampere and higher architecture. For T4, which is Turing, you may need modify /ktransformer/optimize/optimize_rules/DeepSeek-V2-Chat.yaml and change linear backend to KLinearTorch .

The modified linear replace rule will like:

- match:
    name: "^model\\.layers\\.(?!.*self_attn).*$"  # regular expression 
    class: torch.nn.Linear  # only match modules matching name and class simultaneously
  replace:
    class: ktransformers.operators.linear.KTransformersLinear  # optimized Kernel on quantized data types
    kwargs:
      generate_device: "cuda"
      generate_op: "KLinearTorch"
<!-- gh-comment-id:2298310678 --> @Azure-Tang commented on GitHub (Aug 20, 2024): Hi, thank u for your interest. For your problem, Your GPU Compute Capability is 7.5, which our precompiled docker only support 8.0 and higher. If you want to run ktransformers, you may follow the readme `Or you can download source code and compile:` section. One more thing is that our default linear operator(marlin) only support Nvidia's `Ampere` and higher architecture. For T4, which is `Turing`, you may need modify `/ktransformer/optimize/optimize_rules/DeepSeek-V2-Chat.yaml` and change linear backend to `KLinearTorch` . The modified linear replace rule will like: ```yaml - match: name: "^model\\.layers\\.(?!.*self_attn).*$" # regular expression class: torch.nn.Linear # only match modules matching name and class simultaneously replace: class: ktransformers.operators.linear.KTransformersLinear # optimized Kernel on quantized data types kwargs: generate_device: "cuda" generate_op: "KLinearTorch" ```
Author
Owner

@Forsworns commented on GitHub (Aug 22, 2024):

Thanks! I have run the original container image successfully with A10 cards :)

<!-- gh-comment-id:2304055077 --> @Forsworns commented on GitHub (Aug 22, 2024): Thanks! I have run the original container image successfully with A10 cards :)
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#23
No description provided.