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

Inefficient chaining of get(index) and cat #3

Open
hglaude opened this issue Mar 2, 2018 · 0 comments
Open

Inefficient chaining of get(index) and cat #3

hglaude opened this issue Mar 2, 2018 · 0 comments

Comments

@hglaude
Copy link

hglaude commented Mar 2, 2018

In,

 def _batch_args(self, arg_lists, values):

although, the following code reduces unnecessary chunking and cat for computations that involve sequential operations of the same kind,

            if isinstance(arg[0], Fold.Node):
                if arg[0].batch:
                    batched_arg = values[arg[0].step][arg[0].op].try_get_batched(arg)
                    if batched_arg is not None:
                        res.append(batched_arg)
                        continue

for other cases I have the feeling that there is still room for improvements.

                    for x in arg:
                        r.append(x.get(values))
                    res.append(torch.cat(r, 0))

Do you see any obstacle to convert the sequence of get()s and cat into a unique index_select?
Would it improve the performances (by batching the get()s)? Especially for the backward pass?

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

No branches or pull requests

1 participant