-
Notifications
You must be signed in to change notification settings - Fork 737
[Others] Add NUM_MAX_DISPATCH_TOKENS_PER_RANK env to control #7188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,6 +266,13 @@ def _validate_split_kv_size(value: int) -> int: | |
| "FD_SAVE_OUTPUT_CACHE_FOR_PREEMPTED_REQUEST": lambda: bool( | ||
| int(os.getenv("FD_SAVE_OUTPUT_CACHE_FOR_PREEMPTED_REQUEST", "1")) | ||
| ), | ||
| # Number of max dispatch tokens per rank for MoE computation. | ||
| # If set, it must match the value in model config if present, otherwise an error will be raised. | ||
| "NUM_MAX_DISPATCH_TOKENS_PER_RANK": lambda: ( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 环境变量命名不符合项目规范。 项目中的环境变量统一使用 |
||
| int(os.getenv("NUM_MAX_DISPATCH_TOKENS_PER_RANK", "0")) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 缺少对环境变量值的验证。 当环境变量设置为 0 或负数时可能导致问题。建议添加验证: "NUM_MAX_DISPATCH_TOKENS_PER_RANK": lambda: (
int(value) if (value := os.getenv("NUM_MAX_DISPATCH_TOKENS_PER_RANK")) and int(value) > 0
else None
), |
||
| if os.getenv("NUM_MAX_DISPATCH_TOKENS_PER_RANK") | ||
| else None | ||
| ), | ||
| } | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 建议 缺少单元测试覆盖新增逻辑。
建议在
tests/utils/test_config.py中添加测试用例,验证以下场景: