Skip to content

Conversation

@s3alfisc
Copy link
Member

  • Implement a Rust Backend for PyFixest.
  • Reorganize demeaner_backend code logic.

@schroedk
Copy link
Contributor

@s3alfisc it was nice to meet you at the PyCon some weeks ago (we met at the appliedAI booth together with @janosg). I have some time to work on this topic and I would have some questions, before starting. First of all, do you want the user to choose the backend? Or is it a question of benchmarking, i.e. if rust implementation is faster everywhere, then get rid of the numba dependency completely?

@s3alfisc
Copy link
Member Author

s3alfisc commented May 14, 2025

Hi @schroedk, that's super awesome and I'm really excited! The idea was to initially support rust as one of three backends - we currently support numba (which is the default) and JAX for runs on the GPU. There I would like to add rust as an option. Eventually (maybe even directly after merging this pr), I would like to make Rust the default backend, still support JAX, and deprecate numba after a while. And in the meantime, we can use the rust + numba backends for easy benchmarking of one implementation against the other.

schroedk added 23 commits May 15, 2025 16:04
@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

Attention: Patch coverage is 49.19355% with 63 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyfixest/estimation/numba/nested_fixef_nb.py 16.21% 31 Missing ⚠️
...st/estimation/numba/find_collinear_variables_nb.py 11.76% 30 Missing ⚠️
pyfixest/estimation/feols_.py 86.66% 2 Missing ⚠️
Flag Coverage Δ
core-tests 78.61% <49.19%> (+0.14%) ⬆️
tests-extended ?
tests-vs-r 15.91% <36.29%> (+0.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyfixest/core/__init__.py 100.00% <100.00%> (ø)
pyfixest/core/collinear.py 100.00% <100.00%> (ø)
pyfixest/core/crv1.py 100.00% <100.00%> (ø)
pyfixest/core/demean.py 100.00% <100.00%> (ø)
pyfixest/core/nested_fixed_effects.py 100.00% <100.00%> (ø)
pyfixest/estimation/FixestMulti_.py 79.89% <100.00%> (+0.10%) ⬆️
pyfixest/estimation/backends.py 100.00% <100.00%> (ø)
pyfixest/estimation/demean_.py 52.54% <100.00%> (+1.23%) ⬆️
pyfixest/estimation/estimation.py 94.35% <ø> (ø)
pyfixest/estimation/feiv_.py 87.50% <100.00%> (+0.11%) ⬆️
... and 7 more

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@s3alfisc
Copy link
Member Author

s3alfisc commented Jun 1, 2025

@schroedk just as a status update - I am currently reviewing the rust implementations; only have to go through the "count_fixef_fully_nested". Hopeful I'll be able to merge this in a few days =)

@s3alfisc
Copy link
Member Author

s3alfisc commented Jun 2, 2025

Ok, finished my review + added some docstrings. Only thing to add (I think) is update the readme to "blazing fast" and "written in Rust" 😄

@s3alfisc s3alfisc merged commit 6c722ea into master Jun 3, 2025
8 of 9 checks passed
@s3alfisc
Copy link
Member Author

s3alfisc commented Jun 3, 2025

@all-contributors please add @schroedk for code

@allcontributors
Copy link
Contributor

@s3alfisc

I've put up a pull request to add @schroedk! 🎉

damandhaliwal pushed a commit to damandhaliwal/pyfixest that referenced this pull request Jun 17, 2025
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.

3 participants