MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / pwrite

Method pwrite

csrc/aio/py_lib/deepspeed_py_io_handle.cpp:349–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349int deepspeed_io_handle_t::pwrite(const torch::Tensor& buffer,
350 const char* filename,
351 const bool validate,
352 const bool async,
353 const int64_t file_offset)
354{
355 const auto num_write_bytes = static_cast<int64_t>(buffer.nbytes());
356
357 if (!_is_valid_parallel_aio_op(false, num_write_bytes)) { return -1; }
358
359 const auto fd = open_file(filename, false);
360 if (fd == -1) { return -1; }
361
362 return _pwrite(buffer, fd, filename, validate, async, file_offset);
363}
364
365int deepspeed_io_handle_t::sync_pread(torch::Tensor& buffer,
366 const char* filename,

Callers 4

_invoke_blocking_aioFunction · 0.80
writeMethod · 0.80
PYBIND11_MODULEFunction · 0.80
writeMethod · 0.80

Calls 1

open_fileFunction · 0.85

Tested by 1

_invoke_blocking_aioFunction · 0.64