Repository navigation
[INTEL MKL] Enable back MKL auto_mixed_precision - #48286
Merged
copybara-service[bot] merged 2 commits intoApr 6, 2021
Merged
copybara-service[bot] merged 2 commits into
copybara-service[bot] merged 2 commits into
Conversation
penpornk
requested changes
Apr 6, 2021
penpornk
left a comment
Member
There was a problem hiding this comment.
Could you please help fix the MacOS CPU Python3 failures? Thank you!
ImportError: Traceback (most recent call last):
File "/Volumes/BuildData/tmpfs/tmp/bazel/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/lite/python/convert_test.runfiles/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: dlopen(/Volumes/BuildData/tmpfs/tmp/bazel/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/lite/python/convert_test.runfiles/org_tensorflow/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Symbol not found: __ZN10tensorflow12IsMKLEnabledEv
Referenced from: /Volumes/BuildData/tmpfs/tmp/bazel/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/python/../libtensorflow_framework.2.dylib
Expected in: flat namespace
in /Volumes/BuildData/tmpfs/tmp/bazel/execroot/org_tensorflow/bazel-out/darwin-opt/bin/tensorflow/python/../libtensorflow_framework.2.dylib
penpornk
approved these changes
Apr 6, 2021
penpornk
left a comment
Member
There was a problem hiding this comment.
Thank you for the quick fix!
ezhulenev
approved these changes
Apr 6, 2021
Contributor
Author
|
Thank you both for reviewing/approving the PR. This time the |
copybara-service Bot
pushed a commit
that referenced
this pull request
Sep 18, 2026
…te-stride span Imported from GitHub PR openxla/xla#48513 #ai-generated I found this while reviewing the recently landed #46604 byte-stride overflow fix and verified the remaining accumulation wrap against the current XLA tree with an in-tree Bazel regression test. `FromZerothElementPointer` already rejects a `stride * (dim - 1)` product that overflows `int64`. Adding those products into a `uint64_t` without an overflow check still wraps: ```text shape = [2, 2, 2] strides = [INT64_MAX, INT64_MAX, 2] dtype = u8 accepted region size = 1 ``` A second case, `strides = [INT64_MAX, INT64_MAX, 1]`, accumulates to `UINT64_MAX` and only overflows on the final `+ dtype-size` add. This change checks `__builtin_add_overflow` on the running sum and on the final add. Tests: `ByteStrideAccumOverflowUint64`, `ByteStrideFinalSizeOverflowUint64`, plus compact `u8` `[2,2,2]` success cases. Compact-layout `byte_size * shape.num_elements()` is not changed (#48286). ```text bazel test //xla/python/ifrt_proxy/common:array_util_test ``` **PASSED**, 42/42, including `ByteStrideAccumOverflowUint64` and `ByteStrideFinalSizeOverflowUint64`. Copybara import of the project: -- 4116a8f9c0eda07ba8b6d1ffe36ba22bc9541045 by roopd3v <[email protected]>: Fix uint64 accumulation overflow in IFRT ArrayMemRegion byte-stride span. The per-term stride*(dim-1) multiply is already checked. Adding those products into a uint64_t without an overflow check still wraps, so a client-supplied stride vector such as [INT64_MAX, INT64_MAX, 2] with shape [2, 2, 2] is accepted as a 1-byte region. Check the running sum and the final + dtype-size add. Tests cover both the accumulation wrap and the final add (INT64_MAX + INT64_MAX + 1 == UINT64_MAX). Merging this change closes #48513 PiperOrigin-RevId: 983915659
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.
This PR fixes an issue in the auto_mixed_precision_test and enables back MKL auto_mixed_precision in the single binary build.