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

Adding CUTEst.jl to the optimization benchmarks #1036

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

alonsoC1s
Copy link

This PR leverages the integration of CUTEst.jl into the SciML umbrella to add all problems in the CUTEst collection to a set of optimization benchmarks. Resolves #935

To complete this PR, the building infrastructure will have to be changed to manually install gfortran as required by CUTEst.jl.

@ChrisRackauckas
Copy link
Member

Is gfortran still required after JuliaSmoothOptimizers/CUTEst.jl@df91b3c ?

Is there anything not in the jll? Maybe @staticfloat can help here.

@alonsoC1s
Copy link
Author

I am not sure to be honest, if the jll makes gfortran available system-wide, it should probably work. As far as I know, CUTEst.jl performs a simple test to verify if gfortran exists in the system by calling it in a shell and checking for errors

@staticfloat
Copy link
Contributor

We ship libgfortran with Julia, and make it available for libraries and executables in JLLs, so if that's all you need, you should be good to go.

@ChrisRackauckas
Copy link
Member

What exactly is asking/calling for gfortran @abelsiqueira?

@abelsiqueira
Copy link

Sifdecode, to decode the SIF file, which gets called by CUTEstModel. Things might have changed recently. Cc. @amontoison @dpo @tmigot

@amontoison
Copy link

amontoison commented Aug 25, 2024

@alonsoC1s I'm working on a new release (v0.14.0) with many modifications (support of Windows as well as single and quadruple precision).
We also changed a lot of things with Nick Gould in CUTEst and SIFDecode.

gfortran is needed because the test problems are based on SIF files and the SIF decoder generates Fortran files to be compiled:
https://github.com/JuliaSmoothOptimizers/CUTEst.jl/blob/db823cb293d2cdf321b62fd2e80f4fb84dbba39c/src/sifdecoder.jl#L144
On Windows I added an artifactact in Artifacts.toml to provide gfortran.exe but I expect the Linux and Mac users to install it.

We don't precompile the problems to support problems of variable size. We also have 1500 problems so it's 4500 libraries if we want to precompile everything (with fixed size).

@ChrisRackauckas
Copy link
Member

On Windows I added an artifactact in Artifacts.toml to provide gfortran.exe but I expect the Linuw and Mac users to install it.

That's very non-standard? Seems odd to bundle an artifact on some systems but not others. Also, it doesn't make much sense given @staticfloat's comment that it's already bundled with Julia?

@amontoison
Copy link

amontoison commented Aug 26, 2024

You didn't understand the message of @staticfloat. libgfortran is shiped with Julia, not gfortran.
A library is different than a compiler. 😏

I did a copy of the Artifacts.toml available in PackageCompiler.jl, that only install the compilers on Windows.
I don't know if we have available artifacts of compilers (and not cross-compilers) available thanks to BinaryBuilder / BinaryBuilderBase for all platforms (Mac, linux, FreeBSD).
@staticfloat Do you have the answer?

Binaries and libraries of SIFDecode and CUTEst are cross-compiled on all platforms with Yggdrasil.

@staticfloat
Copy link
Contributor

I don't know if we have available artifacts of compilers (and not cross-compilers) available thanks to BinaryBuilder / BinaryBuilderBase for all platforms (Mac, linux, FreeBSD).

Ask me again in ~2 months, I should have implemented it in BinaryBuilderToolchains.jl by then. Until then, what you're doing here is fine.

@ChrisRackauckas
Copy link
Member

So do we build add gfortran as a buildkite dep in the meantime?

@alonsoC1s
Copy link
Author

@ChrisRackauckas that could work. I can also work on this locally and leave the PR to be revised when the functionality lands on the new versions. I don't know how labour-intensive temporarily adding gfortran to buildkite is, but it's probably best to avoid fixes that will soon be unnecessary

@staticfloat
Copy link
Contributor

You should be able to either add it to the rootfs image being used, or just apt update && apt install -y gfortran.

@ChrisRackauckas
Copy link
Member

You need to bump the manifest and Symbolics version. Since gfortran is now installed, this should be finishable.

@alonsoC1s
Copy link
Author

Yep, I just saw the railed build. I'll fix the manifest, try again, and once I can see some preliminary results I can write something about them and write the rest of the benchmarks

problems on this section.

```julia
eq_bou_problems = CUTEst.select(min_con=1, only_equ_con=true, only_free_var=false)

Choose a reason for hiding this comment

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

CUTEst.select is still available for backward compatiblity but the exported function is select_sif_problems.
https://jso.dev/CUTEst.jl/dev/classification/#CUTEst.select_sif_problems

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the tip. Should I open an issue in CUTEst.jl (or the JSO page) to update the documentation?

Choose a reason for hiding this comment

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

Open an issue please. I updated the documentation of CUTEst.jl but I forgot the tutorial.

@ChrisRackauckas
Copy link
Member

Error: InitError: gfortran is not installed. Please install it and try agai
n.
during initialization of module CUTEst

@thazhemadam can you take a second look at this?

@ChrisRackauckas
Copy link
Member

Did the benchmark get stuck or does it just take really really long?

@ChrisRackauckas
Copy link
Member

Maybe split this into a few different scripts for the major groups? Seems like it's running fine though so it's just a bit of file management.

@alonsoC1s
Copy link
Author

I could reduce the scope by focusing on particular groups of problems. In total there's several thousand problems, some of which are rather large

@ChrisRackauckas
Copy link
Member

It's fine that it's large, but if you split it to multiple files then it can run in parallel and we could also isolate if there's one section that is much longer than the others. It looks like


┌ Info: Weaving chunk 6 from line 161
--
  | └   progress = 0.5555555555555556

that chunk might just be stuck, while others completed.

@alonsoC1s
Copy link
Author

Sure, I'll start splitting into files. Hopefully that resolves the stuck chunk or at least makes it easier to see where it's getting stuck

@ChrisRackauckas
Copy link
Member

It looks like it's stalling in the first solve. Every solve really. @alonsoC1s was it doing this locally for HIER13?

@alonsoC1s
Copy link
Author

I only did some very limited testing locally, basically confirming I didn't have any runtime errors. I did try solving manually some problems like Rosenbrock and it worked as expected, as long as the models were finalized as I took care of doing in the testing loop

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.

CUTEST.jl benchmark wrappers
6 participants