Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Add ConstantToBroadcast pass #2754

Merged
merged 7 commits into from
Apr 23, 2019
Merged

Add ConstantToBroadcast pass #2754

merged 7 commits into from
Apr 23, 2019

Conversation

rkimballn1
Copy link
Contributor

@rkimballn1 rkimballn1 commented Apr 13, 2019

This rewrites a Constant of some shape where all of the values are the same bit-exact value into a Constant scalar and a Broadcast to some shape.
I also added an option to reserialize that will run the ConstantToBroadcast pass on the graph it is reserializing. This converted the PP R50 graph from 182MB to 1MB in size.

Converts this:
pre_constant_to_broadcast

To this:
post_constant_to_broadcast

Copy link
Contributor

@diyessi diyessi left a comment

Choose a reason for hiding this comment

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

Minor safety change.

src/ngraph/pass/constant_to_broadcast.cpp Outdated Show resolved Hide resolved
@rkimballn1 rkimballn1 requested a review from diyessi April 20, 2019 13:23
@diyessi diyessi added the Fully Reviewed PR is approved by all reviewers. label Apr 23, 2019
@silee2 silee2 merged commit 490d669 into master Apr 23, 2019
@silee2 silee2 deleted the bob/const_broadcast2 branch April 23, 2019 21:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fully Reviewed PR is approved by all reviewers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants