Skip to content

Conversation

@ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jun 7, 2024

What is broken / not supported by Numba:

The plan now

  • Numba becomes a default dependency
  • Like the default "Mode", "FAST_RUN" is now also an abstract mode that can use either C or Numba, depending on config.linker
    • For now "config.linker" will remain C (specifically CVM) but we'll switch to Numba soon.
    • Why Numba over C?
      • Faster
      • Easier to maintain/ extend
      • Easier to install (pip install should be safe
    • This way downstream libraries can test if anything would break with the switch, and user can switch back if it breaks stuff for them
    • CI will run with both configs. To avoid runtime explosion it may be time to restrict floatX and fast_compile tests to a few files instead of being an orthogonal parametrization like it is now

Immediate action

  • I'll be cherry picking the countless fixes into their own PRs. I need help with review as both me and @jessegrabowski are pretty much at capacity Done
  • This PR will end up with just the test tweaks and new config flags
  • We need to implement more Ops in numba mode. We'll follow up with a PR that fails on fallback to obj mode. Help needed!

@ricardoV94 ricardoV94 force-pushed the test_on_numba branch 2 times, most recently from 2eb7fe7 to 1f093cd Compare June 7, 2024 17:24
@ricardoV94
Copy link
Member Author

Locally I ran all the tests in tests/tensor/rewriting/test_basic.py twice (to allow caching) before and after making Numba default.
Before: 6s
After: 1m34s

Numba caching is baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaad

@ricardoV94

This comment was marked as outdated.

@ricardoV94 ricardoV94 changed the title Test on numba Run whole test suite on numba backend Jun 7, 2024
@aseyboldt

This comment was marked as outdated.

@ricardoV94

This comment was marked as outdated.

@ricardoV94

This comment was marked as outdated.

@ricardoV94

This comment was marked as outdated.

@ricardoV94 ricardoV94 force-pushed the test_on_numba branch 4 times, most recently from 6f6e8bb to 53d9a26 Compare June 13, 2024 14:43
@ricardoV94 ricardoV94 added this to the 3.0 release milestone Feb 14, 2025
@ricardoV94
Copy link
Member Author

After caching the test file now runs in 50s after caching vs 6s before the PR, so only 8x slower now :(

@ricardoV94
Copy link
Member Author

ricardoV94 commented Dec 15, 2025

@maresb / @lucianopaz I requested your review basically for the last 2 commits, where we make numba default dependency and run it on the CI

The prior commits is just tweaking tests so they pass with both backends. I've gone over them with @jessegrabowski and asked him to review those. Feel free to look if you want but nothing terribly interesting or critical there

@ricardoV94
Copy link
Member Author

ricardoV94 commented Dec 15, 2025

@maresb I force-pushed above your commit, sorry didn't see you had come to the rescue already.

My changes above yours:
image

should we go with cp*t-*? Mine is too myopic on the python version, and yours is harder to read?
I'll reintroduce your comment.
The test-skip changes I did is because it seemed outdated or redundant from the skip entries. WDYT?

Copy link
Member

@lucianopaz lucianopaz left a comment

Choose a reason for hiding this comment

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

I've looked at the last two commits and they seem OK to me. My only question is why you decided to use python 3.12 or 3.13 on some extra included tests? I also can't see where you test float32.

@ricardoV94
Copy link
Member Author

My only question is why you decided to use python 3.12 or 3.13 on some extra included tests?

That was already the case, I guess it was done to have minimal sanity check the library can run in the intermediate versions, since it was already special cased anyway.

Re: float32

The parametrization is gone to keep CI from having too many jobs. Float32 tests are also an endless source of wasted runtime, as ppl forget to set different tolerance for comparison with numpy which always runs in float64. We can reassess this but I would like to try out and see how often does it bite us back.

@ricardoV94
Copy link
Member Author

ricardoV94 commented Dec 15, 2025

Also all tests passed in numba in float32 (and even FAST_COMPILE - I hacked the linker temporarily), so the checking was much more comprehensive. After passing, I then removed that commit and restricted the CI to its current shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Give test matrix readable names

4 participants