Even Faster I/O (#1369)

* try multithreading for faster IO

* smaller batch size

* Account for pread returning less than size

* nit

---------

Co-authored-by: Angelos Katharopoulos <a_katharopoulos@apple.com>
This commit is contained in:
Awni Hannun
2024-08-28 11:49:07 -07:00
committed by GitHub
parent 4e22a1dffe
commit fcb65a3897
6 changed files with 157 additions and 27 deletions

View File

@@ -33,8 +33,7 @@ void Load::eval(const std::vector<array>& inputs, array& out) {
assert(inputs.size() == 0);
out.set_data(allocator::malloc_or_wait(out.nbytes()));
reader_->seek(offset_);
reader_->read(out.data<char>(), out.nbytes());
reader_->read(out.data<char>(), out.nbytes(), offset_);
if (swap_endianness_) {
switch (out.itemsize()) {