Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
OneFlow-Benchmark
提交
7595690b
O
OneFlow-Benchmark
项目概览
Oneflow-Inc
/
OneFlow-Benchmark
上一次同步 2 年多
通知
1
Star
92
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneFlow-Benchmark
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
7595690b
编写于
7月 21, 2020
作者:
L
Lyon
提交者:
GitHub
7月 21, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #46 from Oneflow-Inc/of_develop_py3_luyang
Of develop py3 luyang
上级
5be972e6
c622d7ce
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
6 addition
and
45 deletion
+6
-45
Classification/cnns/README.md
Classification/cnns/README.md
+0
-2
Classification/cnns/config.py
Classification/cnns/config.py
+0
-8
Classification/cnns/job_function_util.py
Classification/cnns/job_function_util.py
+1
-3
Classification/cnns/of_cnn_inference.py
Classification/cnns/of_cnn_inference.py
+2
-2
Classification/cnns/of_cnn_train_val.py
Classification/cnns/of_cnn_train_val.py
+0
-4
Classification/cnns/resnet_model.py
Classification/cnns/resnet_model.py
+1
-1
Classification/cnns/util.py
Classification/cnns/util.py
+2
-2
ClickThroughRate/WideDeepLearning/wdl_train_eval.py
ClickThroughRate/WideDeepLearning/wdl_train_eval.py
+0
-1
ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py
ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py
+0
-1
LanguageModeling/BERT/run_pretraining.py
LanguageModeling/BERT/run_pretraining.py
+0
-7
LanguageModeling/BERT/run_squad.py
LanguageModeling/BERT/run_squad.py
+0
-7
LanguageModeling/BERT/run_squad_predict.py
LanguageModeling/BERT/run_squad_predict.py
+0
-7
未找到文件。
Classification/cnns/README.md
浏览文件 @
7595690b
...
...
@@ -601,7 +601,6 @@ python3 cnn_benchmark/of_cnn_train_val.py \
--val_batch_size_per_device=512 \
--num_epoch=90 \
--use_fp16=false \
--use_boxing_v2=false \
--model="alexnet" \
```
...
...
@@ -630,7 +629,6 @@ python3 cnn_benchmark/of_cnn_train_val.py \
--val_batch_size_per_device=128 \
--num_epoch=90 \
--use_fp16=false \
--use_boxing_v2=false \
--model="vgg" \
```
...
...
Classification/cnns/config.py
浏览文件 @
7595690b
...
...
@@ -50,14 +50,6 @@ def get_parser(parser=None):
const
=
True
,
help
=
'Whether to use use fp16'
)
parser
.
add_argument
(
'--use_boxing_v2'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'Whether to use boxing v2'
)
parser
.
add_argument
(
'--channel_last'
,
type
=
str2bool
,
...
...
Classification/cnns/job_function_util.py
浏览文件 @
7595690b
...
...
@@ -8,7 +8,7 @@ from optimizer_util import gen_model_update_conf
def
_default_config
(
args
):
config
=
flow
.
function_config
()
config
.
default_distribute_strategy
(
flow
.
distribute
.
consistent_strategy
())
config
.
default_distribute_strategy
(
flow
.
scope
.
consistent_view
())
config
.
default_data_type
(
flow
.
float
)
if
args
.
use_fp16
:
config
.
enable_auto_mixed_precision
(
True
)
...
...
@@ -22,8 +22,6 @@ def get_train_config(args):
train_config
.
all_reduce_group_min_mbyte
(
8
)
train_config
.
all_reduce_group_num
(
128
)
if
args
.
use_boxing_v2
:
train_config
.
use_boxing_v2
(
True
)
train_config
.
prune_parallel_cast_ops
(
True
)
train_config
.
train
.
model_update_conf
(
gen_model_update_conf
(
args
))
...
...
Classification/cnns/of_cnn_inference.py
浏览文件 @
7595690b
...
...
@@ -43,8 +43,8 @@ def main():
image
=
load_image
(
args
.
image_path
)
predictions
=
InferenceNet
(
image
).
get
()
clsidx
=
predictions
.
n
darra
y
().
argmax
()
print
(
predictions
.
n
darra
y
().
max
(),
clsidx_2_labels
[
clsidx
])
clsidx
=
predictions
.
n
ump
y
().
argmax
()
print
(
predictions
.
n
ump
y
().
max
(),
clsidx_2_labels
[
clsidx
])
if
__name__
==
"__main__"
:
...
...
Classification/cnns/of_cnn_train_val.py
浏览文件 @
7595690b
...
...
@@ -34,10 +34,6 @@ model_dict = {
flow
.
config
.
gpu_device_num
(
args
.
gpu_num_per_node
)
flow
.
config
.
enable_debug_mode
(
True
)
if
args
.
use_boxing_v2
:
flow
.
config
.
collective_boxing
.
nccl_fusion_threshold_mb
(
8
)
flow
.
config
.
collective_boxing
.
nccl_fusion_all_reduce_use_buffer
(
False
)
def
label_smoothing
(
labels
,
classes
,
eta
,
dtype
):
assert
classes
>
0
...
...
Classification/cnns/resnet_model.py
浏览文件 @
7595690b
...
...
@@ -141,7 +141,7 @@ def resnet50(images, trainable=True, need_transpose=False, training=True, wd=1.0
if
channel_last
:
# if channel_last=True, then change mode from 'nchw' to 'nhwc'
images
=
flow
.
transpose
(
images
,
name
=
"transpose"
,
perm
=
[
0
,
2
,
3
,
1
])
with
flow
.
deprecated
.
variable_scop
e
(
"Resnet"
):
with
flow
.
scope
.
namespac
e
(
"Resnet"
):
stem
=
builder
.
resnet_stem
(
images
)
body
=
builder
.
resnet_conv_x_body
(
stem
)
pool5
=
flow
.
nn
.
avg_pool2d
(
...
...
Classification/cnns/util.py
浏览文件 @
7595690b
...
...
@@ -85,8 +85,8 @@ class StopWatch(object):
def
match_top_k
(
predictions
,
labels
,
top_k
=
1
):
max_k_preds
=
np
.
argpartition
(
predictions
.
n
darra
y
(),
-
top_k
)[:,
-
top_k
:]
match_array
=
np
.
logical_or
.
reduce
(
max_k_preds
==
labels
.
reshape
((
-
1
,
1
)),
axis
=
1
)
max_k_preds
=
np
.
argpartition
(
predictions
.
n
ump
y
(),
-
top_k
)[:,
-
top_k
:]
match_array
=
np
.
logical_or
.
reduce
(
max_k_preds
==
labels
.
reshape
((
-
1
,
1
)),
axis
=
1
)
num_matched
=
match_array
.
sum
()
return
num_matched
,
match_array
.
shape
[
0
]
...
...
ClickThroughRate/WideDeepLearning/wdl_train_eval.py
浏览文件 @
7595690b
...
...
@@ -111,7 +111,6 @@ def _get_train_conf():
'lazy_adam_conf'
:
{
}
})
train_conf
.
use_boxing_v2
(
True
)
train_conf
.
default_distribute_strategy
(
flow
.
distribute
.
consistent_strategy
())
train_conf
.
indexed_slices_optimizer_conf
(
dict
(
include_op_names
=
dict
(
op_name
=
[
'wide_embedding'
,
'deep_embedding'
])))
return
train_conf
...
...
ClickThroughRate/WideDeepLearning/wdl_train_eval_test.py
浏览文件 @
7595690b
...
...
@@ -118,7 +118,6 @@ def _get_train_conf():
'lazy_adam_conf'
:
{
}
})
train_conf
.
use_boxing_v2
(
True
)
train_conf
.
default_distribute_strategy
(
flow
.
distribute
.
consistent_strategy
())
train_conf
.
indexed_slices_optimizer_conf
(
dict
(
include_op_names
=
dict
(
op_name
=
[
'wide_embedding'
,
'deep_embedding'
])))
return
train_conf
...
...
LanguageModeling/BERT/run_pretraining.py
浏览文件 @
7595690b
...
...
@@ -37,8 +37,6 @@ parser.add_argument("--log_every_n_iter", type=int, default=1, help="print loss
parser
.
add_argument
(
"--data_dir"
,
type
=
str
,
default
=
None
)
parser
.
add_argument
(
"--data_part_num"
,
type
=
int
,
default
=
32
,
help
=
"data part number in dataset"
)
parser
.
add_argument
(
'--use_fp16'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use use fp16 or not'
)
parser
.
add_argument
(
'--use_boxing_v2'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use boxing v2 or not'
)
# log and resore/save
parser
.
add_argument
(
"--loss_print_every_n_iter"
,
type
=
int
,
default
=
10
,
required
=
False
,
...
...
@@ -164,8 +162,6 @@ config.train.model_update_conf(_BERT_MODEL_UPDATE_CONF)
if
args
.
use_fp16
:
config
.
enable_auto_mixed_precision
(
True
)
if
args
.
use_boxing_v2
:
config
.
use_boxing_v2
(
True
)
@
flow
.
global_function
(
config
)
...
...
@@ -206,9 +202,6 @@ def main():
flow
.
config
.
gpu_device_num
(
args
.
gpu_num_per_node
)
flow
.
env
.
log_dir
(
args
.
log_dir
)
if
args
.
use_boxing_v2
:
flow
.
config
.
collective_boxing
.
nccl_fusion_threshold_mb
(
8
)
flow
.
config
.
collective_boxing
.
nccl_fusion_all_reduce_use_buffer
(
False
)
if
args
.
node_num
>
1
:
...
...
LanguageModeling/BERT/run_squad.py
浏览文件 @
7595690b
...
...
@@ -37,8 +37,6 @@ parser.add_argument("--log_every_n_iter", type=int, default=1, help="print loss
parser
.
add_argument
(
"--data_dir"
,
type
=
str
,
default
=
None
)
parser
.
add_argument
(
"--data_part_num"
,
type
=
int
,
default
=
32
,
help
=
"data part number in dataset"
)
parser
.
add_argument
(
'--use_fp16'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use use fp16 or not'
)
parser
.
add_argument
(
'--use_boxing_v2'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use boxing v2 or not'
)
# log and resore/save
parser
.
add_argument
(
"--loss_print_every_n_iter"
,
type
=
int
,
default
=
10
,
required
=
False
,
...
...
@@ -160,8 +158,6 @@ config.train.model_update_conf(_BERT_MODEL_UPDATE_CONF)
if
args
.
use_fp16
:
config
.
enable_auto_mixed_precision
(
True
)
if
args
.
use_boxing_v2
:
config
.
use_boxing_v2
(
True
)
@
flow
.
global_function
(
config
)
...
...
@@ -202,9 +198,6 @@ def main():
flow
.
config
.
gpu_device_num
(
args
.
gpu_num_per_node
)
flow
.
env
.
log_dir
(
args
.
log_dir
)
if
args
.
use_boxing_v2
:
flow
.
config
.
collective_boxing
.
nccl_fusion_threshold_mb
(
8
)
flow
.
config
.
collective_boxing
.
nccl_fusion_all_reduce_use_buffer
(
False
)
if
args
.
node_num
>
1
:
...
...
LanguageModeling/BERT/run_squad_predict.py
浏览文件 @
7595690b
...
...
@@ -38,8 +38,6 @@ parser.add_argument("--log_every_n_iter", type=int, default=1, help="print loss
parser
.
add_argument
(
"--data_dir"
,
type
=
str
,
default
=
None
)
parser
.
add_argument
(
"--data_part_num"
,
type
=
int
,
default
=
32
,
help
=
"data part number in dataset"
)
parser
.
add_argument
(
'--use_fp16'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use use fp16 or not'
)
parser
.
add_argument
(
'--use_boxing_v2'
,
type
=
str2bool
,
nargs
=
'?'
,
const
=
True
,
help
=
'use boxing v2 or not'
)
# log and resore/save
parser
.
add_argument
(
"--loss_print_every_n_iter"
,
type
=
int
,
default
=
10
,
required
=
False
,
...
...
@@ -156,8 +154,6 @@ config.default_distribute_strategy(flow.distribute.consistent_strategy())
if
args
.
use_fp16
:
config
.
enable_auto_mixed_precision
(
True
)
if
args
.
use_boxing_v2
:
config
.
use_boxing_v2
(
True
)
@
flow
.
global_function
(
config
)
...
...
@@ -198,9 +194,6 @@ def main():
flow
.
config
.
gpu_device_num
(
args
.
gpu_num_per_node
)
flow
.
env
.
log_dir
(
args
.
log_dir
)
if
args
.
use_boxing_v2
:
flow
.
config
.
collective_boxing
.
nccl_fusion_threshold_mb
(
8
)
flow
.
config
.
collective_boxing
.
nccl_fusion_all_reduce_use_buffer
(
False
)
if
args
.
node_num
>
1
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录