Skip to content

[BUG FIX] Fix compilation of small UNet crashes with 2026.0 and later on 16GB MTL - #36435

Open
sunxiaoxia2022 wants to merge 8 commits into
openvinotoolkit:masterfrom
sunxiaoxia2022:xiaoxia/fix_OOM_AUTO
Open

[BUG FIX] Fix compilation of small UNet crashes with 2026.0 and later on 16GB MTL#36435
sunxiaoxia2022 wants to merge 8 commits into
openvinotoolkit:masterfrom
sunxiaoxia2022:xiaoxia/fix_OOM_AUTO

Conversation

@sunxiaoxia2022

@sunxiaoxia2022 sunxiaoxia2022 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Details:

Root cause:
This issue only happens with TBB_ADAPTIVE when the CPU partitioner runs in AUTO mode.
In that configuration, the CPU plugin may expose inflated virtual concurrency during oneDNN descriptor creation, while descriptor planning should only see real worker-thread concurrency.
Some oneDNN primitives use the visible concurrency to decide implementation details and scratchpad size.
As a result, descriptors could be built against an inflated thread count, which amplified scratchpad requirements and caused large memory allocations.

Related oneDNN PR: openvinotoolkit/oneDNN#316

Tickets:

@github-actions github-actions Bot added the category: CPU OpenVINO CPU plugin label Jun 17, 2026
@sunxiaoxia2022 sunxiaoxia2022 changed the title [ BUG FIX ] Fix compilation of small UNet crashes with 2026.0 and later on 16GB MTL [BUG FIX] Fix compilation of small UNet crashes with 2026.0 and later on 16GB MTL Jul 3, 2026
@yuxu42
yuxu42 requested a review from liubo-intel July 8, 2026 01:15
@liubo-intel

Copy link
Copy Markdown
Contributor

Hi, @sunxiaoxia2022 : Since this change also modifies oneDNN, could you please create a dedicated oneDNN fork PR to facilitate the review process?

@sunxiaoxia2022

Copy link
Copy Markdown
Contributor Author

Hi, @sunxiaoxia2022 : Since this change also modifies oneDNN, could you please create a dedicated oneDNN fork PR to facilitate the review process?

hi @liubo-intel I created an oneDNN PR: openvinotoolkit/oneDNN#316

Comment thread src/plugins/intel_cpu/src/cpu_parallel.hpp
@sunxiaoxia2022
sunxiaoxia2022 marked this pull request as ready for review July 24, 2026 12:23
@sunxiaoxia2022
sunxiaoxia2022 requested review from a team as code owners July 24, 2026 12:23
@peterchen-intel peterchen-intel added do-not-merge Do not merge this PR and removed do-not-merge Do not merge this PR labels Jul 27, 2026
@maxnick
maxnick requested review from Copilot and liubo-intel July 28, 2026 12:40
@maxnick maxnick added this to the 2026.4 milestone Jul 28, 2026
@maxnick

maxnick commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@liubo-intel , could you please take a look once again?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a CPU plugin crash/OOM during model compilation (oneDNN primitive descriptor creation) when using OV_THREAD_TBB_ADAPTIVE with the TBB partitioner in AUTO mode, by preventing oneDNN scratchpad planning from using inflated “virtual” concurrency.

Changes:

  • Set oneDNN scratchpad concurrency to the real worker-thread count while keeping max concurrency aligned with the (possibly virtual) scheduling concurrency under AUTO.

Comment on lines +48 to +51
// oneDNN uses this value when estimating scratchpad outside an active parallel region.
// Keep it aligned with the real worker pool size: AUTO may raise max_concurrency via
// virtual threads for scheduling, but scratchpad is still needed only for worker threads.
dnnl_threadpool_interop_set_scratchpad_concurrency(get_num_worker_threads());
@liubo-intel

Copy link
Copy Markdown
Contributor

This PR LGTM as a temporary fix for the concrete issue at hand. That said, it might be helpful to leave a TODO or follow-up tracking item for the other scratchpad-related sizing paths that haven't been migrated yet. @maxnick , what's your opinion on this?

@maxnick

maxnick commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR LGTM as a temporary fix for the concrete issue at hand. That said, it might be helpful to leave a TODO or follow-up tracking item for the other scratchpad-related sizing paths that haven't been migrated yet. @maxnick , what's your opinion on this?

I would rather agree with our colleagues from oneDNN. It's better to ask the oneDNN team to fix this issue on their side than modify interfaces in our fork.

@maxnick

maxnick commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Waiting for a proper fix on the oneDNN side.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants