Skip to content

Add initial support for powerpc64le initialization.#267

Open
BODAPATIMAHESH wants to merge 7 commits into
pytorch:mainfrom
BODAPATIMAHESH:main_ppc64le
Open

Add initial support for powerpc64le initialization.#267
BODAPATIMAHESH wants to merge 7 commits into
pytorch:mainfrom
BODAPATIMAHESH:main_ppc64le

Conversation

@BODAPATIMAHESH
Copy link
Copy Markdown

@BODAPATIMAHESH BODAPATIMAHESH commented Nov 21, 2024

Added header definitions for PPC64LE.

Implemented support to construct and report processor topology information including processor, core, cluster, package, PVR, and cache levels (L1i, L1d, L2, and L3).

Test:

Built and executed cpu_info on a PPC64LE Linux machine. Confirmed that it accurately reports logical processors, cores, clusters, packages, and cache information.

Ran unit tests and verified that there were no regressions.

Comment thread test/name/power-features.cc Outdated
Comment thread src/linux/processors.c Outdated
@BODAPATIMAHESH
Copy link
Copy Markdown
Author

@malfet could you review the patch again

@BODAPATIMAHESH
Copy link
Copy Markdown
Author

Hi @malfet , Did you get a chance to review this patch?

@BODAPATIMAHESH
Copy link
Copy Markdown
Author

BODAPATIMAHESH commented Jan 19, 2025

@malfet I am waiting for your review.
Thanks.

@BODAPATIMAHESH
Copy link
Copy Markdown
Author

@fbarchard @malfet can you review this.

Copy link
Copy Markdown
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused about use of #if (b & FOOBAR) conditions in the test

Comment thread test/name/power-features.cc Outdated
@BODAPATIMAHESH
Copy link
Copy Markdown
Author

I have updated the code. Please review it @malfet

@BODAPATIMAHESH
Copy link
Copy Markdown
Author

@malfet can you review the latest code.

@seemethere seemethere requested a review from Copilot April 30, 2025 16:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds initial support for powerpc64le initialization including new header definitions, architectural decoding logic, and test coverage for POWER-specific features.

  • Adds new cases to uarch-to-string conversion to support POWER7, POWER8, POWER9, and POWER10.
  • Introduces PPC64-specific processing flows in CPU parsing, cache handling, and initialization.
  • Updates configuration and test infrastructure to integrate PPC64 support.

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/cpu-info.c New POWER architecture cases added in the uarch_to_string function.
test/name/power-features.cc Added tests for POWER-specific features based on auxiliary vector flags.
test/init.cc Conditionals to disable cache consistency tests for PPC64 are added.
src/powerpc/uarch.c, linux/ppc64-isa.c, linux/ppc64-hw.c New implementations for decoding vendor, ISA, and hardware capabilities on PPC64.
src/powerpc/linux/cpuinfo.c CPU parsing updated to support POWER processor architectures with proper logging.
src/powerpc/cache.c New implementation for decoding cache information for PPC processors.
src/linux/processors.c & src/linux/api.h Added functions to get processor online status on Linux.
src/init.c, internal-api.h, src/api.c Updated PPC64 branches added to initialization and global data.
include/cpuinfo.h Added PPC-specific fields and inline feature functions.
configure.py Configures PPC64-specific source files and tests for build targets.
Files not reviewed (1)
  • CMakeLists.txt: Language not supported

Comment thread include/cpuinfo.h Outdated
Comment thread src/powerpc/linux/cpuinfo.c
Comment thread src/powerpc/linux/cpuinfo.c Outdated
Comment thread src/powerpc/linux/init.c Outdated
Comment thread src/powerpc/linux/init.c Outdated
Comment thread src/powerpc/linux/init.c Outdated
Comment thread src/powerpc/linux/cpuinfo.c
Comment thread tools/cpu-info.c
Comment thread test/name/power-features.cc Outdated
Copy link
Copy Markdown
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove cpuinfo_linux_get_processor_online_status and then it looks like a reasonable structured PR

Comment thread src/linux/api.h Outdated
@BODAPATIMAHESH
Copy link
Copy Markdown
Author

I have addressed all the review comments. Please go through the latest changes.

Copy link
Copy Markdown

@anjiltech anjiltech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated changes looks fine. Will let @malfet suggest next actions/approval.

@BODAPATIMAHESH
Copy link
Copy Markdown
Author

@malfet could you review the latest changes.

BODAPATIMAHESH and others added 6 commits November 4, 2025 02:34
    * Adds header definitions for PPC64le
    * Adds support to construct the processor, core, cluster, package
      and cache(L1i,L1d,L2 and L3) information reported by the system.

    Test: Build and ran cpu_info on PPC64le linux machine. confirmed
          that it properly reports the logical processors, cores, clusters,
          packages and cache information.
preprocessor code will never be compiled.
The 'disabled' field was declared for configurations other than SMT8
mode, but it is already handled during PowerPC64 Linux system
initialization. This change removes the redundant code.
make test:
    Start 1: init-test
1/3 Test pytorch#1: init-test ........................   Passed    0.02 sec
    Start 2: get-current-test
2/3 Test pytorch#2: get-current-test .................   Passed    0.02 sec
    Start 3: power-features-test
3/3 Test pytorch#3: power-features-test ..............   Passed    0.02 sec

100% tests passed, 0 tests failed out of 3
Fixes incorrect processor linux_ids when running in modes other than
SMT8.
Corrects cache count reporting when SMT is disabled.
Removed the cpuinfo_linux_get_processor_online_status and added it in
the powerpc specific code and optimized the usage of it.
Cleans up the codebase to improve readability and maintainability.
@BODAPATIMAHESH
Copy link
Copy Markdown
Author

@malfet could you re-review the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants