Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when error msg formatting fails, return error->DebugString #5844

Merged
merged 9 commits into from
Aug 12, 2021

Conversation

liufengwei0103
Copy link
Contributor

@liufengwei0103 liufengwei0103 commented Aug 11, 2021

when error formatting fails, return error->DebugString

error_msg format 失败后(图片来自error format相关函数抛异常后):
截屏2021-08-11 下午10 21 37
error_msg format 成功:
截屏2021-08-11 下午10 14 05

@liufengwei0103 liufengwei0103 changed the title when error formatting fails, return error->DebugString when error msg formatting fails, return error->DebugString Aug 11, 2021
Comment on lines +283 to +284
const auto& maybe_error = TRY(FormatErrorStr(error));
const auto& error_str = maybe_error.GetDataAndErrorProto(error->DebugString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个处理虽然看着拧巴,但其实很细腻。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以后的代码质量应该向这里看齐。

@liufengwei0103 liufengwei0103 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 12, 2021 01:12
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 12, 2021 05:33
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 12, 2021 05:33
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 12, 2021 08:31
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 12, 2021 10:24
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 12, 2021 12:12
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 141.9ms (= 7094.7ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.3ms (= 6414.1ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 141.9ms / 128.3ms)

PyTorch resnet50 time: 85.7ms (= 4287.5ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.6ms (= 3728.9ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.15 (= 85.7ms / 74.6ms)

PyTorch resnet50 time: 59.6ms (= 2980.8ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 48.5ms (= 2422.5ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.23 (= 59.6ms / 48.5ms)

PyTorch resnet50 time: 49.8ms (= 2487.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 38.7ms (= 1935.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.29 (= 49.8ms / 38.7ms)

PyTorch resnet50 time: 41.6ms (= 2079.1ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 37.3ms (= 1864.9ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 41.6ms / 37.3ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 12, 2021 13:43
@oneflow-ci-bot oneflow-ci-bot merged commit 42149cd into master Aug 12, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the fix_error_str_format branch August 12, 2021 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants