concretize.lp: enforce target compatibility through DAG#29694
concretize.lp: enforce target compatibility through DAG#29694
Conversation
|
@becker33 Do I have to explicitly ask for the |
|
@bvanessen you have to explicitly ask, the inferred part is the task 2 identified above for a future PR (future because I want to get this in quickly to provide a workaround. |
|
I'll have a closer look at the implementation, but at a high level wouldn't it be a valid use case that of being able to specify a root with a target that is "more generic" than the dependency? Shouldn't that just mean that the most specific target is required to run/use the software? Use cases (admittedly niche) that come to mind:
|
There was a problem hiding this comment.
The implementation, including the test, LGTM since it performs perfectly what is stated in the description. I have a performance concern, as this PR increases the wall-clock time for me of a 30-40% on a simple test.
On develop:
$ spack solve -l --timers hdf5~mpi target=skylake ^zlib target=x86_64
Time:
setup: 6.5062
load: 0.0235
ground: 1.3863
solve: 1.9863
Total: 9.9276
[ ... ]
a7ujmwo [email protected]%[email protected] [ ... ]while with this PR:
$ spack solve -l --timers hdf5~mpi target=skylake ^zlib target=x86_64
Time:
setup: 6.9691
load: 0.0270
ground: 3.2747
solve: 4.2144
Total: 14.5106
[ ... ]
a7ujmwo [email protected]%[email protected] [ ... ]Should we consider tying this behavior to some configuration option in concretizer.yaml?
|
For point 2. in the description I tried to apply this simple diff: diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 89c9108fc1..0c108f909f 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1405,12 +1405,12 @@ def target_defaults(self, specs):
self.gen.h2('Target compatibility')
compatible_targets = [uarch] + uarch.ancestors
- additional_targets_in_family = sorted([
- t for t in archspec.cpu.TARGETS.values()
- if (t.family.name == uarch.family.name and
- t not in compatible_targets)
- ], key=lambda x: len(x.ancestors), reverse=True)
- compatible_targets += additional_targets_in_family
+ # additional_targets_in_family = sorted([
+ # t for t in archspec.cpu.TARGETS.values()
+ # if (t.family.name == uarch.family.name and
+ # t not in compatible_targets)
+ # ], key=lambda x: len(x.ancestors), reverse=True)
+ # compatible_targets += additional_targets_in_family
compilers = self.possible_compilers
# this loop can be used to limit the number of targetswhich effectively allows |
ce2cb4e to
dd9a6d6
Compare
|
With the latest version, on $ spack solve -l --timers hdf5~mpi target=skylake ^zlib target=x86_64Time:
setup: 4.0466
load: 0.0191
ground: 1.3779
solve: 1.6693
Total: 7.1250
==> Best of 6 considered solutions.
==> Optimization Criteria:
Priority Criterion Installed ToBuild
1 number of packages to build (vs. reuse) - 0
2 deprecated versions used 0 0
3 version weight 0 0
4 number of non-default variants (roots) 0 0
5 preferred providers for roots 0 0
6 default values of variants not being used (roots) 0 0
7 number of non-default variants (non-roots) 0 0
8 preferred providers (non-roots) 0 0
9 compiler mismatches 0 0
10 OS mismatches 0 0
11 non-preferred OS's 0 0
12 version badness 0 4
13 default values of variants not being used (non-roots) 0 1
14 non-preferred compilers 0 0
15 target mismatches 0 3
16 non-preferred targets 0 64
ug54dun [email protected]%[email protected]~cxx~fortran~hl~ipo~java~mpi+shared~szip~threadsafe+tools api=default build_type=RelWithDebInfo patches=ee351eb arch=linux-ubuntu20.04-skylake
r5zacq4 ^[email protected]%[email protected]~doc+ncurses+ownlibs~qt build_type=Release arch=linux-ubuntu20.04-skylake
vkvafs4 ^[email protected]%[email protected]~symlinks+termlib abi=none arch=linux-ubuntu20.04-skylake
gmcewy3 ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
memequu ^[email protected]%[email protected]~docs~shared certs=system arch=linux-ubuntu20.04-skylake
nlnc57n ^[email protected]%[email protected]+cpanm+shared+threads arch=linux-ubuntu20.04-skylake
yniz5iz ^[email protected]%[email protected]+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-skylake
exsz2mg ^[email protected]%[email protected]~debug~pic+shared arch=linux-ubuntu20.04-skylake
2nlyt7g ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
surcip3 ^[email protected]%[email protected] libs=shared,static arch=linux-ubuntu20.04-skylake
ts2vtbx ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
upmrpdl ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
boagcht ^[email protected]%[email protected]+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-x86_64while on this PR: $ spack solve -l --timers hdf5~mpi target=skylake ^zlib target=x86_64Time:
setup: 4.0627
load: 0.0194
ground: 1.4667
solve: 1.7911
Total: 7.3519
==> Best of 4 considered solutions.
==> Optimization Criteria:
Priority Criterion Installed ToBuild
1 number of packages to build (vs. reuse) - 0
2 deprecated versions used 0 0
3 version weight 0 0
4 number of non-default variants (roots) 0 0
5 preferred providers for roots 0 0
6 default values of variants not being used (roots) 0 0
7 number of non-default variants (non-roots) 0 0
8 preferred providers (non-roots) 0 0
9 compiler mismatches 0 0
10 OS mismatches 0 0
11 non-preferred OS's 0 0
12 version badness 0 4
13 default values of variants not being used (non-roots) 0 1
14 non-preferred compilers 0 0
15 target mismatches 0 3
16 non-preferred targets 0 64
ug54dun [email protected]%[email protected]~cxx~fortran~hl~ipo~java~mpi+shared~szip~threadsafe+tools api=default build_type=RelWithDebInfo patches=ee351eb arch=linux-ubuntu20.04-skylake
r5zacq4 ^[email protected]%[email protected]~doc+ncurses+ownlibs~qt build_type=Release arch=linux-ubuntu20.04-skylake
vkvafs4 ^[email protected]%[email protected]~symlinks+termlib abi=none arch=linux-ubuntu20.04-skylake
gmcewy3 ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
memequu ^[email protected]%[email protected]~docs~shared certs=system arch=linux-ubuntu20.04-skylake
nlnc57n ^[email protected]%[email protected]+cpanm+shared+threads arch=linux-ubuntu20.04-skylake
yniz5iz ^[email protected]%[email protected]+cxx~docs+stl patches=b231fcc arch=linux-ubuntu20.04-skylake
exsz2mg ^[email protected]%[email protected]~debug~pic+shared arch=linux-ubuntu20.04-skylake
2nlyt7g ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
surcip3 ^[email protected]%[email protected] libs=shared,static arch=linux-ubuntu20.04-skylake
ts2vtbx ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
upmrpdl ^[email protected]%[email protected] arch=linux-ubuntu20.04-skylake
boagcht ^[email protected]%[email protected]+optimize+pic+shared patches=0d38234 arch=linux-ubuntu20.04-x86_64so it is really a few |
|
@becker33 Just for the record, did you try to write |
|
@alalazo yes, I tried writing them from python instead of deducing them, it didn't make any noticeable difference in performance. |
Related to #29672
29672 involves two separate issues
This PR fixes the first issue.
@bvanessen with this fix you will be able to work around the first issue by explicitly requesting
target=power8lefor your root specs with the matrix we discussed yesterday.