We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 655dbce commit 5f9dd4aCopy full SHA for 5f9dd4a
python/sglang/srt/managers/schedule_batch.py
@@ -198,8 +198,15 @@ def set_pad_value(self):
198
Set the pad value after first hashign the data
199
"""
200
201
+ def tensor_hash(f):
202
+ f_list = flatten_nested_list(f)
203
+ f_cat = torch.concat(f_list).contiguous().numpy().tobytes()
204
+ return hash(f_cat)
205
+
206
def hash_feature(f):
207
if isinstance(f, list):
208
+ if isinstance(f[0], torch.Tensor):
209
+ return tensor_hash(f)
210
return hash(tuple(flatten_nested_list(f)))
211
elif isinstance(f, np.ndarray):
212
arr = np.ascontiguousarray(f)
0 commit comments