Skip to content

Commit

Permalink
[fio] use raw tensor ptr instead of numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
botbw committed Oct 14, 2024
1 parent dbeb508 commit 557f389
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tensornvme/async_file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ def save(
self.write(header_bytes)

for tensor in tensors:
tensor_bytes = _tobytes(tensor, '')
self.write(tensor_bytes)
self.io.write(tensor.data_ptr(), tensor.numel() * tensor.element_size(), self.offset)
self.offset += tensor.numel() * tensor.element_size()
self.buffers.append(tensor)

def flush(self) -> None:
pass
Expand Down

0 comments on commit 557f389

Please sign in to comment.