Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions executors/accelerate/src/hypha/accelerate_executor/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ def __iter__(self): # type: ignore[no-untyped-def]
while cursor + self.batch_size <= num_new:
end = cursor + self.batch_size

# Yield a CLEAN, CONTIGUOUS copy
# This prevents sending a "View" of the whole file to the worker queue
batch = {k: v[cursor:end].contiguous() for k, v in processed.items()}
# Yield a clean, INDEPENDENT copy using .clone()
# This prevents sending a "View" of the underlying raw_bytes buffer
# which might be gc'ed when the loop iterates.
batch = {k: v[cursor:end].clone() for k, v in processed.items()}
yield batch

cursor = end
Expand Down