Support generic / non-x86 CPUs in the lstopo translator - #82
Merged
Conversation
harsh-sikhwal
approved these changes
Aug 31, 2026
ajbalogh
approved these changes
Aug 31, 2026
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.
Support generic / non-x86 CPUs in the lstopo translator
Problem
LstopoParser._parse_cpu_info()raisedValueError("Missing required CPU information in XML.")whenever the lstopo XML lacked aCPUModelorCPUVendorinfo element. hwloc sources both of those from the x86CPUIDinstruction, so they are simply absent on aarch64, POWER, RISC-V and s390x — the translator failed outright on any non-x86 topology. Separately, vendor strings lifted straight out of the XML (PCIDevice,GPUModel) frequently contain/,.,:and,, which thenamepattern inschema/common.yaml(^[\sa-zA-Z0-9-_()><\[\]]+$) rejects, so otherwise-valid topologies failed schema validation.Changes
src/infragraph/translators/lstopo_translator.py_find_info()helper and madeCPUModel/CPUVendoroptional. Both values are descriptive only:cpu_modelis the component description, andcpu_vendoronly selects an inter-socket fabric name on multi-socket systems._describe_generic_cpu()as a fallback description for architectures with no self-describing CPU name. Falls back to firmware-exposed data —Architecture— and finally to"Unknown CPU".Packageobject now treat theMachineelement as a single package, socpu_countis never zero.sanitize_name()which replaces schema-invalid characters with spaces and collapses whitespace. Applied to GPU models and NIC names in_extract_gpu_info(),_extract_nic_info()and the device-name lookup path.102bvendor label ("Matrox card/controller"→"Matrox card controller") so it satisfies the same name pattern.