[bug] fix early return (#5740)

* [bug] fix silly bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [chore] add test for prefetch

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
botbw
2024-05-21 14:21:58 +08:00
committed by GitHub
parent 83716e9feb
commit 13c06d36a3
9 changed files with 50 additions and 19 deletions

View File

@@ -361,10 +361,11 @@ class Chunk:
"""Make the chunk usable for the parameters inside it. It's an operation done in CUDA."""
# sanity check
assert self.chunk_temp is None
maybe_work = None
if not self.is_gathered:
return self.__gather(async_op=async_access)
maybe_work = self.__gather(async_op=async_access)
self.__update_tensors_ptr()
return None
return maybe_work
def release_chunk(self):
"""Release the usable chunk. It's an operation done in CUDA."""