[feat]: add --kt-numa-nodes for explicit NUMA node mapping#28
[feat]: add --kt-numa-nodes for explicit NUMA node mapping#28
Conversation
Add --kt-numa-nodes parameter to ServerArgs and thread it through KTConfig to KTMoEWrapper. This allows users to specify which NUMA node IDs to bind to, enabling multi-instance deployment on different NUMA nodes without external numactl workarounds. Usage: --kt-threadpool-count 1 --kt-numa-nodes 1 (binds to NUMA node 1 instead of defaulting to node 0) Companion to kvcache-ai/ktransformers#1891
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the KTransformers integration by providing explicit control over NUMA node mapping. It introduces a new command-line argument that allows users to specify which NUMA nodes KTransformers thread pools should utilize. This change is crucial for optimizing performance and resource allocation on systems with multiple NUMA nodes, enabling more granular control over how KTransformers instances are distributed across hardware resources. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Summary
--kt-numa-nodesCLI parameter toServerArgsfor specifying NUMA node IDsnuma_nodesthroughKTConfigdataclass toKTMoEWrapperinstantiation"1"or"0,1") intoList[int]Motivation
Companion to kvcache-ai/ktransformers#1891.
Currently
subpool_numa_mapin kt-kernel defaults to[0, 1, ..., threadpool_count-1]. This makes it impossible to bind a KTransformers instance to a specific NUMA node (e.g., node 1) without externalnumactl.Usage
Deploy two independent instances on a dual-NUMA machine, each bound to a different NUMA node:
You can also specify multiple NUMA nodes in custom order:
# Reverse order python -m sglang.launch_server \ --kt-threadpool-count 2 --kt-numa-nodes 1,0 \ ...If
--kt-numa-nodesis not specified, the behavior is unchanged.Tested on
CPUInfercreates worker pool on correct NUMA nodeTest plan
from sglang.srt.server_args import ServerArgsimports successfully--kt-numa-nodesis accepted by argparse and parsed correctly--kt-numa-nodesbehaves as before🤖 Generated with Claude Code