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

Method waitReload

csrc/compile/z3.cpp:405–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403 }
404
405 at::Tensor waitReload(at::Tensor tensor, long id)
406 {
407 assert(hasKey(reload_events_, id));
408 reload_events_[id]->block(at::cuda::getCurrentCUDAStream());
409
410 assert(hasKey(reload_buffers_, id));
411 auto ten = reload_buffers_.at(id);
412
413 // We can't release here because the tensor is still being used
414 // We will need "freeReloadedTensor" after the last user of the tensor to call
415 // ".record_stream". As it is a bit complicated, we clear the buffer and do at the end of
416 // the backward pass for now. reload_buffers_.erase(id);
417 return ten;
418 }
419
420 void offloadParameter(at::Tensor tensor, long ds_id) { param_registry_->offload(ds_id); }
421 void reloadParameter(at::Tensor tensor, long ds_id) { param_registry_->reload(ds_id); }

Callers 1

wait_reloadFunction · 0.80

Calls 3

hasKeyFunction · 0.85
getCurrentCUDAStreamFunction · 0.85
blockMethod · 0.80

Tested by

no test coverage detected