Repository navigation
[mkldnn][22/N] Remove the ideep submodule - #206277
frost-intel wants to merge 5 commits into
Conversation
[ghstack-poisoned]
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:
Findings (7): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/206277
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Cancelled JobAs of commit cac285b with merge base d54e485 ( CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
|
Starting merge as part of PR stack under #206630 |
## Linked issue or supporting maintainer Part of #154444 ## BC-breaking? No ## Summary (human written only) Replaces any references to ideep in comments with mkldnn references reflecting the current code. ## Agent details (if applicable) Developed with assistance from Claude Opus 5.5. > Part of #154444 (remove the ideep submodule). > > Comment-only. After ideep is removed, comments in `aten/src/ATen/native/mkldnn/` and `aten/src/ATen/native/quantized/cpu/` still describe ideep doing the work. They now name what does it: `MkldnnMemory` for ideep tensors, `matmul_forward` / `mkldnn::inner_product_forward` for ideep operators, the oneDNN wrappers for "ideep (mkldnn bridge)", and oneDNN where the comment means the library. > > Left as-is on purpose: "Ported from ideep" provenance notes, ideep comments that were ported with the code in `detail/`, and identifiers that still say ideep (`DeviceType::IDEEP`, `IDeepRegistration.cpp`, `make_ideep_tensor`). > > What changed: 10 files, +33/−33, all comment lines. Pull Request resolved: #206278 Approved by: https://github.com/albanD ghstack dependencies: #205978, #205979, #205980, #206276, #206277
…n Attr (#206279) ## Linked issue or supporting maintainer Part of #154444 ## BC-breaking? No ## Summary (human written only) Changing `inner_product_forward_expected_weights_desc` to take an `Attr` parameter as its last argument, allowing the packed weight layout to depend on primitive attributes. This was requested by @mriganks-amd for upcoming ZenDNN fp16 accumulation support. ## Agent details (if applicable) Developed with assistance from Claude Opus 5.5. > Part of #154444. Requested by AMD for ZenDNN fp16 accumulation (#204794). > > `inner_product_forward_expected_weights_desc` now takes `const Attr& attr = Attr()` as its last parameter and passes it to the `dnnl::inner_product_forward::primitive_desc`, as `matmul_forward_expected_weights_desc` already does. The packed weight layout can depend on primitive attributes. For example, with ZenDNN's fp16 "any" accumulation mode, a weight packed with default attributes runs on brgemm even with the mode set. Callers can now pack with the attributes they compute with. > > No behavior change: the only caller, `mkldnn_reorder_linear_weight` in `MKLDNNConversions.cpp`, does not pass `attr`, and a default `Attr` is an empty `dnnl::primitive_attr`, which is what oneDNN uses when no attributes are given. This is an API addition on top of the port; ideep's version takes no attributes. > > Testing: compiles with `-Wall -Wextra -Wsign-compare -Werror` in release and debug builds; `test_mkldnn`, the mkldnn conv tests and the quantized conv/linear tests pass at the tip. Pull Request resolved: #206279 Approved by: https://github.com/albanD ghstack dependencies: #205978, #205979, #205980, #206276, #206277, #206278
## 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. Pull Request resolved: #206630 Approved by: https://github.com/albanD ghstack dependencies: #205978, #205979, #205980, #206276, #206277, #206278, #206279
This reverts commit 7dad426. Reverted #206277 on behalf of https://github.com/izaitsevfb due to Breaks Meta-internal tests that OSS CI does not run ([comment](#206276 (comment)))
|
@frost-intel your PR has been reverted as part of the stack under #206276. |
There was a problem hiding this comment.
Automated review of a987e9d: nothing blocking; ready for human review.
The PR removes the third_party/ideep submodule, adds third_party/oneDNN directly at the same commit, and moves the version gates, build, license and ownership files from ideep to oneDNN. The review recommends Approve. Every point it raises is non-blocking.
⚪ 7 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
|
|
||
| #if IDEEP_PREREQ(3, 1, 0, 0) | ||
| #if DNNL_PREREQ(3, 1, 0) | ||
| // Use oneDNN's APIs instead of prepare/compute from ideep to reduce integration overhead. |
There was a problem hiding this comment.
⚪ Leftover ideep references (non-blocking).
The description says leftover mentions were updated, but files this PR edits still have them: MKLDNNCommon.h:31-53 (doc comments on TORCH_API functions still describe ideep::tensor), MKLDNNCommon.cpp:97-98 and 233-237, MKLDNNConversions.cpp:52, qlinear.cpp:839, mkldnn/Utils.h:135, frozen_ops_to_mkldnn.cpp:242 and 1005, and qconv.cpp:1551-1552 and 1766-1767. The last one sits directly under the rewritten #if DNNL_PREREQ(3, 1, 0) and still says "instead of prepare/compute from ideep". Some identifiers also keep the old name: IDeepTensorWrapper, deserialized_ideep_desc, ideep_lowp_kind, accum_ideep_*. The "Ported from ideep::" comments under detail/ are intentional and are not part of this point.
| #if defined(DNNL_VERSION_MAJOR) && DNNL_VERSION_MAJOR>=3 | ||
| return w.get_desc().is_opaque() || w.get_desc().is_plain(); | ||
| # else | ||
| return w.get_desc().is_rnn_packed() || w.get_desc().is_plain(); |
There was a problem hiding this comment.
⚪ Dead #else branch (non-blocking).
The #else of #if defined(DNNL_VERSION_MAJOR) && DNNL_VERSION_MAJOR>=3 calls w.get_desc().is_rnn_packed(). MkldnnMemory::desc (detail/Memory.h:97) has only is_plain and is_opaque, so this branch is dead and would not compile if selected. The PR already removes other unreachable branches (the revision-0 qconv paths). For consistency, replace this block with the plain is_opaque() || is_plain() return.
| (DNNL_VERSION_PATCH << 0)) >= \ | ||
| ((major << 16) + (minor << 8) + (patch << 0))) | ||
| #else | ||
| #define DNNL_PREREQ(major, minor, patch) 0 |
There was a problem hiding this comment.
⚪ Unreachable fallback in Version.h (non-blocking).
This keeps #define DNNL_PREREQ(major, minor, patch) 0. The header includes <oneapi/dnnl/dnnl_version.h> itself, so the fallback can't be reached. If it ever were, every gate would quietly evaluate false: the CPUBlas ukernel and FP8 paths would turn off, and qconv would fail only at runtime with "Unexpected oneDNN version". An #error would catch that at compile time. The block was moved verbatim from MKLDNNCommon.h, but it now lives in a dedicated version header.
| @@ -537,11 +537,8 @@ | |||
|
|
|||
| - name: IDEEP | |||
There was a problem hiding this comment.
⚪ Merge rule name (non-blocking).
The rule is still named IDEEP, although its patterns now cover third_party/oneDNN.
|
|
||
| IF(NOT IDEEP_INCLUDE_DIR OR NOT MKLDNN_INCLUDE_DIR) | ||
| IF(NOT MKLDNN_INCLUDE_DIR) | ||
| MESSAGE(STATUS "MKLDNN source files not found!") |
There was a problem hiding this comment.
⚪ Submodule-init description is inaccurate (non-blocking).
The description says cmake/PreBuildSteps.cmake "already initializes every .gitmodules path". It doesn't: it runs git submodule update --init --recursive only when every submodule directory is empty (PreBuildSteps.cmake:33-48). Otherwise it stops with FATAL_ERROR "Submodule ... appears incomplete" (:73-78), so an existing checkout that pulls this commit stops there until the developer runs git submodule update --init. The removed fallback here wouldn't have helped, since it only initialized ideep's nested mkl-dnn. With USE_SYSTEM_LIBS=ON, PreBuildSteps skips that check. FindMKLDNN then prints "MKLDNN source files not found!", and Dependencies.cmake:1631-1633 only warns before turning USE_MKLDNN off, so the build goes on without oneDNN. Fix: correct the description and tell developers to re-run the submodule update. Optionally, fail with FATAL_ERROR in FindMKLDNN.cmake when third_party/oneDNN is empty and MKLDNN was requested.
| # like the .gitignore entry, so it does not touch tracked build/ dirs deeper | ||
| # in vendored trees (e.g. cutlass docs, ideep). | ||
| # in vendored trees (e.g. cutlass docs). | ||
| "!third_party/build/**", |
There was a problem hiding this comment.
⚪ Stale ideep tree can end up in an sdist (non-blocking).
The sdist include "third_party/**" (pyproject.toml:120) wins over gitignore and the exclude list, and the stale untracked third_party/ideep tree is not gitignored. An sdist built from an updated old checkout would therefore pack that whole tree, including its nested oneDNN copy. Per the mechanics comment at pyproject.toml:98-103, a !-negation inside include only withdraws include protection. So the fix needs both an "!third_party/ideep/**" line in include and a "third_party/ideep/**" line in exclude, the same pattern used for flatbuffers/java. Alternatively, mention this in the cleanup note.
| @@ -1022,23 +1021,6 @@ def test_batch_norm_3d(self): | |||
| x = torch.randn(N, C, 30, 30, 30, dtype=torch.float32) * 10 | |||
| self._test_batch_norm_base(dim=3, channels=C, input=x) | |||
|
|
|||
There was a problem hiding this comment.
⚪ Non-blocking: Deleted test_mkldnn_layer_norm (non-blocking, but recommended).
This deletes the only test that runs prim::MKLDNNLayerNorm. That op is registered at frozen_ops_to_mkldnn.cpp:479-486 and calls the layer-norm code ported from ideep (Normalization.cpp:92). The path still ships: torch.jit.optimize_for_inference reaches it through ConvertFrozenOpsToMKLDNN (_freeze.py:201 module.cpp:487-489). Nothing else under test/ mentions MKLDNNLayerNorm or _jit_pass_convert_frozen_ops_to_mkldnn. The description gives a reason for the removal, so this meets test/REVIEW.md Rule 6. Still, the test has no ideep dependency, and "TorchScript is being deleted" describes something that hasn't happened yet. Keep the test until the PR that removes the frozen-ops-to-MKLDNN pass.
|
@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Stack from ghstack (oldest at bottom):
Linked issue or supporting maintainer
Part of #154444
BC-breaking?
No
Summary (human written only)
Removes the ideep submodule, including
#includestatements, references in comments, build setup, and related files.Agent details (if applicable)
Developed with assistance from Claude Opus 5.5.
Differential Revision: D135688231