deepseek-ai / deepseek-ai/TileKernels
testing/bench.py: _format_value lacks dict support
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
In `tile_kernels/testing/bench.py`, the `_format_value()` function handles `torch.dtype`, `tuple`, and `None`, but not `dict`:
```python
def _format_value(value):
if isinstance(value, torch.dtype):
return dtype_to_str(value)
if isinstance(value, tuple):
return 'x'.join(str(v) for v in value)
if value is None:
return 'None'
return str(value) # dict falls through here → ugly {'key': 'val'}
```
When a `dict` is passed, it falls through to `str(value)`, producing raw output like `{'topk': 2, 'hidden': 256}` — inconsistent with the `,`-joined `k=v` style used everywhere else in benchmark output.
## Expected Fix
Add dict handling that formats as `k1=v1,k2=v2`, consistent with `make_param_key`:
```python
if isinstance(value, dict):
return ','.join(f'{k}={_format_value(v)}' for k, v in sorted(value.items()))
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.