Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Unpack eagerly within packed ops that reshape their outputs #1345

Merged
merged 3 commits into from
Oct 25, 2018

Conversation

annxingyuan
Copy link
Collaborator

@annxingyuan annxingyuan commented Oct 25, 2018

This PR is a quick fix to tensorflow/tfjs#834

Changes

  • Eagerly unpack outputs of matMul and im2Row so the final reshape occurs on the unpacked tensor
  • Add a test that catches the issue

BUG


For repository owners only:

Please remember to apply all applicable tags to your pull request.
Tags: FEATURE, BREAKING, BUG, PERF, DEV, DOC, SECURITY

For more info see: /~https://github.com/tensorflow/tfjs/blob/master/DEVELOPMENT.md


This change is Reviewable

Copy link
Collaborator

@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!

Reviewable status: 0 of 1 approvals obtained (waiting on @annxingyuan, @nsthorat, @caisq, and @dsmilkov)


src/kernels/backend_webgl.ts, line 1645 at r1 (raw file):

new UnpackProgram(input.shape);

Just curious: what are the performance implications (if any) of this change?

Copy link
Contributor

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @annxingyuan, @nsthorat, and @dsmilkov)

@annxingyuan annxingyuan merged commit 5a13091 into master Oct 25, 2018
@annxingyuan annxingyuan deleted the eager_unpack branch October 25, 2018 16:12
@annxingyuan
Copy link
Collaborator Author

@caisq We need to figure out a way to unpack lazily so adjacent packed ops don't have to unpack / pack their outputs / inputs unnecessarily. But there are no performance implications for now because only matMul is packed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants