Skip to content

Commit 804455e

Browse files
committed
avoid random write addresses
1 parent 0fe1bee commit 804455e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/sglang/srt/speculative/eagle_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ def get_src_tgt_cache_loc(
937937
page_size: int,
938938
):
939939
src_cache_loc = torch.where(accept_index == -1, 0, out_cache_loc[accept_index])
940-
tgt_cache_loc = torch.empty_like(src_cache_loc)
940+
tgt_cache_loc = torch.zeros_like(src_cache_loc)
941941
extended_len = seq_lens + draft_token_num
942942
keep_len = torch.minimum(
943943
(seq_lens + accept_length + 1 + page_size - 1) // page_size * page_size,

0 commit comments

Comments
 (0)