Skip to content

[mkldnn][25/N] Rename the itensor helpers for MkldnnMemory - #206630

Open
frost-intel wants to merge 3 commits into
gh/frost-intel/23/basefrom
gh/frost-intel/23/head
Open

frost-intel wants to merge 3 commits into
gh/frost-intel/23/basefrom
gh/frost-intel/23/head

Conversation

@frost-intel

@frost-intel frost-intel commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

Linked issue or supporting maintainer

Part of #154444

BC-breaking?

No

Summary (human written only)

Rename all itensor functions to memory_* to eliminate all itensor references in ideep port.

Agent details (if applicable)

Developed with assistance from Claude Opus 5.5.

Part of #154444 (remove the ideep submodule).

Follows the ITensor -> MkldnnMemory rename. The helpers that convert between at::Tensor and MkldnnMemory drop their itensor prefix. This is a mechanical rename with no behavior change:

  • itensor_from_mkldnn -> memory_from_mkldnn
  • itensor_from_tensor -> memory_from_tensor
  • itensor_from_const_tensor -> memory_from_const_tensor
  • itensor_view_from_dense -> memory_view_from_dense
  • itensor_view_from_const_dense -> memory_view_from_const_dense
  • itensor_view_from_dense_impl -> memory_view_from_dense_impl (file-local)
  • new_with_itensor_mkldnn -> new_with_mkldnn_memory
  • typed_itensor_view_from_dense -> typed_mkldnn_memory_view_from_dense (file-local)

These are internal ATen helpers declared in MKLDNNCommon.h, so their exported symbol names change, as with the helpers in 21/N.

Differential Revision: D135688235

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Nov 25, 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 renames the `itensor_*` and `new_with_itensor_mkldnn` helpers in
`MKLDNNCommon.h` to `memory_*` and `new_with_mkldnn_memory` and updates every
call site; the rename is mechanical, complete and preserves behavior.
Recommendation: Approve. The three remaining points are non-blocking cleanups,
and whoever relands it (the PR carries the Reverted label) should confirm the
cause of the revert, likely an internal or out-of-tree caller of the exported
symbols.

Findings (3):

[minor] aten/src/ATen/native/mkldnn/Conv.cpp:127
Leftover `itensor` names (non-blocking). The PR edits the body of `#define
MKLDNNTensor(itensor, options)` but keeps `itensor` as its parameter name,
including `std::move(itensor)` (Conv.cpp:127-129).
`aten/src/ATen/native/mkldnn/Matmul.cpp:537` still says `// Create ITensors for
oneDNN computation`, though the code below it builds a `mkldnn::MkldnnMemory`.
These are the last `itensor` references in the mkldnn code (not counting the
unrelated `ITensorListRef`), which goes against the description's goal to
"eliminate all itensor references". Rename the parameter (for example to
`memory`) and update the comment.

[minor] torch/csrc/jit/passes/frozen_ops_to_mkldnn.cpp:242
Stale comment (non-blocking). Line 242 still says "we cast `a` to an
`ideep::tensor`", directly above the changed line 244 that now calls
`memory_from_mkldnn`. The `ideep::tensor` type no longer exists in-tree; it
survives only in a "Ported from" comment in `detail/Memory.h`. The comment
should say `MkldnnMemory`.

[minor] aten/src/ATen/native/mkldnn/MKLDNNCommon.cpp:136
Inconsistent helper name (non-blocking). The file-local helper is now
`typed_mkldnn_memory_view_from_dense` (:136, :145). Its sibling
`memory_view_from_dense_impl` (:152) and the public `memory_view_from_dense`
(:213) have no `mkldnn_` infix, so `typed_memory_view_from_dense` would match
them.

Reviewed commit: 7b3b7e3 (NOT the current head f243caa)

Review run

🐛 Report a bad review

🔗 Helpful Links

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

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

✅ No Failures

As of commit f243caa with merge base d54e485 (image):
💚 Looks good so far! There are no failures yet. 💚

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

[ghstack-poisoned]
frost-intel added a commit that referenced this pull request Nov 25, 2026
## Linked issue or supporting maintainer
Part of #154444

## BC-breaking?
No

## Summary (human written only)
Rename all itensor functions to `memory_*` to eliminate all itensor references in ideep port.

## Agent details (if applicable)
Developed with assistance from Claude Opus 5.5.

> Part of #154444 (remove the ideep submodule).
>
> Follows the `ITensor` -> `MkldnnMemory` rename. The helpers that convert between `at::Tensor` and `MkldnnMemory` drop their `itensor` prefix. This is a mechanical rename with no behavior change:
> - `itensor_from_mkldnn` -> `memory_from_mkldnn`
> - `itensor_from_tensor` -> `memory_from_tensor`
> - `itensor_from_const_tensor` -> `memory_from_const_tensor`
> - `itensor_view_from_dense` -> `memory_view_from_dense`
> - `itensor_view_from_const_dense` -> `memory_view_from_const_dense`
> - `itensor_view_from_dense_impl` -> `memory_view_from_dense_impl` (file-local)
> - `new_with_itensor_mkldnn` -> `new_with_mkldnn_memory`
> - `typed_itensor_view_from_dense` -> `typed_mkldnn_memory_view_from_dense` (file-local)
>
> These are internal ATen helpers declared in `MKLDNNCommon.h`, so their exported symbol names change, as with the helpers in 21/N.


