Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
2909b637
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2909b637
编写于
7月 13, 2020
作者:
J
Jesse Lee
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Addressing late comment
上级
eadcb341
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
7 deletion
+8
-7
mindspore/ccsrc/dataset/engine/cache/cache_service.cc
mindspore/ccsrc/dataset/engine/cache/cache_service.cc
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.cc
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.cc
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.h
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.h
+2
-2
mindspore/ccsrc/dataset/engine/datasetops/cache_merge_op.cc
mindspore/ccsrc/dataset/engine/datasetops/cache_merge_op.cc
+4
-3
未找到文件。
mindspore/ccsrc/dataset/engine/cache/cache_service.cc
浏览文件 @
2909b637
...
...
@@ -105,7 +105,7 @@ Status CacheService::CacheRow(const std::vector<const void *> &buf, row_id_type
RETURN_IF_NOT_OK
(
cp_
->
Insert
(
all_data
,
&
key
));
Status
rc
=
map_
->
DoInsert
(
*
row_id_generated
,
key
);
if
(
rc
==
Status
(
StatusCode
::
kDuplicateKey
))
{
MS_LOG
(
DEBUG
)
<<
"Ignoring duplicate key"
;
MS_LOG
(
DEBUG
)
<<
"Ignoring duplicate key
.
"
;
}
else
{
RETURN_IF_NOT_OK
(
rc
);
}
...
...
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.cc
浏览文件 @
2909b637
...
...
@@ -53,7 +53,7 @@ CacheBase::CacheBase(int32_t num_workers, int32_t op_connector_size, int32_t row
cache_client_
(
cache_client
),
rows_per_buffer_
(
rows_per_buf
),
// We can cause deadlock if this internal Connector size is too small.
keys_miss_
(
num_workers_
,
1
,
1024
)
{
keys_miss_
(
num_workers_
,
1
,
connector_capacity_
)
{
io_block_queues_
.
Init
(
num_workers
,
op_connector_size
);
}
// Common function to fetch samples from the sampler and send them using the io_block_queues to
...
...
mindspore/ccsrc/dataset/engine/datasetops/cache_base_op.h
浏览文件 @
2909b637
...
...
@@ -48,8 +48,6 @@ class CacheBase : public ParallelOp {
/// \brief Destructor
~
CacheBase
();
constexpr
static
int
eoe_row_id
=
-
1
;
/// \brief Overrides base class reset method. When an operator does a reset, it cleans up any state
/// info from it's previous execution and then initializes itself so that it can be executed
/// again.
...
...
@@ -80,6 +78,7 @@ class CacheBase : public ParallelOp {
virtual
bool
AllowCacheMiss
()
=
0
;
protected:
constexpr
static
int32_t
eoe_row_id
=
-
1
;
std
::
shared_ptr
<
CacheClient
>
cache_client_
;
WaitPost
epoch_sync_
;
int32_t
rows_per_buffer_
;
...
...
@@ -100,6 +99,7 @@ class CacheBase : public ParallelOp {
Status
UpdateColumnMapFromCache
();
private:
constexpr
static
int32_t
connector_capacity_
=
1024
;
QueueList
<
std
::
unique_ptr
<
IOBlock
>>
io_block_queues_
;
};
}
// namespace dataset
...
...
mindspore/ccsrc/dataset/engine/datasetops/cache_merge_op.cc
浏览文件 @
2909b637
...
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "dataset/engine/datasetops/cache_merge_op.h"
#include <algorithm>
#include <functional>
...
...
@@ -20,7 +21,6 @@
#include "dataset/core/config_manager.h"
#include "dataset/core/constants.h"
#include "dataset/core/global_context.h"
#include "dataset/engine/datasetops/cache_merge_op.h"
#include "dataset/engine/opt/pass.h"
#include "dataset/engine/execution_tree.h"
#include "dataset/util/task_manager.h"
...
...
@@ -50,7 +50,8 @@ Status CacheMergeOp::operator()() {
// A queue of row id to let cleaner send cache miss rows to the cache server
// We don't want a small queue as this will block the parallel op workers.
// A row id is 8 byte integer. So bigger size doesn't consume a lot of memory.
io_que_
=
std
::
make_unique
<
Queue
<
row_id_type
>>
(
512
);
static
const
int32_t
queue_sz
=
512
;
io_que_
=
std
::
make_unique
<
Queue
<
row_id_type
>>
(
queue_sz
);
RETURN_IF_NOT_OK
(
io_que_
->
Register
(
tree_
->
AllTasks
()));
RETURN_IF_NOT_OK
(
tree_
->
LaunchWorkers
(
num_workers_
,
std
::
bind
(
&
CacheMergeOp
::
WorkerEntry
,
this
,
std
::
placeholders
::
_1
)));
...
...
@@ -151,7 +152,7 @@ Status CacheMergeOp::Cleaner() {
}
TensorRow
row
;
RETURN_IF_NOT_OK
(
rq
->
Release
(
&
row
));
CHECK_FAIL_RETURN_UNEXPECTED
(
!
row
.
empty
(),
"Programming error"
);
CHECK_FAIL_RETURN_UNEXPECTED
(
!
row
.
empty
(),
"Programming error
.
"
);
Status
rc
=
cache_client_
->
WriteRow
(
row
);
// Bad rc should not bring down the pipeline
if
(
rc
.
IsError
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录