Skip to content

[mkldnn][2/N] Use oneDNN types directly instead of ideep aliases - #201053

Closed
frost-intel wants to merge 2 commits into
pytorch:mainfrom
frost-intel:ideep-removal/02-dnnl-type-aliases
Closed

frost-intel wants to merge 2 commits into
pytorch:mainfrom
frost-intel:ideep-removal/02-dnnl-type-aliases

Conversation

@frost-intel

@frost-intel frost-intel commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Linked issue or supporting maintainer

Part of #154444

BC-breaking?

No

Summary (human written only)

See #154444 for ideep removal discussion.
Replace ideep type aliases with the oneDNN or std types they name. Each is a plain using in ideep, so this is a pure spelling change with no effect on generated code. It removes about a third of the remaining ideep references from ATen CPU code.

Fake Stack

Agent details (if applicable)

Developed with assistance from Claude Opus 5.5
Summary:

Replace ideep type aliases with the oneDNN (or std) types they name:
data_type, dims, format_tag/tag, prop_kind, algorithm, scale_t,
zero_point_t and exec_args. Each is a plain using in ideep, so this is
a pure spelling change with no effect on generated code. It removes
about a third of the remaining ideep references from ATen CPU code
without touching any ideep-specific behavior.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @aditew01

@pytorch-bot

pytorch-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:

This PR replaces ideep type aliases with the oneDNN/std types they name across
ATen mkldnn, quantized CPU and the JIT mkldnn pass. Every swap appears to be to
an identical type; the only problems are stale comments next to the edited
lines. Recommendation: Approve.

Findings (3):

[minor] aten/src/ATen/native/mkldnn/TensorFactories.cpp:21
The comment above this line says "NOTE: int32_t dims from ideep::tensor but
sizes needs int64_t / TODO: support int64_t dims in ideep::tensor to avoid extra
conversion". `dnnl::memory::dims` has been `std::vector<int64_t>` since oneDNN
1.x, so this is a plain copy with no conversion. The comment was already stale
before this PR, and now that the type is spelled out it plainly contradicts the
next line. Delete both comment lines as part of this cleanup.

[minor] aten/src/ATen/native/quantized/cpu/qconv.cpp:1285
The rewritten comment says the scale is "stored in
std::vector<float>(scale_size, inv_output_scale)", but `scale_size` exists
nowhere in the file; the code passes `std::vector<float>(1, inv_output_scale)`.
Since the PR edits this line anyway, make it match the code, e.g. "stored in the
dst scales passed below and dst_zero_points".

[minor] aten/src/ATen/native/quantized/cpu/qconv.cpp:1869
The rewritten comment says "stored in std::vector<float>(scale_size,
output_scale)", but `scale_size` exists nowhere in the file and the code passes
`std::vector<float>(1, 1.0f / output_scale)`, so the comment also says
`output_scale` where the code uses `1.0f / output_scale`. Since the PR edits
this line anyway, make it match the code, e.g. "stored in the dst scales passed
below (1/output_scale) and dst_zero_points".

Reviewed commit: 8db001b (NOT the current head c969a87)

Review run

🐛 Report a bad review

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201053

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit c969a87 with merge base 780bf8e (image):

NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following job failed, but the AI CI Advisor judged the failure not to be evidence against this change:

  • pull / linux-jammy-py3.11-gcc11 / test (editable, 1, 1, mt-l-x86iavx512-8-64) (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    Could not load credentials from any providers

    AI verdict: AI verdict: infra issue

    The job died at the aws-actions/configure-aws-credentials step ("Could not load credentials from any providers") before any test ran. The suspect commit only edits C++ comments in two mkldnn/quantized source files, so it could not have caused an AWS credential failure on the runner.

    Full reasoning on HUD →

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added module: cpu CPU specific problem (e.g., perf, algorithm) release notes: quantization release notes category labels Oct 15, 2026
@frost-intel frost-intel changed the title [onednn][2/N] Use oneDNN types directly instead of ideep aliases [mkldnn][2/N] Use oneDNN types directly instead of ideep aliases Oct 15, 2026
@frost-intel
frost-intel marked this pull request as ready for review October 15, 2026 23:38
@github-actions github-actions Bot added bot-triaged This is a label only to be used by the auto triage bot triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Oct 15, 2026
@frost-intel
frost-intel marked this pull request as draft October 23, 2026 20:53
@frost-intel
frost-intel force-pushed the ideep-removal/02-dnnl-type-aliases branch from 032b176 to 8db001b Compare October 29, 2026 16:04
@frost-intel
frost-intel marked this pull request as ready for review October 29, 2026 18:41
@pytorch-bot pytorch-bot Bot added the in progress PR is being worked on by the author, until the automated review accepts it label Nov 5, 2026

@github-actions github-actions Bot 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.

Automated review of 8db001b: nothing blocking; ready for human review.

This PR replaces ideep type aliases with the oneDNN/std types they name across ATen mkldnn, quantized CPU and the JIT mkldnn pass. Every swap appears to be to an identical type; the only problems are stale comments next to the edited lines. Recommendation: Approve.

⚪ 3 non-blocking findings

dnnl::memory::dims dst_dims (sizes.begin(), sizes.end());

The comment above this line says "NOTE: int32_t dims from ideep::tensor but sizes needs int64_t / TODO: support int64_t dims in ideep::tensor to avoid extra conversion". dnnl::memory::dims has been std::vector&lt;int64_t&gt; since oneDNN 1.x, so this is a plain copy with no conversion. The comment was already stale before this PR, and now that the type is spelled out it plainly contradicts the next line. Delete both comment lines as part of this cleanup.


// The true scale and zero point is stored in std::vector<float>(scale_size, inv_output_scale) and dst_zero_points.

The rewritten comment says the scale is "stored in std::vector<float>(scale_size, inv_output_scale)", but scale_size exists nowhere in the file; the code passes std::vector&lt;float&gt;(1, inv_output_scale). Since the PR edits this line anyway, make it match the code, e.g. "stored in the dst scales passed below and dst_zero_points".


// The true scale and zero point is stored in std::vector<float>(scale_size, output_scale) and dst_zero_points.

The rewritten comment says "stored in std::vector<float>(scale_size, output_scale)", but scale_size exists nowhere in the file and the code passes std::vector&lt;float&gt;(1, 1.0f / output_scale), so the comment also says output_scale where the code uses 1.0f / output_scale. Since the PR edits this line anyway, make it match the code, e.g. "stored in the dst scales passed below (1/output_scale) and dst_zero_points".

This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review

@pytorch-bot pytorch-bot Bot added ready for review Automated review passed, ready for a final review by a maintainer. and removed in progress PR is being worked on by the author, until the automated review accepts it labels Nov 5, 2026
Part of pytorch#154444.

Replace ideep type aliases with the oneDNN (or std) types they name.
Each is a plain `using` in ideep, so this is a pure spelling change
with no effect on generated code. It removes about a third of the
remaining ideep references from ATen CPU code.
- TensorFactories: drop the int32_t-dims note; dnnl::memory::dims is int64_t.
- qconv: the dst-scale comments named a nonexistent `scale_size`; describe
  what the code actually passes (1/output_scale and dst_zero_points).

@albanD albanD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds good as well.!

@frost-intel frost-intel added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 19, 2026
@frost-intel

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@albanD

albanD commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Validated internally as well

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

Labels

bot-triaged This is a label only to be used by the auto triage bot ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) open source ready for review Automated review passed, ready for a final review by a maintainer. release notes: quantization release notes category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants