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

functional_one_hot #5315

Merged
merged 75 commits into from
Aug 16, 2021
Merged

functional_one_hot #5315

merged 75 commits into from
Aug 16, 2021

Conversation

Zailiang
Copy link
Contributor

@Zailiang Zailiang commented Jun 25, 2021

add one_hot:
one_hot

@Zailiang Zailiang requested a review from hjchen2 June 29, 2021 05:56
@Zailiang Zailiang self-assigned this Jun 29, 2021
@tangnana925 tangnana925 requested a review from hengzi August 9, 2021 05:40
@MARD1NO MARD1NO added the op label Aug 13, 2021
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 13, 2021 10:59
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 13, 2021 12:06
@MARD1NO MARD1NO requested a review from oneflow-ci-bot August 16, 2021 03:08
@MARD1NO MARD1NO requested review from oneflow-ci-bot and removed request for oneflow-ci-bot August 16, 2021 03:14
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 03:50
@MARD1NO MARD1NO requested a review from oneflow-ci-bot August 16, 2021 03:53
@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 04:03
@oneflow-ci-bot oneflow-ci-bot self-requested a review August 16, 2021 04:04
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 145.9ms (= 7293.6ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 128.3ms (= 6413.1ms / 50, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.14 (= 145.9ms / 128.3ms)

PyTorch resnet50 time: 83.9ms (= 4197.1ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 74.4ms (= 3722.2ms / 50, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 83.9ms / 74.4ms)

PyTorch resnet50 time: 57.4ms (= 2871.0ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 48.0ms (= 2400.5ms / 50, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.20 (= 57.4ms / 48.0ms)

PyTorch resnet50 time: 49.0ms (= 2451.6ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 39.2ms (= 1959.4ms / 50, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.25 (= 49.0ms / 39.2ms)

PyTorch resnet50 time: 42.5ms (= 2126.0ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 36.6ms (= 1831.1ms / 50, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 1.16 (= 42.5ms / 36.6ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review August 16, 2021 05:41
@oneflow-ci-bot oneflow-ci-bot merged commit 5e309eb into master Aug 16, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the Zailiang/functional_one_hot branch August 16, 2021 05:43
bool is_on_value_double = on_value.IsFloatingPoint();
bool is_off_value_double = off_value.IsFloatingPoint();
if (is_on_value_double || is_off_value_double) {
JUST(attrs.SetAttr<DataType>("dtype", kDouble));
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为什么要默认设置成 double?

这里建议改为float,之前lazy日常使用比较多的就是float。

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.

8 participants