Skip to content

Commit

Permalink
Add missing libkineto_defs.bzl for LoggerObserver Implementation (#529)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #529

The bazel definition file was not updated when the Logger Observer Implementation was committed. This causes link time failures due to missing definitions for CPU library in PyTorch.

Test Plan:
Fixes a failure in PyTorch builds:
```
[7/60] Building CXX object third_party/kineto/libkineto/CMakeFiles/kineto_base.dir/src/Logger.cpp.o
/scratch/aaronshi/pytorch/third_party/kineto/libkineto/src/Logger.cpp:28:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wglobal-constructors"
                                ^~~~~~~~~~~~~~~~~~~~~~~
[33/60] Linking CXX executable bin/ProcessGroupMPITest
FAILED: bin/ProcessGroupMPITest
: && /data/shared/bin/c++ -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic -Wl,-rpath -Wl,/opt/amazon/openmpi/lib -Wl,--enable-new-dtags -pthread test_cpp_c10d/CMakeFiles/ProcessGroupMPITest.dir/ProcessGroupMPITest.cpp.o -o bin/ProcessGroupMPITest  -Wl,-rpath,/scratch/aaronshi/pytorch/build/lib:/opt/amazon/openmpi/lib:/fsx/users/aaronshi/conda/envs/pytorch37/lib:  lib/libtorch_cpu.so  /opt/amazon/openmpi/lib/libmpi.so  -lpthread  lib/libprotobuf.a  lib/libc10.so  -pthread  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_intel_lp64.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_gnu_thread.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_core.so  -fopenmp  -lpthread  -lm  /usr/lib/x86_64-linux-gnu/libdl.so && :
lib/libtorch_cpu.so: undefined reference to `libkineto::toString(libkineto::LoggerOutputType)'
collect2: error: ld returned 1 exit status
[34/60] Linking CXX executable bin/HashStoreTest
FAILED: bin/HashStoreTest
: && /data/shared/bin/c++ -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic -Wl,-rpath -Wl,/opt/amazon/openmpi/lib -Wl,--enable-new-dtags -pthread test_cpp_c10d/CMakeFiles/HashStoreTest.dir/HashStoreTest.cpp.o -o bin/HashStoreTest  -Wl,-rpath,/scratch/aaronshi/pytorch/build/lib:/fsx/users/aaronshi/conda/envs/pytorch37/lib:  lib/libtorch_cpu.so  lib/libgtest_main.a  -lpthread  lib/libprotobuf.a  lib/libc10.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_intel_lp64.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_gnu_thread.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_core.so  -fopenmp  -lpthread  -lm  /usr/lib/x86_64-linux-gnu/libdl.so  lib/libgtest.a  -pthread && :
lib/libtorch_cpu.so: undefined reference to `libkineto::toString(libkineto::LoggerOutputType)'
collect2: error: ld returned 1 exit status
[35/60] Linking CXX executable bin/TCPStoreTest
FAILED: bin/TCPStoreTest
: && /data/shared/bin/c++ -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic -Wl,-rpath -Wl,/opt/amazon/openmpi/lib -Wl,--enable-new-dtags -pthread test_cpp_c10d/CMakeFiles/TCPStoreTest.dir/TCPStoreTest.cpp.o -o bin/TCPStoreTest  -Wl,-rpath,/scratch/aaronshi/pytorch/build/lib:/fsx/users/aaronshi/conda/envs/pytorch37/lib:  lib/libtorch_cpu.so  lib/libgtest_main.a  -lpthread  lib/libprotobuf.a  lib/libc10.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_intel_lp64.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_gnu_thread.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_core.so  -fopenmp  -lpthread  -lm  /usr/lib/x86_64-linux-gnu/libdl.so  lib/libgtest.a  -pthread && :
lib/libtorch_cpu.so: undefined reference to `libkineto::toString(libkineto::LoggerOutputType)'
collect2: error: ld returned 1 exit status
[36/60] Linking CXX executable bin/FileStoreTest
FAILED: bin/FileStoreTest
: && /data/shared/bin/c++ -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -O3 -DNDEBUG -DNDEBUG -rdynamic -Wl,-rpath -Wl,/opt/amazon/openmpi/lib -Wl,--enable-new-dtags -pthread test_cpp_c10d/CMakeFiles/FileStoreTest.dir/FileStoreTest.cpp.o -o bin/FileStoreTest  -Wl,-rpath,/scratch/aaronshi/pytorch/build/lib:/fsx/users/aaronshi/conda/envs/pytorch37/lib:  lib/libtorch_cpu.so  lib/libgtest_main.a  -lpthread  lib/libprotobuf.a  lib/libc10.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_intel_lp64.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_gnu_thread.so  /fsx/users/aaronshi/conda/envs/pytorch37/lib/libmkl_core.so  -fopenmp  -lpthread  -lm  /usr/lib/x86_64-linux-gnu/libdl.so  lib/libgtest.a  -pthread && :
lib/libtorch_cpu.so: undefined reference to `libkineto::toString(libkineto::LoggerOutputType)'
collect2: error: ld returned 1 exit status
[37/60] Linking CXX shared library lib/libtorch_cuda.so
ninja: build stopped: subcommand failed.
```

Reviewed By: briancoutinho

Differential Revision: D34227122

Pulled By: aaronenyeshi

fbshipit-source-id: b44989430c9aa9a61c17c4adde30195013fc1199
  • Loading branch information
aaronenyeshi authored and facebook-github-bot committed Feb 15, 2022
1 parent 1d21eda commit 7176010
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libkineto/libkineto_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_libkineto_cpu_only_srcs(with_api = True):
"src/CuptiActivityApi.cpp",
"src/Demangle.cpp",
"src/GenericTraceActivity.cpp",
"src/ILoggerObserver.cpp",
"src/Logger.cpp",
"src/init.cpp",
"src/output_csv.cpp",
Expand All @@ -58,6 +59,7 @@ def get_libkineto_public_headers():
"include/GenericTraceActivity.h",
"include/GenericTraceActivity.h",
"include/IActivityProfiler.h",
"include/ILoggerObserver.h",
"include/ITraceActivity.h",
"include/TraceSpan.h",
"include/ThreadUtil.h",
Expand Down

0 comments on commit 7176010

Please sign in to comment.