Ticket 15760

Summary: node_features/helpers not working on 23.02 with 2 features
Product: Slurm Reporter: Felix Abecassis <fabecassis>
Component: slurmctldAssignee: Marshall Garey <mgarey>
Status: RESOLVED FIXED QA Contact:
Severity: 3 - Medium Impact    
Priority: --- CC: bchristianse, bnabong, dwightman, jbernauer, lyeager, mgarey
Version: 23.02.x   
Hardware: Linux   
OS: Linux   
Site: NVIDIA (PSLA) Slinky Site: ---
Alineos Sites: --- Atos/Eviden Sites: ---
Confidential Site: --- Coreweave sites: ---
Cray Sites: --- DS9 clusters: ---
Google sites: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- NoveTech Sites: ---
Nvidia HWinf-CS Sites: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Tzag Elita Sites: ---
Linux Distro: --- Machine Name:
CLE Version: Version Fixed: 23.02.0pre1
Target Release: --- DevPrio: ---
Emory-Cloud Sites: ---

Description Felix Abecassis 2023-01-09 13:59:27 MST
I tried to validate https://bugs.schedmd.com/show_bug.cgi?id=12286, but I was not able to do so as there might be a regression on the current master (9f735b7).

This is a multiple-slurmd single node config with 2 features defined in helpers.conf:
$ cat /etc/slurm/helpers.conf 
Feature=nps=4 Helper=/etc/slurm/node_features_helpers/amd_rome
Feature=nps=2 Helper=/etc/slurm/node_features_helpers/amd_rome
Feature=nps=1 Helper=/etc/slurm/node_features_helpers/amd_rome
Feature=mig=off Helper=/etc/slurm/node_features_helpers/nvidia_mig_off
Feature=mig=on Helper=/etc/slurm/node_features_helpers/nvidia_mig_on
MutuallyExclusive=nps=1,nps=2,nps=4
MutuallyExclusive=mig=on,mig=off


If the nodes are in nps=2, requesting just "nps=4" doesn't work anymore (it did in 22.05):
$ srun --constraint="nps=1" -N4 bash -c 'echo $SLURM_NODELIST'
srun: error: Node failure on node-4
srun: error: Nodes node-[1-4] are still not ready
srun: error: Something is wrong with the boot of the nodes.

From the slurmctld log:
slurmctld: error: Setting node node-4 state to INVAL with reason:Reported active features (nps=1,mig=off) different from currently active features (nps=1,rack1,blue,leaf01)

It looks like it's related to the fact that "mig" is a changeable feature, but no value was requested by the user for this feature, using --constraint="nps=1&mig=off" works fine.


git bisect:
$ git bisect bad
44a7a41c53ee8d679d6601636029a34c1b0367df is the first bad commit
commit 44a7a41c53ee8d679d6601636029a34c1b0367df
Author: Brian Christiansen <brian@schedmd.com>
Date:   Thu Dec 29 17:33:34 2022 -0700

    Validate reported active features
    
    Active features are set on the node when the node is allocated and the
    nodes are told to reboot into the active features. The slurmd should
    then report the active features that the node has.
    
    Previously it was possible for a node to come up with different active
    features than the jobs expected to get by rebooting the node.
    
    If the node doesn't report features then the controller is just managing
    the active features.
    
    Bug 14529
Comment 1 Marshall Garey 2023-01-09 14:49:01 MST
Yes, you identified the offending commit. slurmctld is validating that the features the slurmd sends with the registration message are the same features that the job requested. This is why your job works when it requests nps=1&mig=off.

We did this because the slurmd could report any features it wanted, even if those didn't match what the job requested, and that could be bad for the job or subsequent jobs scheduled on that node.

However, you are adding on additional features (mig=off), correct? We didn't anticipate adding on additional features, but I can see how that could be useful. We are fine reverting that commit.
Comment 2 Marshall Garey 2023-01-09 15:11:56 MST
Felix,

What if we validate that the all reported (by slurmd) features are a superset of the features that are in slurmctld? I.e. a job requests nps=1, slurmctld will make the node's active features nps=1 (in addition to any static features). When the slurmd reports nps=1,mig=off, slurmctld validates that nps=1 is in the features reported by slurmd. Does this make sense to you? Do you have a use case where slurmd might report features that are not a superset of what the job requested?

- Marshall
Comment 4 Felix Abecassis 2023-01-09 15:38:18 MST
Validating that the node boots in the expected configuration is very useful to detect problems so we do want to keep this behavior.

> What if we validate that the all reported (by slurmd) features are a superset of the features that are in slurmctld?

Yes, I think that would be fine, right now I don't see any issue with your proposed approach.

==

To elaborate on why I think the current behavior is a problem: previously, specifying only "nps=1" was equivalent to "nps=1&mig=<any>" i.e. mig=on OR mig=off OR mig=<unset>.

On "master" this is now true only when a reboot is not needed.
For example, if I have 3 nodes with nps=1&mig=on and 1 node with nps=1&mig=off, then "srun -N4 --constraint nps=1" will work and use the 4 nodes, because they were all in nps=1 mode. 

But if I have the last node in mode nps=2&mig=off state instead, then "srun -N4 --constraint nps=1" won't work as this node will fail at boot time with the "Reported active features different from currently active features" error.

If you would like "--constraint=nps=1" to become equivalent to "--constraint=nps=1&mig=<unset>" (so *not* "on" or "off"), then I request to consider https://bugs.schedmd.com/show_bug.cgi?id=12289 again as it would alleviate the extra verbosity being required for users.
Comment 5 Marshall Garey 2023-01-09 15:43:48 MST
(In reply to Felix Abecassis from comment #4)
> Validating that the node boots in the expected configuration is very useful
> to detect problems so we do want to keep this behavior.
> 
> > What if we validate that the all reported (by slurmd) features are a superset of the features that are in slurmctld?
> 
> Yes, I think that would be fine, right now I don't see any issue with your
> proposed approach.

Thanks for your feedback. We'll let you know when that is done.


> ==
> 
> To elaborate on why I think the current behavior is a problem: previously,
> specifying only "nps=1" was equivalent to "nps=1&mig=<any>" i.e. mig=on OR
> mig=off OR mig=<unset>.

This makes sense.

> On "master" this is now true only when a reboot is not needed.
> For example, if I have 3 nodes with nps=1&mig=on and 1 node with
> nps=1&mig=off, then "srun -N4 --constraint nps=1" will work and use the 4
> nodes, because they were all in nps=1 mode. 
> 
> But if I have the last node in mode nps=2&mig=off state instead, then "srun
> -N4 --constraint nps=1" won't work as this node will fail at boot time with
> the "Reported active features different from currently active features"
> error.
> 
> If you would like "--constraint=nps=1" to become equivalent to
> "--constraint=nps=1&mig=<unset>" (so *not* "on" or "off"),then I request to
> consider https://bugs.schedmd.com/show_bug.cgi?id=12289 again as it would
> alleviate the extra verbosity being required for users.

I agree with you that keeping the 22.05 behavior makes sense.
Comment 9 Marshall Garey 2023-01-13 14:41:06 MST
Hi,

The fix is upstream in commit 07ecffa406.
We updated NEWS and RELEASE_NOTES in commit 1a8b24f1bc.

As discussed, slurmctld validates that the features reported by slurmd must be a superset of the features that are already saved in the slurmctld, which were updated when the job was scheduled.

I'm closing this as fixed.