Skip to content

Conversation

@quic-calvnguy
Copy link
Contributor

Description

  • Remove PerThreadContext (Only used for id management)
  • Create ManagedHtpPowerConfigId to manage destruction of id
  • Only create one htp power config id per session (previously was one per thread)

Motivation and Context

One session can potentially be used on multiple threads for execution, and there is a set max number of htp power config ids that can be used at any given time. If enough sessions and enough threads are created, then the maximum number of power config ids can be reached easily (see ticket).

Additionally, all power configurations are available on a per-session basis. Therefore, there is no reason to have more than one power config id per session.

Removal of PerThreadContext is due to the fact that it was only used to contain and destroy the power config ids on thread termination. As such, there is no more need for PerThreadContext.

quic_calvnguy and others added 2 commits December 2, 2025 18:02
 - Remove PerThreadContext (Only used for id management)
 - Create ManagedHtpPowerConfigId to manage destruction of id
 - Only create one htp power config id per session
 - Maintain mapping of thread ids and their respective thread-based
   power config settings
 - Avoids race condition in multi-threading situations
@quic-calvnguy quic-calvnguy force-pushed the dev/calvnguy/htp_power_config_id_fix branch from e2ffecb to 258e8b9 Compare December 3, 2025 02:04
@quic-calvnguy quic-calvnguy force-pushed the dev/calvnguy/htp_power_config_id_fix branch from d7df0ca to 349e10f Compare December 6, 2025 02:52
edgchen1
edgchen1 previously approved these changes Dec 8, 2025
@quic-tirupath
Copy link
Contributor

@edgchen1
Calvin updated the PR with addressing the comments posted on previous version. Could you please help to review, approve and trigger CI job?

@edgchen1
Copy link
Contributor

edgchen1 commented Dec 8, 2025

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@edgchen1 edgchen1 enabled auto-merge (squash) December 8, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants