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

283 provide the implementation of the masked outer product #301

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from

Conversation

aleksamilisavljevic
Copy link
Contributor

@aleksamilisavljevic aleksamilisavljevic commented Feb 9, 2024

Closes #283

Depends on #317

Copy link
Collaborator

@byjtew byjtew left a comment

Choose a reason for hiding this comment

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

Nice implementation, the openMP implementation is pretty quick and easy.
Good job 👍

Also, it would be nice to have a (maybe separate) unit test with a user-provided size of the matrix instead of a single predefined one.

include/graphblas/reference/blas3.hpp Outdated Show resolved Hide resolved
include/graphblas/reference/blas3.hpp Outdated Show resolved Hide resolved
include/graphblas/reference/blas3.hpp Outdated Show resolved Hide resolved
include/graphblas/reference/blas3.hpp Outdated Show resolved Hide resolved
include/graphblas/reference/blas3.hpp Show resolved Hide resolved
tests/unit/CMakeLists.txt Outdated Show resolved Hide resolved
tests/unit/maskedOuter.cpp Outdated Show resolved Hide resolved
include/graphblas/reference/blas3.hpp Show resolved Hide resolved
@byjtew
Copy link
Collaborator

byjtew commented Feb 16, 2024

By the way, why do you call the function maskedOuter and not simply outer, since the arguments are different it wouldn't collide with the non-masked implementation

@byjtew
Copy link
Collaborator

byjtew commented Feb 16, 2024

I also realised that you were only checking against the structure of the mask (coordinates), but never its values (which is tricky when allowing void & non-void)

tests/unit/maskedOuter.cpp Outdated Show resolved Hide resolved
tests/unit/maskedOuter.cpp Outdated Show resolved Hide resolved
@aleksamilisavljevic
Copy link
Contributor Author

aleksamilisavljevic commented Feb 16, 2024

I also realised that you were only checking against the structure of the mask (coordinates), but never its values (which is tricky when allowing void & non-void)

Yes, I was actually implementing the structural mask. @byjtew, if the structural descriptor isn't set, is it intended that values evaluate to true iff mask_raw.getValue(...) returns something that evaluates to true?

@byjtew
Copy link
Collaborator

byjtew commented Feb 16, 2024

I also realised that you were only checking against the structure of the mask (coordinates), but never its values (which is tricky when allowing void & non-void)

Yes, I was actually implementing the structural mask. @byjtew, if the structural descriptor isn't set, is it intended that values evaluate to true iff mask_raw.getValue(...) returns something that evaluates to true?

Not that simple, you should use utils::interpretMask<descr, T> instead, it will interpret the mask value to true or false and handle the void case for you.

@aleksamilisavljevic
Copy link
Contributor Author

I also realised that you were only checking against the structure of the mask (coordinates), but never its values (which is tricky when allowing void & non-void)

Yes, I was actually implementing the structural mask. @byjtew, if the structural descriptor isn't set, is it intended that values evaluate to true iff mask_raw.getValue(...) returns something that evaluates to true?

Not that simple, you should use utils::interpretMask<descr, T> instead, it will interpret the mask value to true or false and handle the void case for you.

The descriptors should now be properly handled.

@aleksamilisavljevic aleksamilisavljevic marked this pull request as draft February 20, 2024 14:56
@byjtew
Copy link
Collaborator

byjtew commented Feb 20, 2024

Feel free to mark the MR as "ready" if the tests pass.

@aleksamilisavljevic
Copy link
Contributor Author

Feel free to mark the MR as "ready" if the tests pass.

Ok, but now I'm wondering if the structural_complement descriptor should be supported at all. I guess that the similar case could be made for forbidding it as in #242

@aleksamilisavljevic aleksamilisavljevic marked this pull request as ready for review February 21, 2024 12:23
@byjtew
Copy link
Collaborator

byjtew commented Feb 22, 2024

Running the test in the internal GitLab
@aleksamilisavljevic


FAILING TESTS for all backends

  • tests/unit/maskedOuter_ndebug_<backend>
  • tests/unit/maskedOuter_debug_<backend>

@anyzelman
Copy link
Member

Feel free to mark the MR as "ready" if the tests pass.

Ok, but now I'm wondering if the structural_complement descriptor should be supported at all. I guess that the similar case could be made for forbidding it as in #242

I would agree-- structurally inverting any sparse matrix seems never a good idea

@aleksamilisavljevic
Copy link
Contributor Author

Running the test in the internal GitLab @aleksamilisavljevic

FAILING TESTS for all backends

* `tests/unit/maskedOuter_ndebug_<backend>`

* `tests/unit/maskedOuter_debug_<backend>`

There was a bug in the way the test status was reported. It should be fine now, but I don't have access to the internal GitLab to check it.

Thanks to @aristeidis-mastoras for helping with the debug.

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.

Provide the implementation of the maskedOuter(Matrix result, Matrix mask, Vector u, Vector v)
3 participants