fix(testing/bench.py): add float16 and float8_e5m2 to dtype_to_str mapping#5
Open
pandacooming wants to merge 2 commits intodeepseek-ai:mainfrom
Open
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.
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
Add the two missing dtype mappings to
dtype_to_str()intile_kernels/testing/bench.py:torch.float16→'fp16'torch.float8_e5m2→'e5m2'Fixes #4
Changes
def dtype_to_str(dtype: torch.dtype) -> str: mapping = { torch.float32: 'fp32', + torch.float16: 'fp16', torch.bfloat16: 'bf16', torch.float8_e4m3fn: 'e4m3', + torch.float8_e5m2: 'e5m2', torch.int8: 'e2m1', } if dtype not in mapping: - raise ValueError(f'Unsupported dtype: {dtype}. Only fp32, bf16, e4m3, and int8(e2m1) are supported') + raise ValueError(f'Unsupported dtype: {dtype}. Only fp32, fp16, bf16, e4m3, e5m2, and int8(e2m1) are supported') return mapping[dtype]Testing
All 6 supported dtypes pass and invalid dtype still raises
ValueError: