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

🪛🔗 Change interactions' shape #736

Merged
merged 53 commits into from
Jan 21, 2022
Merged

Conversation

mberr
Copy link
Member

@mberr mberr commented Jan 20, 2022

This PR is a draft to change the format from the "more canonical" shape (batch_size, num_heads, num_relations, num_tails, *dims) to an arbitrary number of batch dimensions (*batch_dims, *dims), This should avoid some of the unnecessary dimension expansion and reductions, which may be the cause of the performance issue observed in #735 .

In particular it allows score_hrt from shape (batch_size, dim) instead of the expansion to (batch_size, 1, 1, 1, dim).

@mberr mberr requested a review from cthoyt January 21, 2022 09:59
@mberr
Copy link
Member Author

mberr commented Jan 21, 2022

Should this PR should also retire the following:

* [x]  `pykeen.nn.emb.RepresentationModule.get_in_more_canonical_shape` (now unused - done in [aa557ec](https://github.com/pykeen/pykeen/commit/aa557ece88b43a08b0e006c465ba356b8755d854))

* [ ]  `pykeen.nn.emb.RepresentationModule.get_in_canonical_shape` (still used in a few places)

part 2 depends on moving the users of this method to new-style, which may require a re-check of performance implications.

Opened a new issue in #739

src/pykeen/nn/functional.py Outdated Show resolved Hide resolved
src/pykeen/nn/functional.py Outdated Show resolved Hide resolved
src/pykeen/nn/functional.py Outdated Show resolved Hide resolved
@mberr
Copy link
Member Author

mberr commented Jan 21, 2022

I verified that the BoxE repro config on WN18RR still succeeds.

@mberr
Copy link
Member Author

mberr commented Jan 21, 2022

@PyKEEN-bot test

Copy link
Member

@cthoyt cthoyt left a comment

Choose a reason for hiding this comment

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

either look into changing the score_hrt()/self() dichotomy, or just :shipit:

@mberr mberr enabled auto-merge (squash) January 21, 2022 18:42
@mberr mberr merged commit ad3183c into master Jan 21, 2022
@mberr mberr deleted the fix-performance-regression branch January 21, 2022 18:51
@mberr mberr mentioned this pull request Feb 4, 2022
10 tasks
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

Successfully merging this pull request may close these issues.

None yet

3 participants