ghstack-source-id: 49311af
Pull-Request: #206630
@frost-intel frost-intel added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request in progress PR is being worked on by the author, until the automated review accepts it and removed release notes: quantization release notes category labels Nov 25, 2026
github-actions[bot]

This comment was marked as outdated.

@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.

Thx!

@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.

Thx!

@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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@frost-intel your PR has been reverted as part of the stack under #206276.

pytorchmergebot added a commit that referenced this pull request Nov 27, 2026
@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Nov 27, 2026
@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 Nov 27, 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 7b3b7e3: nothing blocking; ready for human review.

This PR renames the itensor_* and new_with_itensor_mkldnn helpers in MKLDNNCommon.h to memory_* and new_with_mkldnn_memory and updates every call site; the rename is mechanical, complete and preserves behavior. Recommendation: Approve. The three remaining points are non-blocking cleanups, and whoever relands it (the PR carries the Reverted label) should confirm the cause of the revert, likely an internal or out-of-tree caller of the exported symbols.

⚪ 3 non-blocking findings are attached to the code below, collapsed.

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

@@ -125,7 +125,7 @@ static void check_shape_forward(const Tensor& input,
}

#define MKLDNNTensor(itensor, options) \

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.

⚪ Leftover itensor names (non-blocking).

The PR edits the body of #define MKLDNNTensor(itensor, options) but keeps itensor as its parameter name, including std::move(itensor) (Conv.cpp:127-129). aten/src/ATen/native/mkldnn/Matmul.cpp:537 still says // Create ITensors for oneDNN computation, though the code below it builds a mkldnn::MkldnnMemory. These are the last itensor references in the mkldnn code (not counting the unrelated ITensorListRef), which goes against the description's goal to "eliminate all itensor references". Rename the parameter (for example to memory) and update the comment.

Report this finding

@@ -241,7 +241,7 @@ Operation createUnaryOp(
c10::impl::ExcludeDispatchKeyGuard edkg(c10::autograd_dispatch_keyset);
// we cast `a` to an `ideep::tensor`, so we can get at its descriptor

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.

⚪ Stale comment (non-blocking).

Line 242 still says "we cast a to an ideep::tensor", directly above the changed line 244 that now calls memory_from_mkldnn. The ideep::tensor type no longer exists in-tree; it survives only in a "Ported from" comment in detail/Memory.h. The comment should say MkldnnMemory.

Report this finding


template <typename T>
mkldnn::MkldnnMemory typed_itensor_view_from_dense(
mkldnn::MkldnnMemory typed_mkldnn_memory_view_from_dense(

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.

⚪ Inconsistent helper name (non-blocking).

The file-local helper is now typed_mkldnn_memory_view_from_dense (:136, :145). Its sibling memory_view_from_dense_impl (:152) and the public memory_view_from_dense (:213) have no mkldnn_ infix, so typed_memory_view_from_dense would match them.

Report this finding

@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 27, 2026
[ghstack-poisoned]
soulitzer pushed a commit that referenced this pull request Dec 2, 2026
## Linked issue or supporting maintainer
Part of #154444

## BC-breaking?
No

## Summary (human written only)
Rename all itensor functions to `memory_*` to eliminate all itensor references in ideep port.

## Agent details (if applicable)
Developed with assistance from Claude Opus 5.5.

> Part of #154444 (remove the ideep submodule).
>
> Follows the `ITensor` -> `MkldnnMemory` rename. The helpers that convert between `at::Tensor` and `MkldnnMemory` drop their `itensor` prefix. This is a mechanical rename with no behavior change:
> - `itensor_from_mkldnn` -> `memory_from_mkldnn`
> - `itensor_from_tensor` -> `memory_from_tensor`
> - `itensor_from_const_tensor` -> `memory_from_const_tensor`
> - `itensor_view_from_dense` -> `memory_view_from_dense`
> - `itensor_view_from_const_dense` -> `memory_view_from_const_dense`
> - `itensor_view_from_dense_impl` -> `memory_view_from_dense_impl` (file-local)
> - `new_with_itensor_mkldnn` -> `new_with_mkldnn_memory`
> - `typed_itensor_view_from_dense` -> `typed_mkldnn_memory_view_from_dense` (file-local)
>
> These are internal ATen helpers declared in `MKLDNNCommon.h`, so their exported symbol names change, as with the helpers in 21/N.


ghstack-source-id: 85bdaf9
Pull-Request: #206630
@soulitzer

Copy link
Copy Markdown
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@pytorch-bot pytorch-bot Bot added the release notes: quantization release notes category label Dec 2, 2026

This branch was previously deployed

1 inactive (outdated) deployment
bedrock — 7b3b7e37 Deployed Nov 27, 2026 by pytorchmergebot via analyze #43225
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 ci-no-td Do not run TD on this PR 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 Reverted topic: not user facing topic 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