提交 b78efd5b 编写于 作者: P panfengfeng

fix gpu invalid input data

上级 8867c67d
...@@ -232,13 +232,17 @@ Status DeviceQueueOp::RetryPushGPUData(const std::vector<size_t> &data_size, con ...@@ -232,13 +232,17 @@ Status DeviceQueueOp::RetryPushGPUData(const std::vector<size_t> &data_size, con
while (!GpuBufferMgr::GetInstance().IsClosed() && !TaskManager::FindMe()->Interrupted()) { while (!GpuBufferMgr::GetInstance().IsClosed() && !TaskManager::FindMe()->Interrupted()) {
RETURN_IF_NOT_OK(MallocForGPUData(&items, curr_row)); RETURN_IF_NOT_OK(MallocForGPUData(&items, curr_row));
auto ret = GpuBufferMgr::GetInstance().Push(handle, items, WAIT_TIME); BlockQueueStatus_T ret = GpuBufferMgr::GetInstance().Push(handle, items, WAIT_TIME);
if (ret) { if (ret) {
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
free(items[i].data_ptr_); free(items[i].data_ptr_);
} }
MS_LOG(WARNING) << "Retry pushing data..."; if (ret == BlockQueueStatus_T::ERROR_INPUT) {
continue; return Status(StatusCode::kUnexpectedError, __LINE__, __FILE__, "invalid input Data, please check it.");
} else {
MS_LOG(WARNING) << "Retry pushing data...";
continue;
}
} else { } else {
break; break;
} }
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
#ifdef ENABLE_TDTQUE #ifdef ENABLE_TDTQUE
#include "dataset/engine/tdt/tdt_plugin.h" #include "dataset/engine/tdt/tdt_plugin.h"
#endif #endif
#ifdef ENABLE_GPUQUE #ifdef ENABLE_GPUQUE
#include "device/gpu/gpu_buffer_mgr.h" #include "device/gpu/gpu_buffer_mgr.h"
using mindspore::device::BlockQueueStatus_T;
using mindspore::device::GpuBufferMgr; using mindspore::device::GpuBufferMgr;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册