Skip to content

Commit

Permalink
[Bugfix] Code hardening to scales_shard_indexer.
Browse files Browse the repository at this point in the history
 Note - User to raise an issue on similar cases.
  • Loading branch information
HaiShaw committed Jun 28, 2024
1 parent 832ea88 commit 9134a9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vllm/model_executor/layers/quantization/fp8.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ def scales_shard_indexer(
qkv_idxs = {"q": 0, "k": 1, "v": 2}

if isinstance(shard_id, int):
pass
if shard_id not in qkv_idxs.values():
raise ValueError(f"Out range shard_id: {shard_id}")
elif isinstance(shard_id, str):
if shard_id not in qkv_idxs:
raise ValueError(f"Unknown shard_id: {shard_id}")
Expand Down

0 comments on commit 9134a9f

Please sign in to comment.