ASP-based solver: allow configuring target selection#29835
ASP-based solver: allow configuring target selection#29835becker33 merged 6 commits intospack:developfrom
Conversation
|
@bvanessen This is still a draft, but I think it might be one way to solve your issue with Spack reusing binaries that are incompatible with the host. Can you try this PR with: concretizer:
targets:
host_compatible: true? I drafted the PR after having observed an increase in the time it takes to concretize a spec if we add additional rules as in #29694. Since Spack seems sensitive to the number of targets that are used as candidates, here I simply avoid emitting facts for certain targets (i.e. I reduce the problem space) rather than having additional rules in the logic program. This is the result on my host:
when I concretize $ spack solve --timers hdf5
Time:
setup: 4.1003
load: 0.0191
ground: 1.3516
solve: 1.7280
Total: 7.2267
[ ... ]and when I only allow for generic $ spack solve --timers hdf5
Time:
setup: 3.9343
load: 0.0191
ground: 1.0835
solve: 1.4872
Total: 6.5506
[ ... ] |
|
Here's an example concretization when using: concretizer:
targets:
granularity: generic$ spack solve --timers trilinos |
lib/spack/spack/solver/asp.py
Outdated
| if target not in compatible_targets: | ||
| compatible_targets.append(target) | ||
| if target not in candidate_targets: | ||
| candidate_targets.append(target) |
There was a problem hiding this comment.
I think we need to add the ancestors of the target here as well. If I'm on an aarch64 system, and try to concretize hdf5 target=broadwell, then I should have haswell and x86_64 available as allbacks for dependency nodes that can't build with broadwell.
There was a problem hiding this comment.
See ec1bb5f I think we'll need to revisit anyhow when adding proper support for cross-compilation.
16c4f88 to
4488a05
Compare
This commit adds a new "concretizer:targets" configuration section, and two options under it. - "concretizer:targets:granularity" allows switching from considering only generic targets to consider all possible microarchitectures. - "concretizer:targets:host_compatible" instead controls whether we can concretize for microarchitectures that are incompatible with the current host.
…gardless of settings)
4488a05 to
2fbdc7b
Compare
fixes #29672
This commit adds a new
concretizer:targetsconfiguration section, and two options under it.concretizer:targets:granularityallows switching from considering only generic targets to consider all possible microarchitectures.concretizer:targets:host_compatibleinstead controls whether we can concretize for microarchitectures that are incompatible with the current host.Modifications: