fix(preflight): remove hardcoded NIC/GPU count assumptions in health checks - #376
Open
paklui wants to merge 1 commit into
Open
fix(preflight): remove hardcoded NIC/GPU count assumptions in health checks#376paklui wants to merge 1 commit into
paklui wants to merge 1 commit into
Conversation
…checks get_nic_ethtool_stats_dict() indexed every node with the first node's backend RDMA NIC count, so a cluster with one node missing a link (fewer NICs than its peers) crashed with IndexError instead of just reporting that node's actual interfaces. Batch size is now driven by the max count across nodes, with a no-op substituted for nodes short an interface at a given index and their results skipped on parse. verify_gpu_pcie_bus_width() defaulted expected_cards to 8 and check_cluster_health never overrode it, so it unconditionally failed on any platform with a different GPU count per node (e.g. a 4-GPU Helios-R tray). The default now auto-detects the expected count from the first node; check_cluster_health also gains an --expected_gpu_count flag for explicit override. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #375, addressing the two other issues flagged during that review
(hardcoded NIC/GPU count assumptions in the cluster health checks).
get_nic_ethtool_stats_dict()(cvs/lib/linux_utils.py) derived itsper-node command batch size from the first node's backend RDMA NIC count
and indexed every other node with it. A cluster where one node has fewer
NICs than its peers (e.g. a downed link) hit
IndexError. Batch size isnow driven by the max count across nodes; nodes short an interface at a
given index run a harmless
trueno-op for that round and are skippedwhen parsing results.
verify_gpu_pcie_bus_width()(cvs/lib/verify_lib.py) defaultedexpected_cards=8, andcheck_cluster_health.pyalways called it with nooverride, so the check unconditionally failed on any platform with a
different GPU count per node (e.g. a 4-GPU Helios-R tray always reported
"Number of cards not matching expected no 8"). The default now auto-detects
the expected count from the first node's actual GPU count;
check_cluster_healthalso gains an
--expected_gpu_countflag for explicit override when strictenforcement of a known count is wanted.
Testing
test_asymmetric_nic_counts_across_nodes(linux_utils),test_auto_detects_expected_cards_when_omittedandtest_flags_node_disagreeing_with_auto_detected_count(verify_lib).make fmt-checkandmake lintclean (pylint 10.00/10).RDMA NICs/node):
verify_gpu_pcie_bus_width(phdl)with noexpected_cardsnowauto-detects 4 instead of failing against the hardcoded 8.
get_nic_ethtool_stats_dict(phdl)runs cleanly across both nodes withcorrect per-node interface sets; no regression on the normal (symmetric)
path. Both nodes happened to have all links up during this test, so the
exact asymmetric-count path itself is covered by the unit test rather
than a live repro (didn't want to force a link down on shared hardware
to manufacture one).
Test plan
make fmt-checkmake lintpython -m unittest cvs.lib.unittests.test_linux_utils cvs.lib.unittests.test_verify_lib🤖 Generated with Claude Code