| 458 | class CustomOpExecutor { |
| 459 | public: |
| 460 | CustomOpExecutor(c10::intrusive_ptr<c10d::ProcessGroup> process_group, |
| 461 | std::shared_ptr<DSParamRegistry> param_registry, |
| 462 | std::shared_ptr<DoubleBufferedReduceBucket> reduce_buckets, |
| 463 | std::vector<long> ds_ids, |
| 464 | ncclComm_t nccl_comm, |
| 465 | at::cuda::CUDAStream rs_stream, |
| 466 | at::cuda::CUDAStream copy_stream, |
| 467 | bool pre_div_reduce) |
| 468 | : process_group_(process_group), |
| 469 | param_registry_(std::move(param_registry)), |
| 470 | reduce_buckets_(std::move(reduce_buckets)), |
| 471 | ds_ids_(std::move(ds_ids)), |
| 472 | nccl_comm_(nccl_comm), |
| 473 | rs_stream_(rs_stream), |
| 474 | copy_stream_(copy_stream), |
| 475 | pre_div_reduce_(pre_div_reduce) |
| 476 | { |
| 477 | for (long ds_id : ds_ids_) { |
| 478 | has_acc_grad_[ds_id] = false; |
| 479 | |
| 480 | rs_comp_done_events_[ds_id] = |
| 481 | std::make_shared<at::cuda::CUDAEvent>(cudaEventDisableTiming); |
| 482 | rs_copy_done_events_[ds_id] = |
| 483 | std::make_shared<at::cuda::CUDAEvent>(cudaEventDisableTiming); |
| 484 | } |
| 485 | reduce_counter_ = ds_ids_.size(); |
| 486 | } |
| 487 | ~CustomOpExecutor() {} |
| 488 | |
| 489 | virtual void startForward() {} |