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

WIP: Test non-canonical sparse arrays #14

Merged
merged 9 commits into from
Jul 12, 2023
Merged

Conversation

uellue
Copy link
Member

@uellue uellue commented Jun 27, 2023

scipy.sparse generally supports them, while sparse.pydata.org struggles.

  • Make sure there are no false positives and update converter matrix to support them correctly.
  • Report upstream if applicable
  • Changelog
  • Minor release

Closes #13

scipy.sparse generally supports them, while sparse.pydata.org struggles.

TOD: Make sure there are no false positives and updtae converter matrix to
support them correctly.

Also, perhaps report upstream to be documented properly?
uellue added 3 commits July 4, 2023 15:06
TODO get COO to work correctly -- it broke from deduplication
* Detection and workaround for cupy/cupy#7713
* Correct coo_matrix scrambling: canonical format attribute is cached
  and sparse.COO depends on it. Create new scrambled coo_matrix instead
  of modifying in place so that the attributes are correct.
* Update conversion cost
@uellue
Copy link
Member Author

uellue commented Jul 11, 2023

I can't reproduce the issues on Linux with scipy.sparse.csc_matrix locally, even with the same versions of Python, NumPy, SciPy. Weird! I'm out of depth what to do here.

@uellue uellue marked this pull request as ready for review July 11, 2023 18:37
@uellue
Copy link
Member Author

uellue commented Jul 11, 2023

The error seems to be caused by the duplicate since the last two entries in the array differ. Strange that it doesn't occur locally. Race condition? Compiler/CPU architecture/Undefined Behavior? Hard to report without a local reproducer!

@uellue
Copy link
Member Author

uellue commented Jul 11, 2023

Actually got a "hit" on Windows. Different probability points at a race condition?

uellue added 4 commits July 11, 2023 21:15
* Also prune when deduplicating
* Deduplicate CSC before densifying
Handle empty cols/rows at the end of the array correctly. Edge cases to
be tested, but unlikely to occur.
@uellue
Copy link
Member Author

uellue commented Jul 11, 2023

Actually got a "hit" on Windows. Different probability points at a race condition?

Likely cause was an incorrect routine to add duplicates. It added the value to the wrong column/row if the last one was empty.

@uellue uellue merged commit dfe02ed into LiberTEM:main Jul 12, 2023
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.

sparse.GCXS silently requires canonical form
1 participant