Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows - Only set thread affinity on Server with auto affinity #19318

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

ivberg
Copy link
Contributor

@ivberg ivberg commented Jan 30, 2024

Description

Only set thread affinity on Server with auto affinity. Auto affinity = when API user does specify thread settings or affinity themselves.

Motivation and Context

On client best to let OS scheduler handle. On big (P-Core) / little (E-Core) CPU designs affinity overrides win32 Quality of Service (QoS) and has high power usage. Specifically on background workloads whose process is tagged QoS Utility (Background), this affinity setting overrides the OS scheduler that only wants to schedule on the E-Cores. Thus P-Cores waking up uses more energy than intended on client and users gets less battery life.

Foreground AI workloads would be tagged QoS High and would run the ORT threads on all cores.

… to let OS scheduler handle. On big (P-Core) / little (E-Core) CPU designs affinity overrides win32 Quality of Service (QoS) and has high power usage. Specifically on background workloads whose process is tagged QoS Utility (Background), this affinity setting overrides the OS scheduler that only wants to schedule on the E-Cores. Thus P-Cores waking up uses more energy than intended on client and users gets less battery life. Foreground AI workloads would be tagged QoS High and would run the ORT threads on all cores.
@ivberg
Copy link
Contributor Author

ivberg commented Jan 30, 2024

/azp run Linux CPU CI Pipeline,Linux CPU Minimal Build E2E CI Pipeline,Linux GPU CI Pipeline,Linux GPU TensorRT CI Pipeline,Linux OpenVINO CI Pipeline,Linux QNN CI Pipeline,MacOS CI Pipeline,Windows ARM64 QNN CI Pipeline,Windows CPU CI Pipeline

Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@ivberg ivberg changed the title Only set thread affinity on Server with auto affinity Windows - Only set thread affinity on Server with auto affinity Jan 30, 2024
@snnn
Copy link
Member

snnn commented Jan 30, 2024

@pranavsharma , @skottmckay , what do you think?

@snnn snnn merged commit 3454f86 into microsoft:main Jan 30, 2024
87 of 91 checks passed
@sophies927 sophies927 added release:1.17.1 triage:approved Approved for cherrypicks for release labels Feb 5, 2024
YUNQIUGUO pushed a commit that referenced this pull request Feb 8, 2024
### Description
Only set thread affinity on Server with auto affinity. Auto affinity =
when API user does specify thread settings or affinity themselves.

### Motivation and Context
On client best to let OS scheduler handle. On big (P-Core) / little
(E-Core) CPU designs affinity overrides win32 Quality of Service (QoS)
and has high power usage. Specifically on background workloads whose
process is tagged QoS Utility (Background), this affinity setting
overrides the OS scheduler that only wants to schedule on the E-Cores.
Thus P-Cores waking up uses more energy than intended on client and
users gets less battery life.

Foreground AI workloads would be tagged QoS High and would run the ORT
threads on all cores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:1.17.1 triage:approved Approved for cherrypicks for release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants