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

Method pwrite

csrc/aio/py_lib/deepspeed_py_io_handle.cpp:313–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313int deepspeed_io_handle_t::pwrite(const torch::Tensor& buffer,
314 const char* filename,
315 const bool validate,
316 const bool async,
317 const int64_t file_offset)
318{
319 const auto num_write_bytes = static_cast<int64_t>(buffer.nbytes());
320
321 if (!_is_valid_parallel_aio_op(false, num_write_bytes)) { return -1; }
322
323 const auto fd = open_file(filename, false);
324 if (fd == -1) { return -1; }
325
326 return _pwrite(buffer, fd, filename, validate, async, file_offset);
327}
328
329int deepspeed_io_handle_t::sync_pread(torch::Tensor& buffer,
330 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