MCPcopy
hub / github.com/deepspeedai/DeepSpeed / write

Method write

deepspeed/nvme/torch_io.py:29–37  ·  view source on GitHub ↗
(self, args, tid)

Source from the content-addressed store, hash-verified

27 self.ctxt[ELAPSED_SEC] += end_time - start_time
28
29 def write(self, args, tid):
30 # Avoid overwriting existing files as it could be artificially faster
31 if os.path.isfile(self.ctxt[FILE]):
32 os.remove(self.ctxt[FILE])
33
34 start_time = time.time()
35 torch.save(obj=self.ctxt[BUFFER], f=self.ctxt[FILE], _use_new_zipfile_serialization=self.zipfile_serialization)
36 end_time = time.time()
37 self.ctxt[ELAPSED_SEC] += end_time - start_time
38
39 def _create_context(self, args, tid, read_op):
40 io_string = "Read" if read_op else "Write"

Callers 15

setup.pyFile · 0.45
modify_file_headerFunction · 0.45
__exit__Method · 0.45
_do_ref_writeFunction · 0.45
test_offset_writeMethod · 0.45
_do_ref_writeFunction · 0.45
test_offset_writeMethod · 0.45
test_get_optim_filesFunction · 0.45
user_script_fpFunction · 0.45
test_bash_string_argsFunction · 0.45

Calls 1

saveMethod · 0.45

Tested by 9

_do_ref_writeFunction · 0.36
test_offset_writeMethod · 0.36
_do_ref_writeFunction · 0.36
test_offset_writeMethod · 0.36
test_get_optim_filesFunction · 0.36
user_script_fpFunction · 0.36
test_bash_string_argsFunction · 0.36
runMethod · 0.36