Repository navigation
fix(rccl): guard x86 cpuid and arch assertions in xml-test.cc - #14413
Open
benrichard-amd wants to merge 1 commit into
Open
benrichard-amd wants to merge 1 commit into
benrichard-amd wants to merge 1 commit into
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Contributor
There was a problem hiding this comment.
ARGUS
Findings
3 more finding(s), not posted inline
projects/rccl/test/host/xml-test.cc:658(Low) x86 guard wraps the whole of GetXmlFromCpu_FillsAffinityArchAndCpuid, so off x86 nothing asserts the non-zero affinity_offset branch (xml.cc:529); guard only the cpuid parts.projects/rccl/test/host/xml-test.cc:18(Nit) NCCL_HOST_ARCH tests PPC64 variants where xml.cc:535 tests PPC; use PPC so the test copy matches production.projects/rccl/test/host/xml-test.cc:17(Nit) Two adjacent blocks repeat the same x86 guard; fold the <cpuid.h> include into the x86_64 branch of the NCCL_HOST_ARCH chain.
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
mch
requested changes
Nov 3, 2026
xml-test.cc (added in #13605) unconditionally includes <cpuid.h> and uses __cpuid() inline asm, which fails on non-x86 architectures (ppc64le, aarch64). Guard the include, the HostCpuId() helper, and the one test that calls it behind an x86 preprocessor check. Two other tests hardcode EXPECT_EQ("x86_64", ...) for the arch attribute, but the SUT correctly returns the host arch (e.g. "ppc64"). Add a constexpr kHostArch that mirrors the arch detection in xml.cc (same condition order: __PPC__, __aarch64__, x86; same macro names) so these tests pass on any architecture. Unknown architectures produce a hard #error to surface the contract immediately. Co-Authored-By: Claude <noreply@anthropic.com>
benrichard-amd
force-pushed
the
users/benrichard-amd/rccl-xml-test-x86-guard
branch
from
November 3, 2026 17:05
6a7284e to
742ce26
Compare
This branch has not been deployed
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.
Motivation
Part of work for ROCm/TheRock#5518
xml-test.cc(added in #13605) unconditionally includes<cpuid.h>and uses__cpuid()x86 inline asm, causing a compile error on non-x86 architectures. Two tests also hardcodeEXPECT_EQ("x86_64", ...)for the arch attribute, which fails on ppc64le where the SUT correctly returns"ppc64".Technical Details
#include <cpuid.h>, theCpuIdstruct,HostCpuId()function, and theGetXmlFromCpu_FillsAffinityArchAndCpuidtest behind#if defined(__x86_64__) || defined(_M_X64), matching the convention used inxml.cc,init.cc, andinit-test.cc.NCCL_HOST_ARCHpreprocessor macro that mirrors the arch detection logic insrc/graph/xml.cc("x86_64"/"ppc64"/"arm64"). Replace the two remaining hardcoded"x86_64"assertions inGetXmlFromSys_NoSysfsAttachesToTheUnknownCpuandGetXmlFromSys_ExistingParentIsFilledInTurnwithNCCL_HOST_ARCH.GetXmlFromCpu_FillsAffinityArchAndCpuidtest remains x86-only since it validates cpuid vendor/family/model fields that only exist on x86.Test Plan
Built RCCL and ran the host microtest suites (
ctest -R "Micro|HostOnly|MicroTopo") on a POWER10 ppc64le machine.Test Result
137/153 ctest targets pass. The 2 previously failing
XmlSysfsMicrotestarch tests now pass. The 16 remaining failures (2 unique tests × suite/config variants) are pre-existing and unrelated:P2pSchedule_ZeroGroupSizeParam_DiesOnDivideByZero— death test expects SIGFPE, but POWER hardware returns 0 for integer divide-by-zero instead of trapping.GroupJobUnlinkCommsTest.EmptyAsyncJobsStillClearsTheCommHeadChain—groupJobpointer not being cleared; logic bug in the new test.