You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/11/28 05:08:56 UTC
[incubator-mxnet] branch master updated: fix
https://github.com/apache/incubator-mxnet/issues/8262 (#8838)
This is an automated email from the ASF dual-hosted git repository.
jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/master by this push:
new ce4b921 fix https://github.com/apache/incubator-mxnet/issues/8262 (#8838)
ce4b921 is described below
commit ce4b9218975baadcdce7dea5105d15e5e08072e7
Author: Haibin Lin <li...@gmail.com>
AuthorDate: Mon Nov 27 21:08:52 2017 -0800
fix https://github.com/apache/incubator-mxnet/issues/8262 (#8838)
---
src/kvstore/comm.h | 2 ++
src/ndarray/ndarray.cc | 7 +++----
tests/python/gpu/test_kvstore_gpu.py | 1 -
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/kvstore/comm.h b/src/kvstore/comm.h
index 5e15c2a..5429df7 100644
--- a/src/kvstore/comm.h
+++ b/src/kvstore/comm.h
@@ -251,6 +251,8 @@ class CommCPU : public Comm {
[=](RunContext rctx, Engine::CallbackOnComplete on_complete) {
CopyRetainedRowsToGPU(rctx.get_stream<cpu>(), rctx.get_stream<gpu>(),
src, row_id, out);
+ // wait for GPU operations to complete
+ rctx.get_stream<gpu>()->Wait();
on_complete();
}, out->ctx(), {src.var(), row_id.var()}, {out->var()},
FnProperty::kCopyToGPU, priority, PROFILER_MESSAGE("KVStoreCopyRetainedRowsToGPU"));
diff --git a/src/ndarray/ndarray.cc b/src/ndarray/ndarray.cc
index 4a096d1..25fd505 100644
--- a/src/ndarray/ndarray.cc
+++ b/src/ndarray/ndarray.cc
@@ -505,10 +505,6 @@ void CopyFromToImpl(const NDArray& from, const NDArray& to, RunContext rctx) {
LOG(FATAL) << "unknown storage type" << to_stype;
}
}
- if (is_same<from_xpu, mshadow::gpu>::value || is_same<to_xpu, mshadow::gpu>::value) {
- // Wait GPU kernel to complete
- rctx.get_stream<gpu>()->Wait();
- }
}
void CopyFromTo(const NDArray& from, const NDArray& to, int priority) {
@@ -540,6 +536,7 @@ void CopyFromTo(const NDArray& from, const NDArray& to, int priority) {
Engine::Get()->PushAsync(
[from, to](RunContext ctx, Engine::CallbackOnComplete on_complete) {
CopyFromToImpl<cpu, gpu>(from, to, ctx);
+ ctx.get_stream<gpu>()->Wait();
on_complete();
}, to.ctx(), const_vars, {to.var()},
FnProperty::kCopyToGPU, priority, PROFILER_MESSAGE("CopyCPU2GPU"));
@@ -547,6 +544,7 @@ void CopyFromTo(const NDArray& from, const NDArray& to, int priority) {
Engine::Get()->PushAsync(
[from, to](RunContext ctx, Engine::CallbackOnComplete on_complete) {
CopyFromToImpl<gpu, cpu>(from, to, ctx);
+ ctx.get_stream<gpu>()->Wait();
on_complete();
}, from.ctx(), const_vars, {to.var()},
FnProperty::kCopyFromGPU, priority, PROFILER_MESSAGE("CopyGPU2CPU"));
@@ -554,6 +552,7 @@ void CopyFromTo(const NDArray& from, const NDArray& to, int priority) {
Engine::Get()->PushAsync(
[from, to](RunContext ctx, Engine::CallbackOnComplete on_complete) {
CopyFromToImpl<gpu, gpu>(from, to, ctx);
+ ctx.get_stream<gpu>()->Wait();
on_complete();
}, from.ctx(), const_vars, {to.var()},
from.dtype() != to.dtype() ? FnProperty::kNormal : FnProperty::kCopyFromGPU,
diff --git a/tests/python/gpu/test_kvstore_gpu.py b/tests/python/gpu/test_kvstore_gpu.py
index 517d2e7..20528be 100644
--- a/tests/python/gpu/test_kvstore_gpu.py
+++ b/tests/python/gpu/test_kvstore_gpu.py
@@ -36,7 +36,6 @@ def init_kv_with_str(stype='default'):
return kv
-@unittest.skip("Test fails intermittently. Temporarily disabled until fixed. Tracked at https://github.com/apache/incubator-mxnet/issues/8262")
def test_row_sparse_pull():
kv = init_kv_with_str('row_sparse')
kv.init('e', mx.nd.ones(shape).tostype('row_sparse'))
--
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].