Update cpuinfo dependency and add cpuinfo_deinitialize() integration#28245
Merged
crvineeth97 merged 5 commits intoJun 25, 2026
Merged
Conversation
edgchen1
reviewed
Apr 27, 2026
Contributor
Author
@microsoft-github-policy-service agree company="Microsoft" |
b478e1c to
c53f5d5
Compare
1f827a7 to
091118f
Compare
…tx_gen build - Downgrade QNN ETW profiling mismatch logs from ERROR to VERBOSE to prevent excessive telemetry events (~1 billion/week across Windows devices) - Add bounds checking in GQA attention to prevent size_t underflow when seqlens_k contains invalid data (fixes github.com/microsoft/issues/27170) - Build ep_weight_sharing_ctx_gen for TensorRT, OpenVINO, and VitisAI in addition to QNN Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump pytorch/cpuinfo to crvineeth97/cpuinfo@df8c6a8 which implements cpuinfo_deinitialize() to properly free heap-allocated globals. This prevents memory leak reports from App Verifier, Valgrind, and sanitizers when ORT is dynamically loaded/unloaded. ORT integration: - Add CPUIDInfo::ShutDown() which calls cpuinfo_deinitialize() - Call ShutdownCpuInfo() from DllMain on DLL_PROCESS_DETACH - In memleak-check builds, also call shutdown during process termination The cpuinfo bump also includes upstream fixes that make three ORT patches redundant (removed): - patch_vcpkg_arm64ec_support.patch (pytorch/cpuinfo#324) - win_arm_fp16_detection_fallback.patch (pytorch/cpuinfo#348) - 0001-Add-implementation-for-cpuinfo_deinitialize.patch The patch_cpuinfo_h_for_arm64ec.patch is retained as it is not yet upstream in cpuinfo. Related: pytorch/cpuinfo#150, pytorch/cpuinfo#387 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
091118f to
6300958
Compare
edgchen1
reviewed
Jun 15, 2026
edgchen1
reviewed
Jun 23, 2026
038f00a to
cae9388
Compare
edgchen1
reviewed
Jun 24, 2026
edgchen1
approved these changes
Jun 24, 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.
Description
Updates the cpuinfo dependency to include the new
cpuinfo_deinitialize()API (pytorch/cpuinfo#387) and integrates it into ORT to free heap-allocated globals during DLL unload, fixing memory leaks reported by App Verifier, Valgrind, AddressSanitizer, and LeakSanitizer.cpuinfo dependency update:
4628dc06onpytorch/cpuinfomain which includes the mergedcpuinfo_deinitialize()functioncmake/deps.txt(SHA1) andcmake/vcpkg-ports/cpuinfo/portfile.cmake(SHA512, HEAD_REF master→main)win_arm_fp16_detection_fallback.patch(merged upstream via Add fallback for ARM Windows fp16 detection. pytorch/cpuinfo#348)patch_vcpkg_arm64ec_support.patch— regenerated for new cpuinfo; still needed (Support ARM64EC vcpkg build pytorch/cpuinfo#324 not yet merged)patch_cpuinfo_h_for_arm64ec.patch— retained, not yet upstreamfix_missing_sysfs_fallback.patch— updated context lines for new cpuinfo codeORT integration for cpuinfo_deinitialize():
Shutdown()method toCPUIDInfothat callscpuinfo_deinitialize()ShutdownCpuInfo()static method with guard against singleton creation during DLL unloadShutdownCpuInfo()intoDllMainDLL_PROCESS_DETACHhandlerInstanceCreatedatomic guard prevents singleton creation during DLL unloadOther fixes:
ep_weight_sharing_ctx_genbuild by gating ononnxruntime_USE_CUDAMotivation and Context
Applications that dynamically load and unload the onnxruntime DLL leave orphaned heap allocations from cpuinfo when the library is unloaded mid-process. These are flagged as memory leaks by App Verifier, Valgrind, AddressSanitizer, and LeakSanitizer.