Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
OneFlow-Benchmark
提交
102ab268
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 搜索 >>
未验证
提交
102ab268
编写于
8月 23, 2021
作者:
X
XIE Xuan
提交者:
GitHub
8月 23, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #212 from Oneflow-Inc/dev_resnet_print_memory_used
resnet print utilization.gpu memory.used
上级
a5460d74
98ad0f9c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
0 deletion
+12
-0
Classification/cnns/config.py
Classification/cnns/config.py
+4
-0
Classification/cnns/of_cnn_train_val.py
Classification/cnns/of_cnn_train_val.py
+2
-0
Classification/cnns/util.py
Classification/cnns/util.py
+6
-0
未找到文件。
Classification/cnns/config.py
浏览文件 @
102ab268
...
...
@@ -71,6 +71,7 @@ def get_parser(parser=None):
parser
.
add_argument
(
"--use_xla"
,
type
=
str2bool
,
nargs
=
"?"
,
const
=
True
,
help
=
"Whether to use use xla"
)
parser
.
add_argument
(
"--channel_last"
,
type
=
str2bool
,
...
...
@@ -94,6 +95,9 @@ def get_parser(parser=None):
parser
.
add_argument
(
"--batch_size_per_device"
,
type
=
int
,
default
=
64
)
parser
.
add_argument
(
"--val_batch_size_per_device"
,
type
=
int
,
default
=
8
)
parser
.
add_argument
(
"--use_rdma"
,
type
=
str2bool
,
nargs
=
"?"
,
const
=
True
,
help
=
"Use rdma."
,
)
parser
.
add_argument
(
"--nccl_fusion_threshold_mb"
,
type
=
int
,
...
...
Classification/cnns/of_cnn_train_val.py
浏览文件 @
102ab268
...
...
@@ -64,6 +64,8 @@ if args.nccl_fusion_threshold_mb:
if
args
.
nccl_fusion_max_ops
:
flow
.
config
.
collective_boxing
.
nccl_fusion_max_ops
(
args
.
nccl_fusion_max_ops
)
if
args
.
num_nodes
>
1
and
args
.
use_rdma
:
flow
.
config
.
use_rdma
(
True
)
def
label_smoothing
(
labels
,
classes
,
eta
,
dtype
):
assert
classes
>
0
...
...
Classification/cnns/util.py
浏览文件 @
102ab268
...
...
@@ -94,6 +94,7 @@ class Metric(object):
prediction_key
=
"predictions"
,
label_key
=
"labels"
,
loss_key
=
None
,
nvidia_smi_report_step
=
10
,
):
self
.
desc
=
desc
self
.
calculate_batches
=
calculate_batches
...
...
@@ -101,6 +102,7 @@ class Metric(object):
self
.
prediction_key
=
prediction_key
self
.
label_key
=
label_key
self
.
loss_key
=
loss_key
self
.
nvidia_smi_report_step
=
nvidia_smi_report_step
if
loss_key
:
self
.
fmt
=
"{}: epoch {}, iter {}, loss: {:.6f}, top_1: {:.6f}, top_k: {:.6f}, samples/s: {:.3f}"
else
:
...
...
@@ -121,6 +123,10 @@ class Metric(object):
def
callback
(
outputs
):
if
step
==
0
:
self
.
_clear
()
if
self
.
loss_key
and
epoch
==
0
and
step
==
self
.
nvidia_smi_report_step
:
cmd
=
"nvidia-smi --query-gpu=utilization.gpu,memory.used --format=csv"
os
.
system
(
cmd
)
if
self
.
prediction_key
:
num_matched
,
num_samples
=
match_top_k
(
outputs
[
self
.
prediction_key
],
outputs
[
self
.
label_key
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录