Skip to content

Conversation

@NimaSarajpoor
Copy link
Collaborator

@NimaSarajpoor NimaSarajpoor commented Mar 1, 2025

This PR is to add test for the modules in /sdp/

@NimaSarajpoor NimaSarajpoor requested a review from seanlaw March 1, 2025 18:45
Copy link
Collaborator Author

@NimaSarajpoor NimaSarajpoor left a comment

Choose a reason for hiding this comment

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

@seanlaw
Once you find some time, can you please review my comments and add yours?

@NimaSarajpoor
Copy link
Collaborator Author

[Update]
Moved some functions to utils.py, and the unit testing now covers all modules that have setup & sliding_dot_product.

@seanlaw
Copy link
Contributor

seanlaw commented Mar 3, 2025

For testing, it would be good to also test non-power-of-2 lengths. So, say, p-1 and p+1 or large-ish prime numbers

I feel uneasy only testing perfect powers of two

@NimaSarajpoor
Copy link
Collaborator Author

@seanlaw

I feel uneasy only testing perfect powers of two

Right! I will revise the unit testing.

@NimaSarajpoor
Copy link
Collaborator Author

NimaSarajpoor commented Mar 5, 2025

@seanlaw

For testing, it would be good to also test non-power-of-2 lengths. So, say, p-1 and p+1 or large-ish prime numbers.
I feel uneasy only testing perfect powers of two

Added test and got assertion error locally for one of the sdp's modules. Will add GitHub Actions to expose the error here first, and then work on fixing it here (or in another PR)

@seanlaw
Copy link
Contributor

seanlaw commented Mar 6, 2025

Let's try to fix it here

@NimaSarajpoor
Copy link
Collaborator Author

@seanlaw
I've addressed most of the comments.

(1) Changed branches: '**' to branches: add_test for now so that I can still see GitHub Actions in my fork. Just before merge, will change it to branches: main
(2) Couldn't figure out how to add name: to the part where we set default bash to shell: bash -el {0}. Added some comments only.

Copy link
Collaborator Author

@NimaSarajpoor NimaSarajpoor left a comment

Choose a reason for hiding this comment

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

@seanlaw
I also added a few comments for myself. Can you please look at them and let me know what you think?

Copy link
Contributor

@seanlaw seanlaw left a comment

Choose a reason for hiding this comment

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

@NimaSarajpoor I left a few comments

Copy link
Contributor

@seanlaw seanlaw left a comment

Choose a reason for hiding this comment

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

@NimaSarajpoor I added some additional comments (more thorough)

@NimaSarajpoor
Copy link
Collaborator Author

NimaSarajpoor commented Mar 19, 2025

@seanlaw
I addressed the comments, and did some minor changes. If there is nothing left to be addressed, I think it is ready to be merged.


Btw, regarding long running time of coverage that we faced before. I was supposed to check the performance of njit-vs-naive when njit is off. I did and noticed that njit is considerably slower. Going to attach the timing here just in case.
timing.csv

This is obtained by setting the env var NUMBA_DISABLE_JIT to 1, and then revising timing.sh as follows:

rm -rf sdp/__pycache__
./timing.py -niter 10 -pmin 2 -pmax 12 pyfftw_sdp njit_sdp challenger_sdp  > timing.csv
rm -rf sdp/__pycache__

@seanlaw
Copy link
Contributor

seanlaw commented Mar 20, 2025

Btw, regarding long running time of coverage that we faced before. I was supposed to check the performance of njit-vs-naive when njit is off. I did and noticed that njit is considerably slower. Going to attach the timing here just in case.
timing.csv

What does this mean for coverage testing though? How long are the unit tests and coverage tests taking now?

@seanlaw seanlaw merged commit 6f148da into stumpy-dev:main Mar 20, 2025
@seanlaw
Copy link
Contributor

seanlaw commented Mar 20, 2025

Thanks for working on this @NimaSarajpoor!

@NimaSarajpoor
Copy link
Collaborator Author

@seanlaw

What does this mean for coverage testing though?

we are good now as the current tests are only for a small number of queries, with short length. I just did not want to leave that question unanswered.

How long are the unit tests and coverage tests taking now?

The unit test and coverage step takes less than 1min in each platform.

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.

2 participants