Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
比较版本
77637368b5c957cdbfff82fe0dab5c66cc57c9a9...2c3e4383c34cfc48cfd3554bf04ecebb5a56e008
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 2 年多
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
源分支
2c3e4383c34cfc48cfd3554bf04ecebb5a56e008
选择Git版本
...
目标分支
77637368b5c957cdbfff82fe0dab5c66cc57c9a9
选择Git版本
比较
Commits (8)
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/f88c979a345d6fef5bae083daf0e536b4b848882
update speed test threshold (#6664)
2021-11-01T20:31:21+08:00
daquexian
daquexian566@gmail.com
Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:daquexian566@gmail.com" title="daquexian566@gmail.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:daquexian566@gmail.com" title="daquexian566@gmail.com">daquexian</a> <<a href="mailto:daquexian566@gmail.com" title="daquexian566@gmail.com">daquexian566@gmail.com</a>></span> Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com">oneflow-ci-bot</a> <<a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com">69100618+oneflow-ci-bot@users.noreply.github.com</a>></span>
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/21caffd9d94e70538a9035abdcf215405d045167
just macro: rename local variables to prevent shadowing (#6667)
2021-11-01T21:37:51+08:00
Twice
i@twice.moe
Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com">oneflow-ci-bot</a> <<a href="mailto:69100618+oneflow-ci-bot@users.noreply.github.com" title="69100618+oneflow-ci-bot@users.noreply.github.com">69100618+oneflow-ci-bot@users.noreply.github.com</a>></span>
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/8b94ac9b8fd0578aeed91a85c955a7f2a400b6aa
restruct reshape gradient funcs (#6634)
2021-11-02T04:15:23+00:00
Luyang
flowingsun007@163.com
* restruct * refine
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/91341e3b10906fd2b06d85e0061fa52cd093158f
Merge branch 'master' into event_pool
2021-11-02T12:44:26+08:00
oneflow-ci-bot
69100618+oneflow-ci-bot@users.noreply.github.com
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/33d10dbbd9cff218e832886f308e1f40e653c697
NOLINT for struct Int define in single_thread_obj_pool_test.cpp
2021-11-02T15:54:13+08:00
lixinqi
lixinqi0703106@163.com
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/02bdaf2ca978aa1f2818316a55963f2d524992e3
reformat
2021-11-02T16:47:43+08:00
lixinqi
lixinqi0703106@163.com
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/2247386074c82dd56248405b52095d9b1609bae8
Fix model update pass adam (#6673)
2021-11-02T18:11:41+08:00
ZZK
42901638+MARD1NO@users.noreply.github.com
* add first version of unary primitive op * fix * remove redundant file * Revert * fix format * use has input to check
https://gitcode.net/Oneflow-Inc/oneflow/-/commit/2c3e4383c34cfc48cfd3554bf04ecebb5a56e008
Merge branch 'master' into event_pool
2021-11-02T18:15:32+08:00
oneflow-ci-bot
69100618+oneflow-ci-bot@users.noreply.github.com
隐藏空白更改
内联
并排
Showing
5 changed file
with
69 addition
and
58 deletion
+69
-58
ci/test/test_speed_multi_client.sh
ci/test/test_speed_multi_client.sh
+4
-4
oneflow/core/autograd/gradient_funcs/reshape.cpp
oneflow/core/autograd/gradient_funcs/reshape.cpp
+10
-5
oneflow/core/common/just.h
oneflow/core/common/just.h
+48
-48
oneflow/core/common/single_thread_obj_pool_test.cpp
oneflow/core/common/single_thread_obj_pool_test.cpp
+1
-1
oneflow/core/job_rewriter/fuse_update_ops_pass.cpp
oneflow/core/job_rewriter/fuse_update_ops_pass.cpp
+6
-0
未找到文件。
ci/test/test_speed_multi_client.sh
浏览文件 @
2c3e4383
...
...
@@ -18,13 +18,13 @@ function write_to_file_and_print {
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 16x3x224x224
--no-show-memory
--times
100 | check_relative_speed 1.01 | write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 8x3x224x224
--no-show-memory
--times
100 | check_relative_speed 1.05 | write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 4x3x224x224
--no-show-memory
--times
200 | check_relative_speed 1.0
5
| write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 2x3x224x224
--no-show-memory
--times
200 | check_relative_speed 1.0
9
| write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 1x3x224x224
--no-show-memory
--times
200 | check_relative_speed 0.9
5
| write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 4x3x224x224
--no-show-memory
--times
200 | check_relative_speed 1.0
1
| write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 2x3x224x224
--no-show-memory
--times
200 | check_relative_speed 1.0
6
| write_to_file_and_print
python3 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 1x3x224x224
--no-show-memory
--times
200 | check_relative_speed 0.9
4
| write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 16x3x224x224
--no-show-memory
--times
100
--ddp
| check_relative_speed 0.99 | write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 8x3x224x224
--no-show-memory
--times
100
--ddp
| check_relative_speed 0.99 | write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 4x3x224x224
--no-show-memory
--times
200
--ddp
| check_relative_speed 0.9
3
| write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 4x3x224x224
--no-show-memory
--times
200
--ddp
| check_relative_speed 0.9
1
| write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 2x3x224x224
--no-show-memory
--times
200
--ddp
| check_relative_speed 0.83 | write_to_file_and_print
python3
-m
oneflow.distributed.launch
--nproc_per_node
2 scripts/compare_speed_with_pytorch.py resnet50/models/resnet50.py resnet50 1x3x224x224
--no-show-memory
--times
200
--ddp
| check_relative_speed 0.82 | write_to_file_and_print
...
...
oneflow/core/autograd/gradient_funcs/reshape.cpp
浏览文件 @
2c3e4383
...
...
@@ -24,7 +24,11 @@ limitations under the License.
namespace
oneflow
{
namespace
one
{
class
ReshapeOpExprGrad
:
public
OpExprGradFunction
<
AutoGradCaptureState
>
{
struct
ReshapeCaptureState
:
public
AutoGradCaptureState
{
DimVector
input_shape_vec
;
};
class
ReshapeOpExprGrad
:
public
OpExprGradFunction
<
ReshapeCaptureState
>
{
public:
Maybe
<
void
>
Init
(
const
OpExpr
&
op
)
override
{
const
auto
*
fw_op_expr
=
dynamic_cast
<
const
UserOpExpr
*>
(
&
op
);
...
...
@@ -32,17 +36,18 @@ class ReshapeOpExprGrad : public OpExprGradFunction<AutoGradCaptureState> {
return
Maybe
<
void
>::
Ok
();
}
Maybe
<
void
>
Capture
(
AutoGrad
CaptureState
*
ctx
,
const
TensorTuple
&
inputs
,
Maybe
<
void
>
Capture
(
Reshape
CaptureState
*
ctx
,
const
TensorTuple
&
inputs
,
const
TensorTuple
&
outputs
,
const
AttrMap
&
attrs
)
const
override
{
ctx
->
SaveTensorForBackward
(
inputs
.
at
(
0
)
);
ctx
->
input_shape_vec
=
inputs
.
at
(
0
)
->
shape
()
->
dim_vec
(
);
return
Maybe
<
void
>::
Ok
();
}
Maybe
<
void
>
Apply
(
const
AutoGrad
CaptureState
*
ctx
,
const
TensorTuple
&
out_grads
,
Maybe
<
void
>
Apply
(
const
Reshape
CaptureState
*
ctx
,
const
TensorTuple
&
out_grads
,
TensorTuple
*
in_grads
)
const
override
{
const
auto
&
saved_tensors
=
ctx
->
SavedTensors
();
in_grads
->
resize
(
1
);
in_grads
->
at
(
0
)
=
JUST
(
functional
::
ReshapeLike
(
out_grads
.
at
(
0
),
saved_tensors
.
at
(
0
)));
Shape
shape
(
ctx
->
input_shape_vec
);
in_grads
->
at
(
0
)
=
JUST
(
functional
::
Reshape
(
out_grads
.
at
(
0
),
shape
));
return
Maybe
<
void
>::
Ok
();
}
};
...
...
oneflow/core/common/just.h
浏览文件 @
2c3e4383
...
...
@@ -90,62 +90,62 @@ typename std::remove_const<typename std::remove_reference<T>::type>::type&& Remo
#if defined(__GNUC__) || defined(__CUDACC__) || defined(__clang__)
#define JUST(...) \
::oneflow::private_details::RemoveRValConst(({ \
auto&& value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!::oneflow::private_details::JustIsOk(value_to_check_)) { \
return ::oneflow::private_details::JustErrorAddStackFrame( \
::oneflow::private_details::JustGetError(value_to_check_), __FILE__, __LINE__, \
__FUNCTION__, OF_PP_STRINGIZE(__VA_ARGS__)); \
} \
std::forward<decltype(
value_to_check_)>(value_to_check_);
\
#define JUST(...)
\
::oneflow::private_details::RemoveRValConst(({
\
auto&&
_just_
value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!::oneflow::private_details::JustIsOk(
_just_
value_to_check_)) { \
return ::oneflow::private_details::JustErrorAddStackFrame(
\
::oneflow::private_details::JustGetError(
_just_
value_to_check_), __FILE__, __LINE__, \
__FUNCTION__, OF_PP_STRINGIZE(__VA_ARGS__));
\
}
\
std::forward<decltype(
_just_value_to_check_)>(_just_value_to_check_);
\
})).Data_YouAreNotAllowedToCallThisFuncOutsideThisFile()
#define CHECK_JUST(...) \
([&](const char*
func_name) {
\
auto&& value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!::oneflow::private_details::JustIsOk(value_to_check_)) { \
LOG(FATAL) << ::oneflow::GetFormatedSerializedError( \
::oneflow::private_details::JustErrorAddStackFrame( \
::oneflow::private_details::JustGetError(value_to_check_), __FILE__, __LINE__, \
func_name, OF_PP_STRINGIZE(__VA_ARGS__)));
\
} \
return std::forward<decltype(
value_to_check_)>(value_to_check_);
\
})(__FUNCTION__) \
#define CHECK_JUST(...)
\
([&](const char*
_just_closure_func_name_) {
\
auto&&
_just_
value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!::oneflow::private_details::JustIsOk(
_just_
value_to_check_)) { \
LOG(FATAL) << ::oneflow::GetFormatedSerializedError(
\
::oneflow::private_details::JustErrorAddStackFrame(
\
::oneflow::private_details::JustGetError(
_just_
value_to_check_), __FILE__, __LINE__, \
_just_closure_func_name_, OF_PP_STRINGIZE(__VA_ARGS__)));
\
}
\
return std::forward<decltype(
_just_value_to_check_)>(_just_value_to_check_);
\
})(__FUNCTION__)
\
.Data_YouAreNotAllowedToCallThisFuncOutsideThisFile()
#define JUST_MSG(value, ...) \
::oneflow::private_details::RemoveRValConst(({ \
auto&& value_to_check_ = (value); \
if (!::oneflow::private_details::JustIsOk(value_to_check_)) { \
return ::oneflow::private_details::JustErrorAddMessage( \
::oneflow::Error(::oneflow::private_details::JustGetError(value_to_check_)) \
.AddStackFrame(__FILE__, __LINE__, __FUNCTION__), \
OF_PP_STRINGIZE(value), ": ", __VA_ARGS__); \
} \
std::forward<decltype(
value_to_check_)>(value_to_check_);
\
#define JUST_MSG(value, ...)
\
::oneflow::private_details::RemoveRValConst(({
\
auto&&
_just_
value_to_check_ = (value); \
if (!::oneflow::private_details::JustIsOk(
_just_
value_to_check_)) { \
return ::oneflow::private_details::JustErrorAddMessage(
\
::oneflow::Error(::oneflow::private_details::JustGetError(
_just_
value_to_check_)) \
.AddStackFrame(__FILE__, __LINE__, __FUNCTION__),
\
OF_PP_STRINGIZE(value), ": ", __VA_ARGS__);
\
}
\
std::forward<decltype(
_just_value_to_check_)>(_just_value_to_check_);
\
})).Data_YouAreNotAllowedToCallThisFuncOutsideThisFile()
#define CHECK_JUST_MSG(value, ...) \
([&](const char*
func_name) {
\
auto&& value_to_check_ = (value); \
if (!::oneflow::private_details::JustIsOk(value_to_check_)) { \
LOG(FATAL) << ::oneflow::GetFormatedSerializedError( \
::oneflow::private_details::JustErrorAddMessage( \
::oneflow::Error(::oneflow::private_details::JustGetError(value_to_check_)) \
.AddStackFrame(__FILE__, __LINE__,
func_name),
\
OF_PP_STRINGIZE(value), ": ", __VA_ARGS__) \
.error_proto()); \
} \
return std::forward<decltype(
value_to_check_)>(value_to_check_);
\
})(__FUNCTION__) \
#define CHECK_JUST_MSG(value, ...)
\
([&](const char*
_just_closure_func_name_) {
\
auto&&
_just_
value_to_check_ = (value); \
if (!::oneflow::private_details::JustIsOk(
_just_
value_to_check_)) { \
LOG(FATAL) << ::oneflow::GetFormatedSerializedError(
\
::oneflow::private_details::JustErrorAddMessage(
\
::oneflow::Error(::oneflow::private_details::JustGetError(
_just_
value_to_check_)) \
.AddStackFrame(__FILE__, __LINE__,
_just_closure_func_name_),
\
OF_PP_STRINGIZE(value), ": ", __VA_ARGS__)
\
.error_proto());
\
}
\
return std::forward<decltype(
_just_value_to_check_)>(_just_value_to_check_);
\
})(__FUNCTION__)
\
.Data_YouAreNotAllowedToCallThisFuncOutsideThisFile()
#define JUST_OPT(...) \
::oneflow::private_details::RemoveRValConst(({ \
auto&& value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!value_to_check_.has_value()) { return NullOpt; } \
std::forward<decltype(
value_to_check_)>(value_to_check_);
\
#define JUST_OPT(...)
\
::oneflow::private_details::RemoveRValConst(({
\
auto&&
_just_
value_to_check_ = __JustStackCheckWrapper__(__VA_ARGS__); \
if (!
_just_
value_to_check_.has_value()) { return NullOpt; } \
std::forward<decltype(
_just_value_to_check_)>(_just_value_to_check_);
\
})).Data_YouAreNotAllowedToCallThisFuncOutsideThisFile()
#else
...
...
oneflow/core/common/single_thread_obj_pool_test.cpp
浏览文件 @
2c3e4383
...
...
@@ -26,7 +26,7 @@ TEST(SingleThreadObjPool, naive) {
ASSERT_EQ
(
ptr
,
pool
->
make_shared
().
get
());
}
struct
Int
{
struct
Int
{
// NOLINT
Int
()
:
x
(
0
)
{}
Int
(
int
val
)
:
x
(
val
)
{}
~
Int
()
{
x
=
0
;
}
...
...
oneflow/core/job_rewriter/fuse_update_ops_pass.cpp
浏览文件 @
2c3e4383
...
...
@@ -173,6 +173,12 @@ Maybe<void> FuseUpdateOpsPass::Apply(const OpGraph& op_graph, JobBuilder* job_bu
.
Attr
<
float
>
(
"beta1"
,
user_op_conf
.
attr
<
float
>
(
"beta1"
))
.
Attr
<
float
>
(
"beta2"
,
user_op_conf
.
attr
<
float
>
(
"beta2"
))
.
Attr
<
float
>
(
"epsilon"
,
user_op_conf
.
attr
<
float
>
(
"epsilon"
));
if
(
user_op_conf
.
has_input
(
"bias_correction1"
,
0
))
{
fused_op_builder
.
Input
(
"bias_correction1"
,
user_op_conf
.
input
(
"bias_correction1"
,
0
));
}
if
(
user_op_conf
.
has_input
(
"bias_correction2"
,
0
))
{
fused_op_builder
.
Input
(
"bias_correction2"
,
user_op_conf
.
input
(
"bias_correction2"
,
0
));
}
}
else
if
(
user_op_conf
.
op_type_name
()
==
"rmsprop_update"
)
{
const
bool
centered
=
user_op_conf
.
attr
<
bool
>
(
"centered"
);
fused_op_builder
.
Input
(
"mean_square"
,
user_op_conf
.
input
(
"mean_square"
,
0.
f
))
...
...