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

Need to canonicalize or optimize high-dim concat to concat+transpose #1296

Open
nadavrot opened this issue Jul 19, 2018 · 2 comments
Open

Need to canonicalize or optimize high-dim concat to concat+transpose #1296

nadavrot opened this issue Jul 19, 2018 · 2 comments

Comments

@nadavrot
Copy link
Contributor

The picture below depicts a concat node that joins nodes on dimension number 1. The IR that we generate for this code is inefficient for two reasons. First, we can't optimize the operator that writes the result because the result is scattered across the 2st dimension (dim zero is the first). And second, we emit a sequence of insert_tensor instructions that process the tensor several times invalidating cache. A much better way would be to represent this as dim-0 concat followed by a transpose.

Design question: I am not sure if this should be the canonical representation, the only representation or simply a target specific optimization.

screen shot 2018-07-19 at 1 05 24 pm

@sparkingdark
Copy link

hey @nadavrot can you elaborate

@glowbucky
Copy link

Hey @nadavrot I would love to work on this issue. Can you please tell me where should I start, should this be designed as an graph optimization pass?

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

No branches or pull requests

4 participants