concretizer: option to disable compiler mixing between runtime deps#51135
concretizer: option to disable compiler mixing between runtime deps#51135scheibelp merged 69 commits intospack:developfrom
Conversation
|
This is quite elegant 👍 Should also work in the future with LLVM-based compilers using Not necessary for this PR, but maybe good to think ahead how this can be extended for other use cases:
|
|
I'll post benchmark results asap. |
…th are not external) Signed-off-by: Peter Scheibel <[email protected]>
Signed-off-by: Peter Scheibel <[email protected]>
Signed-off-by: Peter Scheibel <[email protected]>
Signed-off-by: Peter Scheibel <[email protected]>
28bc1d6 to
69af7dd
Compare
I'm not clear how this PR would work with that change: there would still be
For things that can't mix (i.e. where this is mandatory), package directives would be better than config (this PR is about both preference and need); I think it would be easy to generate the asp dynamically (i.e. where the ParentNode or ChildNode check against package names).
I think that would be a good extension but I think some people would still want to turn it off entirely (so the schema would support boolean or a dictionary of lang->boolean). |
I think I understand better now:
|
There was a problem hiding this comment.
I benchmarked this against:
- Spack: 1.1.0.dev0 (c46eebd)
- Builtin repo: spack/spack-packages@e3d72e6
- Python: 3.13.2
- Platform: linux-ubuntu20.04-icelake
radiuss.disable_mixing_on.csv
radiuss.disable_mixing_no_disabling.csv
radiuss.develop.csv
When mixing is disabled the same spec can be 30% slower to concretize, otherwise there is no difference. For the record I had a configuration with 4 gcc and 2 llvm compilers
Grounding doesn't seem much of an issue, as it is solving in this case.
|
Significant changes from earlier, for a dag like (All edges are link deps)
New statements added, plus tests for them (although not comprehensive) |
…down to minimum infrastructure setup
…icient. Revert "bypass mutable_database entirely and strip test_disable_mixing_reuse down to minimum infrastructure setup" This reverts commit ea9f71d.
alalazo
left a comment
There was a problem hiding this comment.
I left a few comments. Did anybody ever worked out if there are edge cases with splicing that would not be covered?
I don't think we should deal with them here, in case there are, but it would be good to know if we have them.
|
@scheibelp Am I correct if I say that this:
is meant to be fixed by #51383 and it's just the description of the PR that is slightly outdated? |
In short, I don't think so:
(I think it was already understood, but the problem this is referring to is if you use this PR and then say |
Sure, the main question for me was if this problem is meant to be fixed in this PR (I was a bit perplexed seeing that in the TODO list). I guess we are on the same page:
|
… suggestion from Max add test that confirms need for third compiler mixing block in concretize.lp checking to see what aspects of this new test are required update comments; update docs now that we dont identify by name/version auto style
…g anything beyond test_disable_mixing_prevents_mixing
…e of the tests for dependents
…utable_database introduced by this PR)
|
I just benchmarked this against:
When compiler mixing is allowed, this has no impact on concretization time for that benchmark: radiuss.mixing-true.csv
When we forbid compiler mixing, there's just a slight regression in solve time, but the total time is not affected:
|
alalazo
left a comment
There was a problem hiding this comment.
I think this PR is basically ready. The only polishing remaining is imo to:
- Update the PR title and description
- Add some default configuration for the new option to our YAML files
The last point in particular is needed so that users could know what is the default if they use:
$ spack config [get|blame] concretizerRight now that command shows no value for concretize:compiler_mixing.
|
@alalazo I believe review requests are now addressed:
|
…pack#51135) You can set `concretizer:compiler_mixing:false` to ensure that any compiler assigned to a root spec will be used consistently by all of its dependencies; more generally, that all packages in the link/run DAG that includes the root will use the same c compiler, and likewise for c++ and Fortran. This setting defaults to true, i.e. this PR will have no affect on concretizations unless a user changes the configuration setting from the default. `compiler_mixing:` can also be a list of package names: in that case the named packages will be allowed to use any compiler; all other packages (including parents/children of those named packages) will need to be consistent. --------- Signed-off-by: Peter Scheibel <[email protected]>



You can set
then e.g.:
(even with this setting on, mixing is allowed when a dependency is an external, and only enforced within transitive link run/tree, i.e. the root unification set)
TODOs
virtual_on_edgeis not derived (or does not need to always be derived) for reused packages (so this is only guaranteed if reuse is disabled)