3.13.3.3#207
Merged
Merged
Conversation
ARM nodes that do not expose sub-revision-specific flags (e.g. SSBS,
EVTSTRM, LRCPC, DCPOP, ASIMDDP) were incorrectly reported as UNKNOWN
instead of ARMv8. The must_arm_v8 list was over-specified: it required
flags that are optional or were introduced in ARMv8.2–8.5 sub-revisions
and may be absent on fully conforming ARMv8-A hardware.
The ARMv8 check is now restricted to the two mandatory ARMv8-A baseline
flags: FP and ASIMD. All other feature flags are optional extensions and
are not required for classification.
The script has also been refactored to meet project coding standards:
- Global mutable flag lists replaced with FlagSpec / X86FlagSpecs
dataclasses returned by factory functions (build_x86_specs,
build_x86naive_specs, build_arm_spec), eliminating all global
statements
- Full type hints and Google-style docstrings on all functions
- Passes flake8, pylint (10/10), pyright, and pydocstyle --convention=google
- open() calls use encoding="utf-8"; subprocess.run uses check=False
explicitly; logging uses %s formatting throughout
- Entry point wrapped in main()
The CLI interface is unchanged except that --alg choices are renamed
from {naive,gcc} to {x86naive,x86} to better reflect their meaning.
The default algorithm (x86, formerly naive... wait, formerly gcc in the
internal call) is preserved.
Fixes ARM jobs reported as UNKNOWN in cpu_architecture_level field.
See: https://its.cern.ch/jira/browse/ATLINFR-4844
Activate internal cpu_arch.py fallback in get_cpu_arch()
The fallback call to get_cpu_arch_internal() was present but commented
out. It is now active: if the experiment plugin returns an empty string
(e.g. because the CVMFS call failed), the pilot will invoke the bundled
pilot/scripts/cpu_arch.py directly rather than silently returning no
architecture.
Also removes --alg gcc from the get_cpu_arch_internal() invocation; the
renamed flag (now --alg x86) is the default and need not be passed
explicitly.
Treat UNKNOWN return from CVMFS cpu_arch.py as a fallback trigger
If the CVMFS script runs successfully but returns "UNKNOWN", the result
is now reset to an empty string so that the fallback chain in
workernode.get_cpu_arch() proceeds to get_cpu_arch_internal(). Previously
UNKNOWN was returned as-is, bypassing the internal fallback entirely.
There was a problem hiding this comment.
Pull request overview
This PR addresses cases where CPU architecture detection reports UNKNOWN by introducing a Pilot-side fallback to the bundled pilot/scripts/cpu_arch.py, and bumps the Pilot version to 3.13.3.2.
Changes:
- Enable internal CPU-architecture fallback when the experiment plugin returns an empty value (and make ATLAS convert
UNKNOWNto empty to trigger fallback). - Refactor
pilot/scripts/cpu_arch.pyto support x86-64 tier detection and ARMv8 detection with clearer structure and CLI options. - Bump Pilot version constants/files and adjust pylint configuration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
PILOTVERSION |
Updates the published Pilot version to 3.13.3.2. |
pilot/util/constants.py |
Updates REVISION/BUILD to match the new Pilot version. |
pilot/util/workernode.py |
Enables internal fallback when plugin CPU-arch detection returns empty; adjusts internal script invocation. |
pilot/user/atlas/utilities.py |
Treats CVMFS cpu_arch.py returning UNKNOWN as “no result” to trigger Pilot fallback. |
pilot/scripts/cpu_arch.py |
Major refactor of CPU arch detection logic and CLI, adding ARM handling and improving structure. |
.pylintrc |
Comments out suggestion-mode setting. |
Comments suppressed due to low confidence (1)
pilot/util/workernode.py:203
get_cpu_arch()now callsget_cpu_arch_internal()as a fallback, butget_cpu_arch_internal()can currently crash whenPYTHONPATHis unset (os.environ['PYTHONPATH']KeyError /None + ':'TypeError). Also, the successful stdout fromcpu_arch.pylikely includes a trailing newline; returning it unstripped can propagate newline characters intocpu_architecture_level.
ec, stdout, stderr = execute(f'python3 {script_dir}/{script}')
if ec or stderr:
logger.debug(f'ec={ec}, stdout={stdout}, stderr={stderr}')
else:
cpu_arch = stdout
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… in get_cpu_arch_internal()
Three bugs in get_cpu_arch_internal(): os.environ['PYTHONPATH'] raises KeyError on any site where PYTHONPATH is not set; os.environ.get('PYTHONPATH') + ':' + script_dir raises TypeError when the same variable is unset (returns None); stdout assigned unstripped, propagating a trailing newline into cpu_architecture_level. Fix by reading PYTHONPATH once with a default of '', and calling .strip() on stdout.
test_cpu_arch.py: add unit tests for cpu_arch.py classification logic
26 tests across four classes covering check_flags(), x86_checks() with both the GCC and naive specs across all four tiers using representative real-world flag strings (Skylake-X, Haswell, Sandy Bridge), arm_checks() for ARMv8 pass and all failure modes, and spec builder smoke tests including the structural invariant that v2 ⊆ v3 ⊆ v4 in the GCC spec. No /proc/cpuinfo or uname dependency.
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.
Claude was used to document and improve the pilot code in this version. Copilot was used for code review.