[GH-ISSUE #20] If I want to run a linear layer with q4_k_m on cpu using lamafile, how to do it with your implement #11

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

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

Originally assigned to: @chenht2022 on GitHub.

I found the bench_linear.py. But the weight is fp32 not the quantized uint8. Can you give me a example ? thanks

Originally created by @Eutenacity on GitHub (Aug 3, 2024). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/20 Originally assigned to: @chenht2022 on GitHub. I found the bench_linear.py. But the weight is fp32 not the quantized uint8. Can you give me a example ? thanks
Author
Owner

@chenht2022 commented on GitHub (Aug 4, 2024):

You are correct. For testing convenience, we randomly generated some FP32 weights in our bench program and let llamafile_sgemm treat them as quantized weights. The output obtained this way is meaningless; we use this bench program solely to test performance. In actual use, the weights are mmap-ed from gguf rather than randomly generated, ensuring that the computation results are meaningful.

The injection of the linear layer is coming soon, and you will then be able to run a linear layer on the CPU using llamafile by modifying a YAML configuration file.

<!-- gh-comment-id:2267310881 --> @chenht2022 commented on GitHub (Aug 4, 2024): You are correct. For testing convenience, we randomly generated some FP32 weights in our bench program and let llamafile_sgemm treat them as quantized weights. The output obtained this way is meaningless; we use this bench program solely to test performance. In actual use, the weights are mmap-ed from gguf rather than randomly generated, ensuring that the computation results are meaningful. The injection of the linear layer is coming soon, and you will then be able to run a linear layer on the CPU using llamafile by modifying a YAML configuration file.
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#11
No description provided.