[GH-ISSUE #860] why not use KExpertsTorch device=cpu for KExpertsCPU, but use c++ to compute? #621

Closed
opened 2026-10-29 14:42:02 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @dragen1860 on GitHub (Mar 11, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/860

Dear all:
since pytorch can also compute with device=cpu for function KExpertsTorch, why the author use C++ to implement KExpertsCPU function? thanks.

Originally created by @dragen1860 on GitHub (Mar 11, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/860 Dear all: since pytorch can also compute with device=cpu for function `KExpertsTorch`, why the author use C++ to implement `KExpertsCPU` function? thanks.
Author
Owner

@ovowei commented on GitHub (Mar 11, 2025):

Our implementation is based on llamafile, which provides better performance compared to Torch CPU computation. I don't remember the exact benchmark results, but you can test it yourself using the benchmarks available in the following directory:
bench

<!-- gh-comment-id:2713481957 --> @ovowei commented on GitHub (Mar 11, 2025): Our implementation is based on llamafile, which provides better performance compared to Torch CPU computation. I don't remember the exact benchmark results, but you can test it yourself using the benchmarks available in the following directory: [bench](https://github.com/kvcache-ai/ktransformers/tree/main/ktransformers/ktransformers_ext/bench)
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#621
No description provided.