From 2bbce2f924fff4193380a89a27f21525a5f1a1c8 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 12 May 2020 19:07:03 +0800 Subject: [PATCH] fix(mgb/opr-mm): fix m_megray_ctx init GitOrigin-RevId: 7804fbe2ef28b6014e3f82a59675948442665e7d --- src/opr-mm/impl/collective_comm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opr-mm/impl/collective_comm.cpp b/src/opr-mm/impl/collective_comm.cpp index f77f3827..5f6166e1 100644 --- a/src/opr-mm/impl/collective_comm.cpp +++ b/src/opr-mm/impl/collective_comm.cpp @@ -408,7 +408,6 @@ CollectiveComm::CollectiveComm( "CollectiveComm inputs should not contain duplicated input device"); ModeTrait::from_mode(param.mode).add_output_var(this, inp_cn); - m_megray_ctx = MegRay::CudaContext::make(get_stream(output(0))); const char* c_debug = MGB_GETENV("MGE_MM_OPR_DEBUG"); if (c_debug != nullptr and strcmp(c_debug, "1") == 0) { @@ -469,6 +468,8 @@ void CollectiveComm::opr_register() { hash, m_key, m_nr_devices, m_rank, get_megray_backend(m_backend), m_group_client); + m_megray_ctx = MegRay::CudaContext::make(get_stream(output(0))); + m_init = true; } -- GitLab