Skip to content

[MSVC]Tensorflow failed to error C2678: binary '==': no operator found which takes a left-hand operand of type 'const _Ty' #60062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Eva-An opened this issue Mar 22, 2023 · 6 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:cpu-intel To track windows cpu issues subtype:windows Windows Build/Installation Issues type:build/install Build and install issues

Comments

@Eva-An
Copy link

Eva-An commented Mar 22, 2023

Click to expand!

Issue Type

Bug

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

master branch, commit: 48246a6

Custom Code

No

OS Platform and Distribution

Windows Server 2022

Mobile device

No response

Python version

3.9

Bazel version

5.3.0

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

Current:
ERROR: F:/gitp/tensorflow/tensorflow/tensorflow/compiler/xla/pjrt/BUILD:598:11: Compiling tensorflow/compiler/xla/pjrt/transpose.cc failed: (Exit 2): cl.exe failed: error executing command 
  cd /d F:/bazeltemp/2powapgf/execroot/org_tensorflow
  SET INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um
    SET PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\CodeCoverage.Console;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\;;C:\Windows\system32;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
    SET PWD=/proc/self/cwd
    SET PYTHON_BIN_PATH=C:/Python39/python.exe
    SET PYTHON_LIB_PATH=C:/Python39/lib/site-packages
    SET RUNFILES_MANIFEST_ONLY=1
    SET TEMP=C:\Users\CPPTES~1\AppData\Local\Temp
    SET TF2_BEHAVIOR=1
    SET TMP=C:\Users\CPPTES~1\AppData\Local\Temp
  C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\HostX64\x64\cl.exe @bazel-out/x64_windows-opt/bin/tensorflow/compiler/xla/pjrt/_objs/transpose/transpose.obj.params
# Configuration: 6c527fa88d503266dc3c2010527883ab34835d92feca5051a6b7c0c26b585cd5
# Execution platform: @local_execution_config_platform//:platform
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\include\xstddef(106): error C2678: binary '==': no operator found which takes a left-hand operand of type 'const _Ty' (or there is no acceptable conversion)
        with
        [
            _Ty=xla::TransposePlanCacheKey
        ]

Expect:
Build pass.

Standalone code to reproduce the issue

git clone https://github.com/tensorflow/tensorflow.git F:\gitP\tensorflow\tensorflow
cd F:\gitP\tensorflow\tensorflow
pip3 install -r tensorflow/tools/ci_build/release/requirements_common.txt 2>&1
set PATH=F:\gitP\tensorflow\tensorflow\..\tools;%path%
set PATH=F:\gitP\tensorflow\tensorflow\..\tools\msys64\usr\bin;%path%
yes "" 2>nul | python ./configure.py 2>&1
set BAZEL_VC=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC
set BAZEL_VC_FULL_VERSION=14.35.32215
set PATH=F:\gitP\tensorflow\tensorflow\..\tools;%path%
set PATH=F:\gitP\tensorflow\tensorflow\..\tools\msys64\usr\bin;%path%
bazel --output_user_root F:\bazelTemp build --jobs 8 --config=opt --local_ram_resources=2048 --subcommands //tensorflow/tools/pip_package:build_pip_package 2>&1

Relevant log output

build.zip
transpose.zip
Or you can follow below steps to reproduce the issue with .i file
Repro Steps:

1.Download transpose.zip and unzip it
2.Open VS2022 x64 Native Tools command.
3.cl.exe transpose.i /TP /c /EHsc /std:c++17

@google-ml-butler google-ml-butler bot added type:bug Bug type:performance Performance Issue labels Mar 22, 2023
@tilakrayal tilakrayal added type:build/install Build and install issues subtype:windows Windows Build/Installation Issues subtype:cpu-intel To track windows cpu issues and removed type:bug Bug type:performance Performance Issue labels Mar 23, 2023
@mraunak
Copy link
Contributor

mraunak commented Mar 27, 2023

Hi @Eva-An, please try MSVC 2019 (set BAZEL_VC=C:\Program Files(x86)\Microsoft Visual Studio\2019\Enterprise\VC).

@Venkat6871
Copy link
Contributor

Hi,

Thank you for opening this issue. Since this issue has been open for a long time, the code/debug information for this issue may not be relevant with the current state of the code base.

The Tensorflow team is constantly improving the framework by fixing bugs and adding new features. We suggest you try the latest TensorFlow version with the latest compatible hardware configuration which could potentially resolve the issue. If you are still facing the issue, please create a new GitHub issue with your latest findings, with all the debugging information which could help us investigate.

Please follow the release notes to stay up to date with the latest developments which are happening in the Tensorflow space.

@Venkat6871 Venkat6871 added stat:awaiting response Status - Awaiting response from author and removed stat:awaiting tensorflower Status - Awaiting response from tensorflower labels Feb 6, 2025
@Venkat6871 Venkat6871 self-assigned this Feb 6, 2025
@spacelg
Copy link

spacelg commented Feb 6, 2025

Hi @Venkat6871 ,

Thank you for your reply and info. After using the newer commit of tensorflow in our test, this issue no longer exists. I think this ticket can be closed.

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Status - Awaiting response from author label Feb 6, 2025
@Venkat6871 Venkat6871 added the stat:awaiting response Status - Awaiting response from author label Feb 7, 2025
Copy link

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Feb 15, 2025
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further.

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:cpu-intel To track windows cpu issues subtype:windows Windows Build/Installation Issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

8 participants