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

Update RecursiveArrayTools.jl compatibility to version 3 #2194

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

huiyuxie
Copy link
Member

@huiyuxie huiyuxie commented Dec 8, 2024

Supplementary fix for #2150 and JoshuaLampert/DispersiveShallowWater.jl#163 (merged).

Copy link
Contributor

github-actions bot commented Dec 8, 2024

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

  • The PR has a single goal that is clear from the PR title and/or description.
  • All code changes represent a single set of modifications that logically belong together.
  • No more than 500 lines of code are changed or there is no obvious way to split the PR into multiple PRs.

Code quality

  • The code can be understood easily.
  • Newly introduced names for variables etc. are self-descriptive and consistent with existing naming conventions.
  • There are no redundancies that can be removed by simple modularization/refactoring.
  • There are no leftover debug statements or commented code sections.
  • The code adheres to our conventions and style guide, and to the Julia guidelines.

Documentation

  • New functions and types are documented with a docstring or top-level comment.
  • Relevant publications are referenced in docstrings (see example for formatting).
  • Inline comments are used to document longer or unusual code sections.
  • Comments describe intent ("why?") and not just functionality ("what?").
  • If the PR introduces a significant change or new feature, it is documented in NEWS.md with its PR number.

Testing

  • The PR passes all tests.
  • New or modified lines of code are covered by tests.
  • New or modified tests run in less then 10 seconds.

Performance

  • There are no type instabilities or memory allocations in performance-critical parts.
  • If the PR intent is to improve performance, before/after time measurements are posted in the PR.

Verification

  • The correctness of the code was verified using appropriate tests.
  • If new equations/methods are added, a convergence test has been run and the results
    are posted in the PR.

Created with ❤️ by the Trixi.jl community.

@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 8, 2024

I make the initialization algorithm for DiscreteCallback default to nothing - if that is not what you intend to change with the new struct, this PR definitely won't help.

@huiyuxie huiyuxie requested a review from ranocha December 8, 2024 09:34
@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 8, 2024

This will make the current package compatible with Julia >= 1.10 - the CI tests relates to Julia < 1.10 will definitely fail.

@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 8, 2024

The dependency management is really a mess here - for example, the configurations for test env, docs env, and main project env never align. This definitely makes the debug for env configuration hard

@huiyuxie huiyuxie requested a review from sloede December 8, 2024 10:49
@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 8, 2024

Review @ranocha @sloede

@sloede
Copy link
Member

sloede commented Dec 8, 2024

This will make the current package compatible with Julia >= 1.10

I don't think we are ready to do this just yet - or did we make a decision about this that I forgot about, @ranocha?

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.74%. Comparing base (1488a74) to head (0292601).

❗ There is a different number of reports uploaded between BASE (1488a74) and HEAD (0292601). Click for more details.

HEAD has 5 uploads less than BASE
Flag BASE (1488a74) HEAD (0292601)
unittests 26 21
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2194       +/-   ##
===========================================
- Coverage   96.40%   84.74%   -11.66%     
===========================================
  Files         485      485               
  Lines       38918    38874       -44     
===========================================
- Hits        37517    32941     -4576     
- Misses       1401     5933     +4532     
Flag Coverage Δ
unittests 84.74% <ø> (-11.66%) ⬇️

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

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

@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 9, 2024

Then the issue #1789 will be delayed - when do you plan to upgrade to Julia 1.10?

@sloede
Copy link
Member

sloede commented Dec 9, 2024

Then the issue #1789 will be delayed - when do you plan to upgrade to Julia 1.10?

Which version of RecursiveArrayTools.jl is really required? Just v3 (i.e., v3.0.0 would be sufficient) or a specific, later version? With, e.g., v3.2 we would still be able to keep Julia v1.9 compatibility.

@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 9, 2024

Good question 👍let me check

@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 9, 2024

Which version of RecursiveArrayTools.jl is really required?

I have no idea, I just know that >= 2.38.10 does not work and >= 3 works. Can you answer Michael's question @jlchan - I don't know which version you actually need

@ranocha
Copy link
Member

ranocha commented Dec 10, 2024

I would hesitate to require Julia 1.10 and newer. We have seen some performance impacts in HPC settings, e.g., JuliaLang/julia#55009, JuliaLang/julia#50985

@jlchan
Copy link
Contributor

jlchan commented Dec 10, 2024

Which version of RecursiveArrayTools.jl is really required?

I have no idea, I just know that >= 2.38.10 does not work and >= 3 works. Can you answer Michael's question @jlchan - I don't know which version you actually need

We'd need at least RecursiveArrayTools.jl 3.27.1, which is where @huiyuxie's PR fixing VectorOfArray was implemented.

@sloede
Copy link
Member

sloede commented Dec 10, 2024

Which version of RecursiveArrayTools.jl is really required?

I have no idea, I just know that >= 2.38.10 does not work and >= 3 works. Can you answer Michael's question @jlchan - I don't know which version you actually need

We'd need at least RecursiveArrayTools.jl 3.27.1, which is where @huiyuxie's PR fixing VectorOfArray was implemented.

Too bad. This is already at Julia v1.10 😞

@huiyuxie
Copy link
Member Author

I would hesitate to require Julia 1.10 and newer. We have seen some performance impacts in HPC settings, e.g., JuliaLang/julia#55009, JuliaLang/julia#50985

Does it mean you prefer to upgrade to version 1.10 until both of these issues are resolved?

@ranocha
Copy link
Member

ranocha commented Dec 11, 2024

That's something we need to discuss.

@JoshuaLampert
Copy link
Member

This is a bad situation. IMHO, we cannot wait until these two issues are resolved before we fix the incompatibility with newer versions of the whole SciML stack. Fixing this feels more and more urgent and it also looks like the two julia issues will not be fixed anytime soon.
Is there any chance to keep the compat bound as v1.8 for julia, but also allow old and new versions of RecursiveArrayTools.jl (something like `RecursiveArrayTools = "2.38.10, 3")? Then one would need to implement different behavior depending on the version of RecursiveArrayTools.jl, i.e. for RecursiveArrayTools.jl < v3.27.1 we use the current version and for RecursiveArrayTools.jl >= v3.27.1 we implement the new version. In that case for julia < v1.10 the old version would be used and for julia >= v1.10 the new one. However, if that is really practically viable is another question. Do you see any major problem that rules this solution out?

Project.toml Outdated Show resolved Hide resolved
Project.toml Show resolved Hide resolved
Project.toml Show resolved Hide resolved
@huiyuxie huiyuxie marked this pull request as draft December 11, 2024 21:34
@huiyuxie
Copy link
Member Author

huiyuxie commented Dec 11, 2024

we would need to figure out a way to determine the version of RecusiveArrayTools.jl at compile time.

FIX: at precompile time

@huiyuxie huiyuxie requested a review from ranocha December 11, 2024 23:45
@ranocha
Copy link
Member

ranocha commented Dec 12, 2024

Thanks! Is the following summary correct?

@JoshuaLampert
Copy link
Member

Thanks! Is the following summary correct?

Yes, that's also how I understand it.

@huiyuxie
Copy link
Member Author

e.g., the low-dependency packages for the time integration methods we are typically using

Which one are you referring to?

And how do you display PRs and issues with graphics and titles instead of just numbers?

@ranocha

@ranocha
Copy link
Member

ranocha commented Dec 12, 2024

e.g., the low-dependency packages for the time integration methods we are typically using

Which one are you referring to?

OrdinaryDiffEqLowStorageRK.jl and OrdinaryDiffEqSSPRK.jl

And how do you display PRs and issues with graphics and titles instead of just numbers?

Thanks! Is the following summary correct?

- This PR (updating RecursiveArrayTools.jl) is needed to continue working on https://github.com/trixi-framework/Trixi.jl/pull/2150. To do so, we need to drop support of Julia versions older than 1.10.
- https://github.com/trixi-framework/Trixi.jl/pull/2150 is needed to fix issues such as https://github.com/trixi-framework/Trixi.jl/issues/1789 and remove the hotfix https://github.com/trixi-framework/Trixi.jl/blob/ab8ecad4249fa718fab0ba6acba60bc5d92b8a75/Project.toml#L12 https://github.com/trixi-framework/Trixi.jl/blob/ab8ecad4249fa718fab0ba6acba60bc5d92b8a75/Project.toml#L73 https://github.com/trixi-framework/Trixi.jl/blob/ab8ecad4249fa718fab0ba6acba60bc5d92b8a75/.github/workflows/Downgrade.yml#L75
- These steps are required to use new versions of the SciML packages, e.g., the low-dependency packages for the time integration methods we are typically using

@huiyuxie
Copy link
Member Author

Interesting 🤔

@huiyuxie
Copy link
Member Author

So when do you @ranocha plan to upgrade to Julia 1.10? I need latest version of CUDA.jl to gain higher performance.

@sloede
Copy link
Member

sloede commented Dec 14, 2024

I'm wondering what would happen if we just add v3 to the compat list - wouldn't that allow us to still keep using Julia v1.9 (but with the older SciML stack) but also v1.10/11 with the newer stack?

Or are there other modifications necessary in the code to support the new code? If yes - are they everywhere or limited to certain features. That is, would be get away by declaring, e.g., that some parts of DGMulti no longer run with Julia v1.9?

@jlchan
Copy link
Contributor

jlchan commented Dec 14, 2024

Or are there other modifications necessary in the code to support the new code? If yes - are they everywhere or limited to certain features. That is, would be get away by declaring, e.g., that some parts of DGMulti no longer run with Julia v1.9?

I think it would be complicated. All parts of DGMulti would need to be marked unless compat was set very carefully, and even if the compat worked correctly, there would still need to be some branching code depending on the Julia version.

@sloede
Copy link
Member

sloede commented Dec 14, 2024

Or are there other modifications necessary in the code to support the new code? If yes - are they everywhere or limited to certain features. That is, would be get away by declaring, e.g., that some parts of DGMulti no longer run with Julia v1.9?

I think it would be complicated. All parts of DGMulti would need to be marked unless compat was set very carefully, and even if the compat worked correctly, there would still need to be some branching code depending on the Julia version.

OK. Without having really decided for myself whether I think it's acceptable from a maintenance POV: Would you be OK with making DGMulti effectively work only with Julia v1.10+ or is that something you would like to avoid for now?

@jlchan
Copy link
Contributor

jlchan commented Dec 14, 2024

I'd be perfectly fine with that! I don't think there are a lot (or really any?) current users, so I'm happy to restrict it to 1.10+.

@ranocha
Copy link
Member

ranocha commented Dec 15, 2024

So the suggestion is to allow Julia 1.9 but DGMulti only on Julia 1.10? Would this work? As far as I understand, we need a new RecursiveArrayTools.jl version for it that supports only Julia 1.10. Thus, if DGMulti is part of Trixi.jl, we need to depend on a version of RecusiveArrayTools.jl that requires Julia 1.10.

Since Julia 1.9 is not supported by bugfixes etc. anymore, I tend to prefer upgrading to Julia 1.10. People who need/want to use Julia 1.9 can still continue to use older versions of Trixi.jl. But that's something at least @trixi-framework/principal-developers should agree with.

@huiyuxie
Copy link
Member Author

I'm wondering what would happen if we just add v3 to the compat list - wouldn't that allow us to still keep using Julia v1.9 (but with the older SciML stack) but also v1.10/11 with the newer stack?

RecursiveArrayTools.jl v3 requires a higher version of SciMLBase.jl to precompile without errors. I tried using SciMLBase.jl v2.67.0, which was set by @jlchan in #2150. However, this version already requires Julia v1.10 to be compatible, see https://github.com/SciML/SciMLBase.jl/blob/v2.67.0/Project.toml.

Maybe a version lower than v2.67.0 works good with RecursiveArrayTools.jl v3 and also is compatible with Julia v1.9 but as I mentioned here #2197 - this makes narrowing down the exact version quite time-consuming.

@huiyuxie
Copy link
Member Author

Or are there other modifications necessary in the code to support the new code?

Makie.jl has to be updated to v0.21 to adapt SciMLBase.jl v2.67.0 (and also CairoMakie.jl) - some parts of code need change.

@jlchan
Copy link
Contributor

jlchan commented Dec 15, 2024

Thanks for responding @huiyuxie; sorry I haven't made more progress on my end yet, I've been sick since last week.

Edit: wait, this isn't my PR. Sorry, I am still kind of out of it

@huiyuxie
Copy link
Member Author

Take a rest first - it was just a mention, not asking for a response.

@ranocha
Copy link
Member

ranocha commented Dec 17, 2024

We have discussed this issue with some main developers and agreed that we will go ahead with updating to Julia version 1.10.

Copy link
Member

@ranocha ranocha left a comment

Choose a reason for hiding this comment

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

Thanks a lot! We have to update the CI setup to remove tests on older versions of Julia. We should also mention the update in the NEWS.md.

@huiyuxie
Copy link
Member Author

Sure

@huiyuxie
Copy link
Member Author

Do you @ranocha prefer to completely delete legacy tests or just simply remove them from the CI?

@sloede
Copy link
Member

sloede commented Dec 19, 2024

Do you @ranocha prefer to completely delete legacy tests or just simply remove them from the CI?

We'll do the bump to v1.10 in a separate PR first, see #2214. Then we can proceed with this PR without having to deal with multiple unrelated issues simultaneously.

@huiyuxie huiyuxie requested a review from ranocha December 21, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants