Skip to content
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

Expose TF_NewOperationLocked, TF_FinishOperationLocked, and ToOperation #48944

Merged
merged 3 commits into from Jul 15, 2021

Conversation

rnett
Copy link
Contributor

@rnett rnett commented May 6, 2021

Expose TF_NewOperationLocked, TF_FinishOperationLocked, and ToOperation to the C API. ToOperation is in c_api_internal.h.

Fixes #48767
Fixes #48815

@google-ml-butler google-ml-butler bot added the size:S CL Change Size: Small label May 6, 2021
@google-cla google-cla bot added the cla: yes label May 6, 2021
@gbaned gbaned self-assigned this May 7, 2021
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation May 7, 2021
@gbaned gbaned added the prtype:bugfix PR to fix a bug label May 7, 2021
@gbaned gbaned requested a review from kkimdev May 7, 2021 04:53
@kkimdev kkimdev requested review from saxenasaurabh and removed request for kkimdev May 7, 2021 06:50
@gbaned gbaned added the awaiting review Pull request awaiting review label May 20, 2021
Copy link
Member

@saxenasaurabh saxenasaurabh left a comment

Choose a reason for hiding this comment

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

Thanks for sending this PR! TF_NewOperationLocked and TF_FinishOperationLocked look okay. I don't understand how ToOperation will be used though.

tensorflow/c/c_api.cc Outdated Show resolved Hide resolved
tensorflow/c/c_api.cc Outdated Show resolved Hide resolved
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jun 22, 2021
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jun 22, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jun 22, 2021
@gbaned gbaned removed the awaiting review Pull request awaiting review label Jun 23, 2021
@rnett
Copy link
Contributor Author

rnett commented Jun 29, 2021

I can't see details for the failing test, can someone check it or force a re-run?

@gbaned gbaned added the kokoro:force-run Tests on submitted change label Jul 6, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jul 6, 2021
@rnett rnett requested a review from saxenasaurabh July 12, 2021 01:19
@rnett
Copy link
Contributor Author

rnett commented Jul 12, 2021

From the log:

ERROR: T:/src/github/tensorflow/tensorflow/python/BUILD:370:27: Linking of rule '//tensorflow/python:_pywrap_toco_api.so' failed (Exit 1120): link.exe failed: error executing command
  cd T:/tmp/bigvaudl/execroot/org_tensorflow
  SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\Windows\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
    SET PWD=/proc/self/cwd
    SET PYTHON_BIN_PATH=C:/Python37/python.exe
    SET PYTHON_LIB_PATH=C:/Python37/lib/site-packages
    SET RUNFILES_MANIFEST_ONLY=1
    SET TEMP=T:\tmp
    SET TF2_BEHAVIOR=1
    SET TMP=T:\tmp
  C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/HostX64/x64/link.exe @bazel-out/x64_windows-opt/bin/tensorflow/python/_pywrap_toco_api.so-2.params
Execution platform: @local_execution_config_platform//:platform
   Creating library bazel-out/x64_windows-opt/bin/tensorflow/python/_pywrap_toco_api.so.if.lib and object bazel-out/x64_windows-opt/bin/tensorflow/python/_pywrap_toco_api.so.if.exp
toco_python_api_wrapper.obj : error LNK2019: unresolved external symbol "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const __cdecl toco::RetrieveCollectedErrors(void)" (?RetrieveCollectedErrors@toco@@YA?BV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) referenced in function "public: class pybind11::list __cdecl <lambda_a6fa55ed908e737f35e4ed64cca3f463>::operator()(void)const " (??R<lambda_a6fa55ed908e737f35e4ed64cca3f463>@@QEBA?AVlist@pybind11@@XZ)
bazel-out\x64_windows-opt\bin\tensorflow\python\_pywrap_toco_api.so : fatal error LNK1120: 1 unresolved externals

Does not seem to be related to my changes.

@copybara-service copybara-service bot merged commit eaf4b9d into tensorflow:master Jul 15, 2021
PR Queue automation moved this from Approved by Reviewer to Merged Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes prtype:bugfix PR to fix a bug ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

Expose a few C API functions to allow custom gradients C API Locking prevents custom gradient definition
5 participants