You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/07/05 21:43:48 UTC

[GitHub] [incubator-mxnet] szha commented on a change in pull request #20331: [WIP] Add async GPU dependency Engine

szha commented on a change in pull request #20331:
URL: https://github.com/apache/incubator-mxnet/pull/20331#discussion_r664135001



##########
File path: src/engine/threaded_engine.cc
##########
@@ -523,5 +543,206 @@ void ThreadedEngine::OnCompleteStatic(Engine *engine, void *opr_block_,
   OprBlock::Delete(opr_block);
 }
 
+void ThreadedEngine::OnStartStatic(Engine *engine, void *opr_block,
+                                   const dmlc::Error* error) {
+  // no-op
+}
+
+#if MXNET_USE_CUDA
+static inline void AddEventHelper(
+  std::unordered_map<cudaStream_t, EventInfo>* events_per_stream,
+  const EventInfo& cuda_event) {
+  auto event_stream = cuda_event.stream;
+  if (events_per_stream->count(event_stream) > 0) {
+    if ((*events_per_stream)[event_stream].pool_index < cuda_event.pool_index) {
+      (*events_per_stream)[event_stream] = cuda_event;
+    }
+  } else {
+    (*events_per_stream).emplace(event_stream, cuda_event);
+  }
+}
+
+void ThreadedEngine::OnStartCPU(Engine *engine, void *opr_block,
+                        const dmlc::Error* error) {
+  static bool use_new_dep_engine = dmlc::GetEnv("MXNET_ASYNC_GPU_ENGINE", false);

Review comment:
       We already have `MXNET_ENGINE_TYPE` which decides whether `NaiveEngine` (i.e. synchronous scheduler) is used, so unless there's a strong reason I'd prefer not to introduce new environment variables here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org