fix(testing/bench.py): make_param_key use _format_value for non-width keys#9
Open
pandacooming wants to merge 2 commits intodeepseek-ai:mainfrom
Open
fix(testing/bench.py): make_param_key use _format_value for non-width keys#9pandacooming wants to merge 2 commits intodeepseek-ai:mainfrom
pandacooming wants to merge 2 commits intodeepseek-ai:mainfrom
Conversation
added 2 commits
April 24, 2026 00:53
- Add .github/workflows/format.yml: GitHub Actions workflow that runs yapf + ruff on every push to main and on every PR. - Add format.sh: local formatting script (used by CI and for contributors to run locally before pushing). Both files follow the same conventions as deepseek-ai/DeepEP.
… keys Ensures torch.dtype and other complex types are formatted consistently with make_param_id, which already uses _format_value. Fixes deepseek-ai#8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apply
_format_value()to non-_WIDTHvalues inmake_param_key(), ensuringtorch.dtypeand other complex types are formatted consistently withmake_param_id(), which already uses_format_value.Fixes #8
Problem
{'dtype': torch.float16}make_param_iddtype=fp16✅make_param_keydtype=torch.float16❌Changes
def make_param_key(params: dict) -> str: param_str = ','.join( - f'{_SHORT_NAME.get(k, k)}={format(v, f">{_WIDTH.get(k)}") if k in _WIDTH else v}' + f'{_SHORT_NAME.get(k, k)}={_format_value(v) if k not in _WIDTH else format(v, f">{_WIDTH.get(k)}")}' for k, v in params.items() if v is not None ) return f'{param_str}'Also changes
v != Nonetov is not None(PEP8 style).Testing