Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Optimize Add, Multiply and Average layers #293

Merged
merged 2 commits into from
Aug 21, 2018
Merged

Optimize Add, Multiply and Average layers #293

merged 2 commits into from
Aug 21, 2018

Conversation

dsmilkov
Copy link
Contributor

@dsmilkov dsmilkov commented Aug 20, 2018

Profiling a real model revealed that Add, Multiply and Average layers were allocating a zero/ones tensor for the initial value, on the cpu. This causes unnecessary uploads to the gpu and one extra shader call.

This PR removes that initial value and treats the first tensor in the list as the initial value.

PERF


This change is Reviewable

@dsmilkov dsmilkov requested a review from caisq August 20, 2018 14:49
Copy link
Contributor

@caisq caisq left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq)

Copy link
Contributor

@caisq caisq left a comment

Choose a reason for hiding this comment

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

Thanks, @dsmilkov

@caisq caisq merged commit 5c2e033 into master Aug 21, 2018
@dsmilkov dsmilkov deleted the speedup branch August 21, 2018 15:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants