Skip to content

Commit

Permalink
bugfix: Fix MLA decode error having v_scale without return_lse (#650)
Browse files Browse the repository at this point in the history
```
[rank0]:   File "/home/simonmo/.conda/envs/vllm/lib/python3.10/site-packages/flashinfer/decode.py", line 1408, in run
[rank0]:     out[0] *= v_scale
[rank0]: TypeError: 'tuple' object does not support item assignment
```

This is saying `out[0]` does not allow mutation.
  • Loading branch information
simon-mo authored Dec 5, 2024
1 parent 0cc1a51 commit 1b998c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/flashinfer/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,10 +1404,10 @@ def run(
maybe_lse,
get_cuda_stream(device),
)
out = (o, maybe_lse) if return_lse else (o,)
out = [o, maybe_lse] if return_lse else [o]
if v_scale is not None:
out[0] *= v_scale

return out if return_lse else out[0]
return tuple(out) if return_lse else out[0]

run_return_lse = functools.partialmethod(run, return_lse=True)

0 comments on commit 1b998c3

Please sign in to comment.