Skip to content

Download IDAKLU from pybammsolvers#4487

Merged
kratman merged 57 commits into
pybamm-team:developfrom
kratman:feat/removeIDAKLU
Jan 7, 2025
Merged

Download IDAKLU from pybammsolvers#4487
kratman merged 57 commits into
pybamm-team:developfrom
kratman:feat/removeIDAKLU

Conversation

@kratman

@kratman kratman commented Oct 3, 2024

Copy link
Copy Markdown
Contributor

Description

This will separate the IDAKLU C++ code from pybamm.

Fixes #3564
Fixes #4611

This ticket is something that can be handled in the other repo
Closes #3603

Type of change

This should speed up CI by skipping the build of the C++ code.

  • Optimization (back-end change that speeds up the code)

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@kratman kratman self-assigned this Oct 3, 2024
@kratman

kratman commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

A new link error cropped up, but it looks like we could get a lot of savings on time with this update.

Edit: Most of the run time appears to be in the integration tests, so unfortunately the time savings are not as good as I would have hoped.

@agriyakhetarpal

Copy link
Copy Markdown
Member

The linkage error is the same one as #3783, coming from CasADi's plugin system. I am not sure if it's worth fixing it, since it was fixed by @martinjrobins for the linear interpolant case by dropping down to Python but IIRC there wasn't a way in CasADi for doing it for the cubic

@kratman

kratman commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

@agriyakhetarpal Yeah I was looking at that issue as well. As far as I can tell CasADI sets a path for plugins. I am trying to see if there is a decent workaround since this was part of #4464

My guess is that the wheels for the next release will be broken as well, but I have not confirmed it yet

@agriyakhetarpal

agriyakhetarpal commented Oct 3, 2024

Copy link
Copy Markdown
Member

There is a workaround for Linux and macOS, but not for Windows (different toolchain); sadly, it's not decent enough to include. I think I'll raise a PR upstream in CasADi to get one part of the linkage going and see if we can migrate to a non-MSVC toolchain (which can potentially help provide that workaround for this on Windows later on). It's been on my list of things to do for a while, but I've yet to do it.

@kratman

kratman commented Oct 3, 2024

Copy link
Copy Markdown
Contributor Author

This is fixed locally with this: export CASADIPATH=.venv/lib/python3.12/site-packages/casadi

@codecov

codecov Bot commented Oct 3, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.66%. Comparing base (a7253b8) to head (c9a75e2).
Report is 135 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4487      +/-   ##
===========================================
- Coverage    99.22%   98.66%   -0.56%     
===========================================
  Files          303      303              
  Lines        23070    23224     +154     
===========================================
+ Hits         22891    22914      +23     
- Misses         179      310     +131     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@agriyakhetarpal

Copy link
Copy Markdown
Member

This is fixed locally with this: export CASADIPATH=.venv/lib/python3.12/site-packages/casadi

Yes, won't work with Windows

@Saransh-cpp Saransh-cpp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is fantastic. Took a quick view and it looks good overall!

Comment thread docs/source/user_guide/installation/gnu-linux-mac.rst
Comment thread docs/source/user_guide/installation/index.rst
@kratman
kratman requested review from Saransh-cpp and prady0t January 2, 2025 17:31
Comment thread .github/workflows/benchmark_on_push.yml Outdated
Comment thread .github/workflows/periodic_benchmarks.yml Outdated
Comment thread .github/workflows/publish_pypi.yml Outdated
Comment thread .github/workflows/publish_pypi.yml Outdated
Comment thread CHANGELOG.md
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread scripts/Dockerfile Outdated
Comment thread src/pybamm/solvers/idaklu_solver.py Outdated
Comment thread src/pybamm/solvers/idaklu_jax.py Outdated
kratman and others added 6 commits January 3, 2025 09:31
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
@kratman kratman mentioned this pull request Jan 6, 2025
6 tasks
@kratman
kratman requested a review from a team as a code owner January 7, 2025 16:55
@kratman

kratman commented Jan 7, 2025

Copy link
Copy Markdown
Contributor Author

@agriyakhetarpal I know we have not solved the ARM64 or conda-forge issues yet, but how do you feel about getting this merged ASAP to see if we start getting issues reported?

@agriyakhetarpal agriyakhetarpal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, let's do that, @kratman. Linux arm64 is quite common but lacks readily available CI providers for OSS; Windows arm64 CI is not present either outside of Windows Arm dev boxes. FWIW, we can mark both platforms/architectures as unsupported for now and ask users to compile it themselves (the same as we did when macOS arm64 was not common).

Based on https://stackoverflow.com/a/64921347, we will have to wait a bit for PyBaMM 25.1 to be supported on conda-forge until conda-forge/staged-recipes#28748 is resolved, but at the time if someone needs a new version of PyBaMM in a conda environment, they should be able to pip-install without any issues as long as their environment files specify that.

@kratman

kratman commented Jan 7, 2025

Copy link
Copy Markdown
Contributor Author

Note: The changes from #4736 are not in pybammsolvers yet. The tests pass without the C++ side for now though. I am working on the pybammsolvers v0.0.5 release, but I have to do a bit of testing before it is ready. Hopefully I will finish that off today

@kratman
kratman merged commit 2de780d into pybamm-team:develop Jan 7, 2025
@kratman
kratman deleted the feat/removeIDAKLU branch January 7, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release blocker Issues that need to be addressed before the creation of a release

Projects

None yet

6 participants