Skip to content

Conversation

@tyoc213
Copy link

@tyoc213 tyoc213 commented Jan 7, 2021

I had this version and also one implemented with mul and sigmoid directly in aten_xla_type without going "down" to tensor_methods as this one is that preffered?

I dont think I need to add a test case, but if I need to where I add it or what I would need to test?

My local test was something like

import torch
from torch.nn import SiLU
import torch_xla.core.xla_model as xm


dede=xm.xla_device()
m = SiLU()
m = m.to(dede)
input = torch.randn(2)
print('input', input)
input2 = input.clone()
input = input.to(dede)
output = m(input)
print(output)
print(output.device)
m2 = SiLU()
print("normal")
print('input2', input2)
o2 = m2(input2)
print(o2)

it prints

input tensor([0.0087, 0.1275])
tensor([0.0044, 0.0678], device='xla:1')
xla:1
normal
input2 tensor([0.0087, 0.1275])
tensor([0.0044, 0.0678])

Waiting for review.

For the issue #2717

@tyoc213
Copy link
Author

tyoc213 commented Jan 7, 2021

if something needs to be fixed, will also add the clang-format-7 -i -style=file torch_xla/csrc/tensor_methods.cpp

Copy link
Collaborator

@JackCaoG JackCaoG 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 the contribution, couple nits

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

@JackCaoG just hit assert check_overrides(overrides, overridden) inside gen.py if I print the set(overrides)-set(overridden) is {'index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor', 'index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor', '_index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor'}. But I think those things are inside the code already.

Even if I stash my changes the same error shows

Obtaining file:///home/tyoc213/Documents/github/pytorch/xla
  Added file:///home/tyoc213/Documents/github/pytorch/xla to build tracker '/tmp/pip-req-tracker-znzlfh_d'
    Running setup.py (path:/home/tyoc213/Documents/github/pytorch/xla/setup.py) egg_info for package from file:///home/tyoc213/Documents/github/pytorch/xla
    Created temporary directory: /tmp/pip-pip-egg-info-ilpq0hhm
    Running command python setup.py egg_info
    Extracted 1825 functions (0 errors) from /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    366 function overrides in /home/tyoc213/Documents/github/pytorch/xla/scripts/../torch_xla/csrc/aten_xla_type.h
    Generated 1825 wrappers for /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    AtenXlaType function missed override: Tensor& _index_put_impl_( Tensor& self, const c10::List<c10::optional<Tensor>>& indices, const Tensor& values, bool accumulate, bool unsafe); // _index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor
    AtenXlaType function missed override: Tensor index(const Tensor& self, const c10::List<c10::optional<Tensor>>& indices); // index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor
    AtenXlaType function missed override: Tensor& index_put_( Tensor& self, const c10::List<c10::optional<Tensor>>& indices, const Tensor& values, bool accumulate); // index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor
    printed_diff {'index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor', 'index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor', '_index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor'}
    Traceback (most recent call last):
    Traceback (most recent call last):
      File "/home/tyoc213/Documents/github/pytorch/xla/scripts/gen.py", line 1196, in <module>
        generate(args)
      File "/home/tyoc213/Documents/github/pytorch/xla/scripts/gen.py", line 1166, in generate
        assert check_overrides(overrides, overridden)
    AssertionError
    Failed to generate ATEN bindings: ['/home/tyoc213/Documents/github/pytorch/xla/scripts/generate_code.sh']
    Building torch_xla version: 1.6
    XLA Commit ID: 08b0fe436147863c3236e0a88f7f39d1c6b0e4c7
    PyTorch Commit ID: 963f7629b591dc9750476faf1513bc7f1fb4d6de
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

For the moment will clean and build again, but there is other way?

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 8, 2021

@JackCaoG just hit assert check_overrides(overrides, overridden) inside gen.py if I print the set(overrides)-set(overridden) is {'index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor', 'index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor', '_index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor'}. But I think those things are inside the code already.

Even if I stash my changes the same error shows

Obtaining file:///home/tyoc213/Documents/github/pytorch/xla
  Added file:///home/tyoc213/Documents/github/pytorch/xla to build tracker '/tmp/pip-req-tracker-znzlfh_d'
    Running setup.py (path:/home/tyoc213/Documents/github/pytorch/xla/setup.py) egg_info for package from file:///home/tyoc213/Documents/github/pytorch/xla
    Created temporary directory: /tmp/pip-pip-egg-info-ilpq0hhm
    Running command python setup.py egg_info
    Extracted 1825 functions (0 errors) from /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    366 function overrides in /home/tyoc213/Documents/github/pytorch/xla/scripts/../torch_xla/csrc/aten_xla_type.h
    Generated 1825 wrappers for /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    AtenXlaType function missed override: Tensor& _index_put_impl_( Tensor& self, const c10::List<c10::optional<Tensor>>& indices, const Tensor& values, bool accumulate, bool unsafe); // _index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor
    AtenXlaType function missed override: Tensor index(const Tensor& self, const c10::List<c10::optional<Tensor>>& indices); // index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor
    AtenXlaType function missed override: Tensor& index_put_( Tensor& self, const c10::List<c10::optional<Tensor>>& indices, const Tensor& values, bool accumulate); // index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor
    printed_diff {'index(Tensor,c10::List<c10::optional<Tensor>>)->Tensor', 'index_put_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool)->Tensor', '_index_put_impl_(Tensor,c10::List<c10::optional<Tensor>>,Tensor,bool,bool)->Tensor'}
    Traceback (most recent call last):
    Traceback (most recent call last):
      File "/home/tyoc213/Documents/github/pytorch/xla/scripts/gen.py", line 1196, in <module>
        generate(args)
      File "/home/tyoc213/Documents/github/pytorch/xla/scripts/gen.py", line 1166, in generate
        assert check_overrides(overrides, overridden)
    AssertionError
    Failed to generate ATEN bindings: ['/home/tyoc213/Documents/github/pytorch/xla/scripts/generate_code.sh']
    Building torch_xla version: 1.6
    XLA Commit ID: 08b0fe436147863c3236e0a88f7f39d1c6b0e4c7
    PyTorch Commit ID: 963f7629b591dc9750476faf1513bc7f1fb4d6de
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

For the moment will clean and build again, but there is other way?

This usually means there is a mismatch between what we overwrite and what pytorch provided. The most common reason is pytorch update the signature but we didn't follow. Looking at the circleCI run it seems like pt and pt/xla head is fine, could you try to rebase and rebuild?

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

mmm if rebase means to be pointing to 8028661 that is OK

image

I tried to clone again the repo&branch and sync submodules but still the same error.

The only missing thing would be to update pytorch which I was some commits behind and see if that fixes it.

Still dont know why the initial commit on this branch didn't show the error until now? (I mean it even passed the little python test).

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

@JackCaoG I think I got why it worked before, I was some commits behind in pytorch and xla and I started to work on that setup when I got something working, I stashed it and updated xla to make the PR branch and pushed it. Now I have updated pytorch but Im getting this error in master for xla after update:

    FAILED: /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_impl.o
    clang++-8 -MMD -MF /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_impl.o.d -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I/home/tyoc213/Documents/github/pytorch/xla -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/home/tyoc213/Documents/github/pytorch -I/home/tyoc213/Documents/github/pytorch/torch/csrc -I/home/tyoc213/Documents/github/pytorch/torch/lib/tmp_install/include -I/home/tyoc213/Documents/github/pytorch/torch/include -I/home/tyoc213/Documents/github/pytorch/torch/include/torch/csrc/api/include -I/home/tyoc213/Documents/github/pytorch/torch/include/TH -I/home/tyoc213/Documents/github/pytorch/torch/include/THC -I/home/tyoc213/miniconda3/envs/xla/include/python3.6m -c -c /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp -o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_impl.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=0
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:135:5: error: use of undeclared identifier 'sizes_'; did you mean 'sizes'?
        sizes_.clear();
        ^~~~~~
        sizes
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:103:32: note: 'sizes' declared here
    at::IntArrayRef XLATensorImpl::sizes() const {
                                   ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:135:5: error: reference to non-static member function must be called; did you mean to call it with no arguments?
        sizes_.clear();
        ^~~~~~
              ()
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:135:12: error: no member named 'clear' in 'c10::ArrayRef<long>'
        sizes_.clear();
        ~~~~~~ ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:138:7: error: use of undeclared identifier 'sizes_'; did you mean 'sizes'?
          sizes_.push_back(dim);
          ^~~~~~
          sizes
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:103:32: note: 'sizes' declared here
    at::IntArrayRef XLATensorImpl::sizes() const {
                                   ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:138:7: error: reference to non-static member function must be called; did you mean to call it with no arguments?
          sizes_.push_back(dim);
          ^~~~~~
                ()
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:138:14: error: no member named 'push_back' in 'c10::ArrayRef<long>'
          sizes_.push_back(dim);
          ~~~~~~ ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:141:5: error: use of undeclared identifier 'strides_'; did you mean 'strides'?
        strides_.clear();
        ^~~~~~~~
        strides
    /home/tyoc213/Documents/github/pytorch/c10/core/TensorImpl.h:402:23: note: 'strides' declared here
      virtual IntArrayRef strides() const;
                          ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:141:5: error: reference to non-static member function must be called; did you mean to call it with no arguments?
        strides_.clear();
        ^~~~~~~~
                ()
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:141:14: error: no member named 'clear' in 'c10::ArrayRef<long>'
        strides_.clear();
        ~~~~~~~~ ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:143:7: error: use of undeclared identifier 'strides_'; did you mean 'strides'?
          strides_.push_back(stride);
          ^~~~~~~~
          strides
    /home/tyoc213/Documents/github/pytorch/c10/core/TensorImpl.h:402:23: note: 'strides' declared here
      virtual IntArrayRef strides() const;
                          ^
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:143:7: error: reference to non-static member function must be called; did you mean to call it with no arguments?
          strides_.push_back(stride);
          ^~~~~~~~
                  ()
    /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/tensor_impl.cpp:143:16: error: no member named 'push_back' in 'c10::ArrayRef<long>'
          strides_.push_back(stride);
          ~~~~~~~~ ^
    12 errors generated.

It is ok to continue reporting this here? or should I open an issue?

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 8, 2021

@tyoc213 It is ok to report it here, I think the error should be fixed by #2685. Can you rebase your xla again? Thanks!

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

Now it almost there, but

    copying build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so ->
    +++ dirname /home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh
    ++ cd /home/tyoc213/Documents/github/pytorch/xla/test/cpp
    ++ pwd -P
    + RUNDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp
    + BUILDDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + BUILDTYPE=Release
    + VERB=
    + FILTER=
    + BUILD_ONLY=0
    + RMBUILD=1
    + LOGFILE=/tmp/pytorch_cpp_test.log
    + XLA_EXPERIMENTAL=nonzero:masked_select
    + '[' '' == 1 ']'
    + getopts VLDKBF:X: OPTION
    + case $OPTION in
    + BUILD_ONLY=1
    + getopts VLDKBF:X: OPTION
    + shift 1
    + export XLA_EXPERIMENTAL
    + rm -rf /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + mkdir /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + pushd /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    ~/Documents/github/pytorch/xla/test/cpp/build ~/Documents/github/pytorch/xla
    ++ python -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())'
    ++ python -c 'import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('\''LIBDIR'\'') + '\''/'\'' + sysconfig.get_config_var('\''LDLIBRARY'\''))'
    + cmake /home/tyoc213/Documents/github/pytorch/xla/test/cpp -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/home/tyoc213/miniconda3/envs/xla/include/python3.6m -DPYTHON_LIBRARY=/home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so
    Selected PT/XLA library folder /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6
    -- The C compiler identification is Clang 8.0.1
    -- The CXX compiler identification is Clang 8.0.1
    -- Check for working C compiler: /usr/bin/clang-8
    -- Check for working C compiler: /usr/bin/clang-8 -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/clang++-8
    -- Check for working CXX compiler: /usr/bin/clang++-8 -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonLibs: /home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so (found version "3.6.12")
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found CUDA: /usr/local/cuda (found version "11.1")
    -- Caffe2: CUDA detected: 11.1
    -- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
    -- Caffe2: CUDA toolkit directory: /usr/local/cuda
    -- Caffe2: Header version is: 11.1
    -- Found CUDNN: /usr/local/cuda/lib64/libcudnn.so
    -- Found cuDNN: v8.0.5  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
    -- Autodetected CUDA architecture(s):  7.5
    -- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
    -- Found Torch: /home/tyoc213/Documents/github/pytorch/torch/lib/libtorch.so
    Selected XLAC library /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so
    -- Configuring done
    CMake Warning at CMakeLists.txt:59 (add_executable):
      Cannot generate a safe runtime search path for target test_ptxla because
      there is a cycle in the constraint graph:

        dir 0 is [/home/tyoc213/Documents/github/pytorch/torch/lib]
        dir 1 is [/usr/local/cuda/lib64/stubs]
        dir 2 is [/usr/local/cuda/lib64]
          dir 3 must precede it due to runtime library [libnvToolsExt.so.1]
        dir 3 is [/home/tyoc213/miniconda3/lib]
          dir 2 must precede it due to runtime library [libcufft.so.10]
        dir 4 is [/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6]
        dir 5 is [/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib]
        dir 6 is [/home/tyoc213/miniconda3/envs/xla/lib]

      Some of these libraries may not be found correctly.


    -- Generating done
    -- Build files have been written to: /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + make -j
    Scanning dependencies of target googletest
    [  4%] Creating directories for 'googletest'
    [  9%] Performing download step (git clone) for 'googletest'
    -- googletest download command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-download-*.log
    [ 14%] No patch step for 'googletest'
    [ 19%] Performing update step for 'googletest'
    [ 23%] Performing configure step for 'googletest'
    -- googletest configure command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-configure-*.log
    [ 28%] Performing build step for 'googletest'
    -- googletest build command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-build-*.log
    [ 33%] No install step for 'googletest'
    [ 38%] Completed 'googletest'
    [ 38%] Built target googletest
    Scanning dependencies of target test_ptxla
    [ 42%] Building CXX object CMakeFiles/test_ptxla.dir/main.cpp.o
    [ 47%] Building CXX object CMakeFiles/test_ptxla.dir/cpp_test_util.cpp.o
    [ 52%] Building CXX object CMakeFiles/test_ptxla.dir/test_async_task.cpp.o
    [ 57%] Building CXX object CMakeFiles/test_ptxla.dir/metrics_snapshot.cpp.o
    [ 61%] Building CXX object CMakeFiles/test_ptxla.dir/test_aten_xla_tensor.cpp.o
    [ 66%] Building CXX object CMakeFiles/test_ptxla.dir/test_ir.cpp.o
    [ 71%] Building CXX object CMakeFiles/test_ptxla.dir/test_mayberef.cpp.o
    [ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_replication.cpp.o
    [ 80%] Building CXX object CMakeFiles/test_ptxla.dir/test_tensor.cpp.o
    [ 85%] Building CXX object CMakeFiles/test_ptxla.dir/test_op_by_op_executor.cpp.o
    make[2]: *** No rule to make target '/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so', needed by 'test_ptxla'.  Stop.
    make[2]: *** Waiting for unfinished jobs....
    [ 90%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
    [ 95%] Building CXX object CMakeFiles/test_ptxla.dir/torch_xla_test.cpp.o
    make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/test_ptxla.dir/all] Error 2
    make: *** [Makefile:84: all] Error 2
    Failed to build tests: ['/home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh', '-B']
ERROR: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 406, in run
    pycompile=options.compile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 90, in install_given_reqs
    pycompile=pycompile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 800, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/operations/install/editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-mhf02wxs'

I guess it is by the warning? Cannot generate a safe runtime search path for target test_ptxla because there is a cycle in the constraint graph:

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 8, 2021

yea, that seems to be where the error coming from in my log I saw

-- Found Threads: TRUE  
-- Found Torch: /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/torch/lib/libtorch.so  
Selected XLAC library /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/build/lib.linux-x86_64-3.7/_XLAC.cpython-37m-x86_64-linux-gnu.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build
+ make -j
make[1]: Entering directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
make[2]: Entering directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
Scanning dependencies of target googletest
make[2]: Leaving directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
make[2]: Entering directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
[  4%] Creating directories for 'googletest'
[  9%] Performing download step (git clone) for 'googletest'
-- googletest download command succeeded.  See also /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-download-*.log
[ 14%] No patch step for 'googletest'
[ 19%] Performing update step for 'googletest'
[ 23%] Performing configure step for 'googletest'
-- googletest configure command succeeded.  See also /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-configure-*.log
[ 28%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-build-*.log
[ 33%] No install step for 'googletest'
[ 38%] Completed 'googletest'
make[2]: Leaving directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
[ 38%] Built target googletest
make[2]: Entering directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
Scanning dependencies of target test_ptxla
make[2]: Leaving directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
make[2]: Entering directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
[ 42%] Building CXX object CMakeFiles/test_ptxla.dir/main.cpp.o
[ 47%] Building CXX object CMakeFiles/test_ptxla.dir/cpp_test_util.cpp.o
[ 52%] Building CXX object CMakeFiles/test_ptxla.dir/metrics_snapshot.cpp.o
[ 57%] Building CXX object CMakeFiles/test_ptxla.dir/test_async_task.cpp.o
[ 61%] Building CXX object CMakeFiles/test_ptxla.dir/test_aten_xla_tensor.cpp.o
[ 66%] Building CXX object CMakeFiles/test_ptxla.dir/test_ir.cpp.o
[ 71%] Building CXX object CMakeFiles/test_ptxla.dir/test_mayberef.cpp.o
[ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_op_by_op_executor.cpp.o
[ 80%] Building CXX object CMakeFiles/test_ptxla.dir/test_replication.cpp.o
[ 85%] Building CXX object CMakeFiles/test_ptxla.dir/test_tensor.cpp.o
[ 90%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
[ 95%] Building CXX object CMakeFiles/test_ptxla.dir/torch_xla_test.cpp.o
[100%] Linking CXX executable test_ptxla
make[2]: Leaving directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
[100%] Built target test_ptxla
make[1]: Leaving directory '/usr/local/google/home/jackcao/Desktop/gitProj2/pytorch/xla/test/cpp/build'
+ '[' 1 -eq 0 ']'
+ popd
~/Desktop/gitProj2/pytorch/xla
+ '[' 1 -eq 1 -a 1 -eq 0 ']'
creating build/bdist.linux-x86_64/egg
copying build/lib.linux-x86_64-3.7/libptxla.so -> build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/torch_xla
creating build/bdist.linux-x86_64/egg/torch_xla/debug

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

@JackCaoG I guess it is something in the path? or know what I need to change to make it work? (Im searching but havent found an "easy fix")

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 8, 2021

After some search it seems like that warning does not cause the compilation failure. the real error seems to be

ERROR: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 406, in run
    pycompile=options.compile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 90, in install_given_reqs
    pycompile=pycompile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 800, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/operations/install/editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-mhf02wxs'

Does it fail with master? Did you see this error before?

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

@JackCaoG no, I haven't seen this error before and yes for me it also happens in master.

The end on master shows the same error

    [ 95%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
    make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/test_ptxla.dir/all] Error 2
    make: *** [Makefile:84: all] Error 2
    Failed to build tests: ['/home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh', '-B']
ERROR: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 406, in run
    pycompile=options.compile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 90, in install_given_reqs
    pycompile=pycompile,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 800, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/operations/install/editable_legacy.py", line 51, in install_editable
    cwd=unpacked_source_directory,
  File "/home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-ey2fbdn5'


If you see it says Failed to build tests: ['/home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh', '-B'] , if I execute directly that bash I get this:

(xla) tyoc213@u:~/Documents/github/pytorch/xla$ /home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh
+++ dirname /home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh
++ cd /home/tyoc213/Documents/github/pytorch/xla/test/cpp
++ pwd -P
+ RUNDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp
+ BUILDDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
+ BUILDTYPE=Release
+ VERB=
+ FILTER=
+ BUILD_ONLY=0
+ RMBUILD=1
+ LOGFILE=/tmp/pytorch_cpp_test.log
+ XLA_EXPERIMENTAL=nonzero:masked_select
+ '[' '' == 1 ']'
+ getopts VLDKBF:X: OPTION
+ shift 0
+ export XLA_EXPERIMENTAL
+ rm -rf /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
+ mkdir /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
+ pushd /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
~/Documents/github/pytorch/xla/test/cpp/build ~/Documents/github/pytorch/xla
++ python -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())'
++ python -c 'import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('\''LIBDIR'\'') + '\''/'\'' + sysconfig.get_config_var('\''LDLIBRARY'\''))'
+ cmake /home/tyoc213/Documents/github/pytorch/xla/test/cpp -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/home/tyoc213/miniconda3/envs/xla/include/python3.6m -DPYTHON_LIBRARY=/home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so
Selected PT/XLA library folder /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6
-- The C compiler identification is Clang 8.0.1
-- The CXX compiler identification is Clang 8.0.1
-- Check for working C compiler: /usr/bin/clang-8
-- Check for working C compiler: /usr/bin/clang-8 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-8
-- Check for working CXX compiler: /usr/bin/clang++-8 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonLibs: /home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so (found version "3.6.12") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found version "11.1") 
-- Caffe2: CUDA detected: 11.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 11.1
-- Found CUDNN: /usr/local/cuda/lib64/libcudnn.so  
-- Found cuDNN: v8.0.5  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s):  7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found Torch: /home/tyoc213/Documents/github/pytorch/torch/lib/libtorch.so  
Selected XLAC library /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so
-- Configuring done
CMake Warning at CMakeLists.txt:59 (add_executable):
  Cannot generate a safe runtime search path for target test_ptxla because
  there is a cycle in the constraint graph:

    dir 0 is [/home/tyoc213/Documents/github/pytorch/torch/lib]
    dir 1 is [/usr/local/cuda/lib64/stubs]
    dir 2 is [/usr/local/cuda/lib64]
      dir 3 must precede it due to runtime library [libnvToolsExt.so.1]
    dir 3 is [/home/tyoc213/miniconda3/lib]
      dir 2 must precede it due to runtime library [libcufft.so.10]
    dir 4 is [/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6]
    dir 5 is [/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib]
    dir 6 is [/home/tyoc213/miniconda3/envs/xla/lib]

  Some of these libraries may not be found correctly.


-- Generating done
-- Build files have been written to: /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
+ make -j
Scanning dependencies of target googletest
[  4%] Creating directories for 'googletest'
[  9%] Performing download step (git clone) for 'googletest'
-- googletest download command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-download-*.log
[ 19%] No patch step for 'googletest'
[ 19%] Performing update step for 'googletest'
[ 23%] Performing configure step for 'googletest'
-- googletest configure command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-configure-*.log
[ 28%] Performing build step for 'googletest'
-- googletest build command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-build-*.log
[ 33%] No install step for 'googletest'
[ 38%] Completed 'googletest'
[ 38%] Built target googletest
Scanning dependencies of target test_ptxla
[ 42%] Building CXX object CMakeFiles/test_ptxla.dir/main.cpp.o
[ 47%] Building CXX object CMakeFiles/test_ptxla.dir/metrics_snapshot.cpp.o
[ 52%] Building CXX object CMakeFiles/test_ptxla.dir/cpp_test_util.cpp.o
[ 57%] Building CXX object CMakeFiles/test_ptxla.dir/test_aten_xla_tensor.cpp.o
[ 61%] Building CXX object CMakeFiles/test_ptxla.dir/test_async_task.cpp.o
[ 66%] Building CXX object CMakeFiles/test_ptxla.dir/test_ir.cpp.o
[ 71%] Building CXX object CMakeFiles/test_ptxla.dir/test_mayberef.cpp.o
[ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_op_by_op_executor.cpp.o
[ 80%] Building CXX object CMakeFiles/test_ptxla.dir/test_replication.cpp.o
[ 85%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
[ 90%] Building CXX object CMakeFiles/test_ptxla.dir/test_tensor.cpp.o
make[2]: *** No rule to make target '/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so', needed by 'test_ptxla'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 95%] Building CXX object CMakeFiles/test_ptxla.dir/torch_xla_test.cpp.o
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/test_ptxla.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

the problem seems that cmake (or make?) seems to not find

make[2]: *** No rule to make target '/home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so', needed by 'test_ptxla'. Stop.

I had cmake 3.16, just compiled 3.19.2. (I also have GNU Make 4.2.1)

But test_ptxla is in

9 results - 3 files

setup.py:
  341      data_files=[
  342:         'test/cpp/build/test_ptxla',
  343          'scripts/fixup_binary.py',

test/cpp/CMakeLists.txt:
   58  
   59: add_executable(test_ptxla ${TORCH_XLA_TEST_SOURCES})
   60  

   76  
   77: target_compile_options(test_ptxla PRIVATE ${TGT_OPTS})
   78  
   79  target_include_directories(
   80:   test_ptxla
   81    PRIVATE

   85  target_include_directories(
   86:   test_ptxla
   87    SYSTEM PUBLIC

   97  
   98: add_dependencies(test_ptxla googletest)
   99  

  118  target_link_libraries(
  119:   test_ptxla
  120    -Wl,--unresolved-symbols=ignore-in-shared-libs

test/cpp/run_tests.sh:
  57    if [ "$LOGFILE" != "" ]; then
  58:     ./test_ptxla ${FILTER:+"$FILTER"} 2>$LOGFILE
  59    else
  60:     ./test_ptxla ${FILTER:+"$FILTER"}
  61    fi

And libxla_computation_client is in

5 results - 3 files

build_torch_xla_libs.sh:
  60    bazel build $MAX_JOBS $VERBOSE --define framework_shared_object=false -c "$MODE" "${OPTS[@]}" \
  61:     $XLA_CUDA_CFG //tensorflow/compiler/xla/xla_client:libxla_computation_client.so
  62  

  64    mkdir -p torch_xla/lib
  65:   chmod 0644 $THIRD_PARTY_DIR/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so
  66:   cp $THIRD_PARTY_DIR/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so torch_xla/lib
  67  fi

test/cpp/CMakeLists.txt:
  122    "${PTXLA_LIB}"
  123:   "${PTXLA_LIBDIR}/torch_xla/lib/libxla_computation_client.so"
  124    "${PTPY_LIB}"

third_party/xla_client/BUILD:
  41  tf_cc_shared_object(
  42:     name = "libxla_computation_client.so",
  43      linkopts = select({

I wonder what is happening.


But the .so is there...

~/Documents/github/pytorch/xla$ find . -iname libxla_computation_client.so
./torch_xla/lib/libxla_computation_client.so

@tyoc213
Copy link
Author

tyoc213 commented Jan 8, 2021

I think I "found" the error, but dont know why it didnt happen before, the path /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so doesn't exist.

What exist is up to this place

~/Documents/github/pytorch/xla$ ls /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/
libptxla.so  _XLAC.cpython-36m-x86_64-linux-gnu.so

And it only included those 2 .so nothing more, no deeper directory structure from here on.

so I made the path $ mkdir -p /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/ and then copy the lib that is in the other path ~/Documents/github/pytorch/xla$ cp torch_xla/lib/libxla_computation_client.so /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/.

So I try again on master....

(xla) tyoc213@u:~/Documents/github/pytorch/xla$ time pip install -e . -vvv
Using pip 20.2.4 from /home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/pip (python 3.6)
Non-user install because site-packages writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-t2_jskdl
Created temporary directory: /tmp/pip-req-tracker-rwef3utd
Initialized build tracking at /tmp/pip-req-tracker-rwef3utd
Created build tracker: /tmp/pip-req-tracker-rwef3utd
Entered build tracker: /tmp/pip-req-tracker-rwef3utd
Created temporary directory: /tmp/pip-install-hx321zpe
Obtaining file:///home/tyoc213/Documents/github/pytorch/xla
  Added file:///home/tyoc213/Documents/github/pytorch/xla to build tracker '/tmp/pip-req-tracker-rwef3utd'
    Running setup.py (path:/home/tyoc213/Documents/github/pytorch/xla/setup.py) egg_info for package from file:///home/tyoc213/Documents/github/pytorch/xla
    Created temporary directory: /tmp/pip-pip-egg-info-y8rjjlim
    Running command python setup.py egg_info
    Extracted 1848 functions (0 errors) from /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    365 function overrides in /home/tyoc213/Documents/github/pytorch/xla/scripts/../torch_xla/csrc/aten_xla_type.h
    Generated 1848 wrappers for /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    + OPTS=()
    + getopts O: OPTION
    + case $OPTION in
    + for i in ${OPTARG}
    + OPTS+=("--cxxopt=${i}")
    + getopts O: OPTION
    + shift 2
    + CMD=egg_info
    ++ dirname /home/tyoc213/Documents/github/pytorch/xla/build_torch_xla_libs.sh
    + cd /home/tyoc213/Documents/github/pytorch/xla
    +++ pwd
    ++ printf '%q\n' /home/tyoc213/Documents/github/pytorch/xla
    + PWD=/home/tyoc213/Documents/github/pytorch/xla
    + BASE_DIR=/home/tyoc213/Documents/github/pytorch/xla
    + echo /home/tyoc213/Documents/github/pytorch/xla
    /home/tyoc213/Documents/github/pytorch/xla
    + THIRD_PARTY_DIR=/home/tyoc213/Documents/github/pytorch/xla/third_party
    + MODE=opt
    + [[ 1 == \1 ]]
    + MODE=dbg
    + VERBOSE=
    + [[ 0 == \1 ]]
    + MAX_JOBS=
    + [[ 1 == \1 ]]
    + [[ '' == \t\r\u\e ]]
    + OPTS+=(--cxxopt="-std=c++14")
    ++ basename -- clang-8
    + [[ clang-8 =~ ^clang ]]
    + OPTS+=(--cxxopt="-Wno-c++11-narrowing")
    + [[ 1 == \1 ]]
    + OPTS+=(--cxxopt="-DXLA_CUDA=1")
    + OPTS+=(--config=cuda)
    + '[' egg_info == clean ']'
    + cp -r -u -p /home/tyoc213/Documents/github/pytorch/xla/third_party/xla_client /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/tensorflow/compiler/xla/
    + pushd /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow
    ~/Documents/github/pytorch/xla/third_party/tensorflow ~/Documents/github/pytorch/xla
    + bazel build --define framework_shared_object=false -c dbg --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --cxxopt=-std=c++14 --cxxopt=-Wno-c++11-narrowing --cxxopt=-DXLA_CUDA=1 --config=cuda //tensorflow/compiler/xla/xla_client:libxla_computation_client.so
    INFO: Options provided by the client:
      Inherited 'common' options: --isatty=0 --terminal_columns=80
    INFO: Reading rc options for 'build' from /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc:
      Inherited 'common' options: --experimental_repo_remote_exec
    INFO: Reading rc options for 'build' from /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc:
      'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=0 --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=short_logs --config=v2
    INFO: Found applicable config definition build:short_logs in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
    INFO: Found applicable config definition build:v2 in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
    INFO: Found applicable config definition build:cuda in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --config=using_cuda --define=using_cuda_nvcc=true
    INFO: Found applicable config definition build:using_cuda in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=using_cuda=true --action_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=1
    INFO: Found applicable config definition build:linux in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --copt=-w --host_copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=dynamic_kernels
    INFO: Found applicable config definition build:dynamic_kernels in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
    Loading:
    Loading: 0 packages loaded
    Analyzing: target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so (0 packages loaded, 0 targets configured)
    INFO: Analyzed target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so (0 packages loaded, 0 targets configured).
    INFO: Found 1 target...
    [0 / 3] [Prepa] BazelWorkspaceStatusAction stable-status.txt
    Target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so up-to-date:
      bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so
    INFO: Elapsed time: 0.626s, Critical Path: 0.01s
    INFO: 0 processes.
    INFO: Build completed successfully, 1 total action
    INFO: Build completed successfully, 1 total action
    + popd
    ~/Documents/github/pytorch/xla
    + mkdir -p torch_xla/lib
    + chmod 0644 /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so
    + cp /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so torch_xla/lib
    Building torch_xla version: 1.6
    XLA Commit ID: aa4099779f29b34244dbc64e079dfbe94aaa0931
    PyTorch Commit ID: 294b7867eb7f015de6219e03ad201583c1efb42a
    running egg_info
    creating /tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info
    writing /tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/dependency_links.txt
    writing top-level names to /tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/top_level.txt
    writing manifest file '/tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/SOURCES.txt'
    writing manifest file '/tmp/pip-pip-egg-info-y8rjjlim/torch_xla.egg-info/SOURCES.txt'
  Source in /home/tyoc213/Documents/github/pytorch/xla has version 1.6, which satisfies requirement torch-xla==1.6 from file:///home/tyoc213/Documents/github/pytorch/xla
  Removed torch-xla==1.6 from file:///home/tyoc213/Documents/github/pytorch/xla from build tracker '/tmp/pip-req-tracker-rwef3utd'
Installing collected packages: torch-xla
  Running setup.py develop for torch-xla
    Running command /home/tyoc213/miniconda3/envs/xla/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"'; __file__='"'"'/home/tyoc213/Documents/github/pytorch/xla/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
    Extracted 1848 functions (0 errors) from /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    365 function overrides in /home/tyoc213/Documents/github/pytorch/xla/scripts/../torch_xla/csrc/aten_xla_type.h
    Generated 1848 wrappers for /home/tyoc213/Documents/github/pytorch/xla/scripts/../../build/aten/src/ATen/RegistrationDeclarations.h
    + OPTS=()
    + getopts O: OPTION
    + case $OPTION in
    + for i in ${OPTARG}
    + OPTS+=("--cxxopt=${i}")
    + getopts O: OPTION
    + shift 2
    + CMD=develop
    ++ dirname /home/tyoc213/Documents/github/pytorch/xla/build_torch_xla_libs.sh
    + cd /home/tyoc213/Documents/github/pytorch/xla
    +++ pwd
    ++ printf '%q\n' /home/tyoc213/Documents/github/pytorch/xla
    + PWD=/home/tyoc213/Documents/github/pytorch/xla
    + BASE_DIR=/home/tyoc213/Documents/github/pytorch/xla
    + echo /home/tyoc213/Documents/github/pytorch/xla
    /home/tyoc213/Documents/github/pytorch/xla
    + THIRD_PARTY_DIR=/home/tyoc213/Documents/github/pytorch/xla/third_party
    + MODE=opt
    + [[ 1 == \1 ]]
    + MODE=dbg
    + VERBOSE=
    + [[ 0 == \1 ]]
    + MAX_JOBS=
    + [[ 1 == \1 ]]
    + [[ '' == \t\r\u\e ]]
    + OPTS+=(--cxxopt="-std=c++14")
    ++ basename -- clang-8
    + [[ clang-8 =~ ^clang ]]
    + OPTS+=(--cxxopt="-Wno-c++11-narrowing")
    + [[ 1 == \1 ]]
    + OPTS+=(--cxxopt="-DXLA_CUDA=1")
    + OPTS+=(--config=cuda)
    + '[' develop == clean ']'
    + cp -r -u -p /home/tyoc213/Documents/github/pytorch/xla/third_party/xla_client /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/tensorflow/compiler/xla/
    + pushd /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow
    ~/Documents/github/pytorch/xla/third_party/tensorflow ~/Documents/github/pytorch/xla
    + bazel build --define framework_shared_object=false -c dbg --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --cxxopt=-std=c++14 --cxxopt=-Wno-c++11-narrowing --cxxopt=-DXLA_CUDA=1 --config=cuda //tensorflow/compiler/xla/xla_client:libxla_computation_client.so
    INFO: Options provided by the client:
      Inherited 'common' options: --isatty=0 --terminal_columns=80
    INFO: Reading rc options for 'build' from /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc:
      Inherited 'common' options: --experimental_repo_remote_exec
    INFO: Reading rc options for 'build' from /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc:
      'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=0 --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=short_logs --config=v2
    INFO: Found applicable config definition build:short_logs in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
    INFO: Found applicable config definition build:v2 in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
    INFO: Found applicable config definition build:cuda in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --config=using_cuda --define=using_cuda_nvcc=true
    INFO: Found applicable config definition build:using_cuda in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=using_cuda=true --action_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --define=tensorflow_enable_mlir_generated_gpu_kernels=1
    INFO: Found applicable config definition build:linux in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --copt=-w --host_copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --config=dynamic_kernels
    INFO: Found applicable config definition build:dynamic_kernels in file /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
    Loading:
    Loading: 0 packages loaded
    Analyzing: target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so (0 packages loaded, 0 targets configured)
    INFO: Analyzed target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so (0 packages loaded, 0 targets configured).
    INFO: Found 1 target...
    [0 / 3] [Prepa] BazelWorkspaceStatusAction stable-status.txt
    Target //tensorflow/compiler/xla/xla_client:libxla_computation_client.so up-to-date:
      bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so
    INFO: Elapsed time: 0.416s, Critical Path: 0.00s
    INFO: 0 processes.
    INFO: Build completed successfully, 1 total action
    INFO: Build completed successfully, 1 total action
    + popd
    ~/Documents/github/pytorch/xla
    + mkdir -p torch_xla/lib
    + chmod 0644 /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so
    + cp /home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin/tensorflow/compiler/xla/xla_client/libxla_computation_client.so torch_xla/lib
    Building torch_xla version: 1.6
    XLA Commit ID: aa4099779f29b34244dbc64e079dfbe94aaa0931
    PyTorch Commit ID: 294b7867eb7f015de6219e03ad201583c1efb42a
    running develop
    running egg_info
    writing torch_xla.egg-info/PKG-INFO
    writing dependency_links to torch_xla.egg-info/dependency_links.txt
    writing top-level names to torch_xla.egg-info/top_level.txt
    reading manifest file 'torch_xla.egg-info/SOURCES.txt'
    writing manifest file 'torch_xla.egg-info/SOURCES.txt'
    running build_ext
    building '_XLAC' extension
    Emitting ninja build file /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
    [1/4] clang++-8 -MMD -MF /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/version.o.d -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I/home/tyoc213/Documents/github/pytorch/xla -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/home/tyoc213/Documents/github/pytorch -I/home/tyoc213/Documents/github/pytorch/torch/csrc -I/home/tyoc213/Documents/github/pytorch/torch/lib/tmp_install/include -I/home/tyoc213/Documents/github/pytorch/torch/include -I/home/tyoc213/Documents/github/pytorch/torch/include/torch/csrc/api/include -I/home/tyoc213/Documents/github/pytorch/torch/include/TH -I/home/tyoc213/Documents/github/pytorch/torch/include/THC -I/home/tyoc213/miniconda3/envs/xla/include/python3.6m -c -c /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/version.cpp -o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/version.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=0
    [2/4] clang++-8 -MMD -MF /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_autograd_ops.o.d -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I/home/tyoc213/Documents/github/pytorch/xla -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/home/tyoc213/Documents/github/pytorch -I/home/tyoc213/Documents/github/pytorch/torch/csrc -I/home/tyoc213/Documents/github/pytorch/torch/lib/tmp_install/include -I/home/tyoc213/Documents/github/pytorch/torch/include -I/home/tyoc213/Documents/github/pytorch/torch/include/torch/csrc/api/include -I/home/tyoc213/Documents/github/pytorch/torch/include/TH -I/home/tyoc213/Documents/github/pytorch/torch/include/THC -I/home/tyoc213/miniconda3/envs/xla/include/python3.6m -c -c /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/aten_autograd_ops.cpp -o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_autograd_ops.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=0
    [3/4] clang++-8 -MMD -MF /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type.o.d -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I/home/tyoc213/Documents/github/pytorch/xla -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/home/tyoc213/Documents/github/pytorch -I/home/tyoc213/Documents/github/pytorch/torch/csrc -I/home/tyoc213/Documents/github/pytorch/torch/lib/tmp_install/include -I/home/tyoc213/Documents/github/pytorch/torch/include -I/home/tyoc213/Documents/github/pytorch/torch/include/torch/csrc/api/include -I/home/tyoc213/Documents/github/pytorch/torch/include/TH -I/home/tyoc213/Documents/github/pytorch/torch/include/THC -I/home/tyoc213/miniconda3/envs/xla/include/python3.6m -c -c /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/aten_xla_type.cpp -o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=0
    [4/4] clang++-8 -MMD -MF /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type_default.o.d -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I/home/tyoc213/Documents/github/pytorch/xla -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-bin -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/protobuf_archive/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_protobuf/src -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/eigen_archive -I/home/tyoc213/Documents/github/pytorch/xla/third_party/tensorflow/bazel-tensorflow/external/com_google_absl -I/home/tyoc213/Documents/github/pytorch -I/home/tyoc213/Documents/github/pytorch/torch/csrc -I/home/tyoc213/Documents/github/pytorch/torch/lib/tmp_install/include -I/home/tyoc213/Documents/github/pytorch/torch/include -I/home/tyoc213/Documents/github/pytorch/torch/include/torch/csrc/api/include -I/home/tyoc213/Documents/github/pytorch/torch/include/TH -I/home/tyoc213/Documents/github/pytorch/torch/include/THC -I/home/tyoc213/miniconda3/envs/xla/include/python3.6m -c -c /home/tyoc213/Documents/github/pytorch/xla/torch_xla/csrc/aten_xla_type_default.cpp -o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type_default.o -std=c++14 -Wno-sign-compare -Wno-deprecated-declarations -Wno-return-type -Wno-macro-redefined -Wno-return-std-move -DNDEBUG -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_XLAC -D_GLIBCXX_USE_CXX11_ABI=0
    clang++-8 -pthread -shared -B /home/tyoc213/miniconda3/envs/xla/compiler_compat -L/home/tyoc213/miniconda3/envs/xla/lib -Wl,-rpath=/home/tyoc213/miniconda3/envs/xla/lib -Wl,--no-as-needed -Wl,--sysroot=/ -D_GLIBCXX_USE_CXX11_ABI=0 /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/random.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/device.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/computation.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_impl.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/elementwise.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/python_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/shape_builder.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_bridge.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ir_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/xla_lower_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ir.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/op_by_op_executor.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ir_dump_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/softmax_builder.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/token_handler.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/function_call_tracker.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_autograd_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/pooling.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type_default.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/convert_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/convolution.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/debug_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/layout_manager.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/batch_norm.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_methods.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/init_python_bindings.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/nll_loss.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/data_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/aten_xla_type.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/matrix.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/resize_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/tensor_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/nms_op.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/view.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/helpers.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/version.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/xla_op_builder.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/torch_util.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/lowering_context.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/reduction.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/cross_replica_reduces.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/discrete_uniform.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nll_loss2d_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/diagonal.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/log_softmax_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/native_batch_norm_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/select.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/as_strided_view_update.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/convolution_overrideable.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/softmax.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/rrelu_with_noise.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/index_select.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nms.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/upsample_nearest2d.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/softshrink.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/svd.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/scatter.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/scalar.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/cumsum.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/get_dimensions_size.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/max_pool_nd_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/hardshrink.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/put.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/sum.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/qr.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/max_in_dim.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/exponential.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/log_softmax.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/collective_permute.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/max_unpool_nd_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/not_supported.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/infer_output_shape.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/avg_pool_nd_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nonzero.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/uniform.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/var.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/softmax_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/index_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/upsample_bilinear2d_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/scatter_add.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/diagonal_view_update.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/adaptive_avg_pool2d.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/threshold.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/cast.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/upsample_bilinear2d.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/max_pool_nd.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/stack.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/logsumexp.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/avg_pool_nd.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/arithmetic_ir_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/native_batch_norm_forward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/topk.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/repeat.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nll_loss_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/mean.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/leaky_relu.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/expand.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/update_slice.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/cat.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/max_unpool_nd.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/arg_min.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/constant.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/permute.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/masked_select.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/masked_fill.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/split.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/index_put.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/linear_interpolation.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/binary_cross_entropy_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/as_strided.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/bernoulli.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/squeeze.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/reflection_pad2d.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/arg_max.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/triu.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/rrelu_with_noise_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/kth_value.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/device_data.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/replication_pad_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/mse_loss_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/unsqueeze.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/reflection_pad2d_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/threshold_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nll_loss.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/min_in_dim.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/xla_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/cholesky.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/tril.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/shrink_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/normal.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/l1_loss.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/flip.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/upsample_nearest2d_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/all.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/cumprod.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/prod.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/index_get.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/l1_loss_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/all_reduce.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/unselect.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/replication_pad.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/convolution_backward_overrideable.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/hardtanh_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/view.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/gather.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/user_computation.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/binary_cross_entropy.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/leaky_relu_backward.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/nll_loss2d.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/std.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/mse_loss.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/bitwise_ir_ops.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/masked_scatter.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/any.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/generic.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/generic_slice.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/resize.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/symeig.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/all_to_all.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/triangular_solve.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/constant_pad_nd.o /home/tyoc213/Documents/github/pytorch/xla/build/temp.linux-x86_64-3.6/torch_xla/csrc/ops/adaptive_avg_pool3d.o -L/home/tyoc213/Documents/github/pytorch/xla/torch_xla/lib -L/home/tyoc213/Documents/github/pytorch/torch/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -o build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so -lxla_computation_client -Wl,-rpath,$ORIGIN/torch_xla/lib
    copying build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so ->
    +++ dirname /home/tyoc213/Documents/github/pytorch/xla/test/cpp/run_tests.sh
    ++ cd /home/tyoc213/Documents/github/pytorch/xla/test/cpp
    ++ pwd -P
    + RUNDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp
    + BUILDDIR=/home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + BUILDTYPE=Release
    + VERB=
    + FILTER=
    + BUILD_ONLY=0
    + RMBUILD=1
    + LOGFILE=/tmp/pytorch_cpp_test.log
    + XLA_EXPERIMENTAL=nonzero:masked_select
    + '[' '' == 1 ']'
    + getopts VLDKBF:X: OPTION
    + case $OPTION in
    + BUILD_ONLY=1
    + getopts VLDKBF:X: OPTION
    + shift 1
    + export XLA_EXPERIMENTAL
    + rm -rf /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + mkdir /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + pushd /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    ~/Documents/github/pytorch/xla/test/cpp/build ~/Documents/github/pytorch/xla
    ++ python -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())'
    ++ python -c 'import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('\''LIBDIR'\'') + '\''/'\'' + sysconfig.get_config_var('\''LDLIBRARY'\''))'
    + cmake /home/tyoc213/Documents/github/pytorch/xla/test/cpp -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/home/tyoc213/miniconda3/envs/xla/include/python3.6m -DPYTHON_LIBRARY=/home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so
    Selected PT/XLA library folder /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6
    -- The C compiler identification is Clang 8.0.1
    -- The CXX compiler identification is Clang 8.0.1
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/clang-8 - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/clang++-8 - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonLibs: /home/tyoc213/miniconda3/envs/xla/lib/libpython3.6m.so (found version "3.6.12")
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    -- Found CUDA: /usr/local/cuda (found version "11.1")
    -- Caffe2: CUDA detected: 11.1
    -- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
    -- Caffe2: CUDA toolkit directory: /usr/local/cuda
    -- Caffe2: Header version is: 11.1
    -- Found CUDNN: /usr/local/cuda/lib64/libcudnn.so
    -- Found cuDNN: v8.0.5  (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
    -- Autodetected CUDA architecture(s):  7.5
    -- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
    -- Found Torch: /home/tyoc213/Documents/github/pytorch/torch/lib/libtorch.so
    Selected XLAC library /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/_XLAC.cpython-36m-x86_64-linux-gnu.so
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build
    + make -j
    Scanning dependencies of target googletest
    [  4%] Creating directories for 'googletest'
    [  9%] Performing download step (git clone) for 'googletest'
    -- googletest download command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-download-*.log
    [ 14%] Performing update step for 'googletest'
    [ 19%] No patch step for 'googletest'
    [ 23%] Performing configure step for 'googletest'
    -- googletest configure command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-configure-*.log
    [ 28%] Performing build step for 'googletest'
    -- googletest build command succeeded.  See also /home/tyoc213/Documents/github/pytorch/xla/test/cpp/build/gtest/src/googletest-stamp/googletest-build-*.log
    [ 33%] No install step for 'googletest'
    [ 38%] Completed 'googletest'
    [ 38%] Built target googletest
    Scanning dependencies of target test_ptxla
    [ 42%] Building CXX object CMakeFiles/test_ptxla.dir/main.cpp.o
    [ 47%] Building CXX object CMakeFiles/test_ptxla.dir/metrics_snapshot.cpp.o
    [ 52%] Building CXX object CMakeFiles/test_ptxla.dir/cpp_test_util.cpp.o
    [ 57%] Building CXX object CMakeFiles/test_ptxla.dir/test_async_task.cpp.o
    [ 61%] Building CXX object CMakeFiles/test_ptxla.dir/test_aten_xla_tensor.cpp.o
    [ 66%] Building CXX object CMakeFiles/test_ptxla.dir/test_ir.cpp.o
    [ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_op_by_op_executor.cpp.o
    [ 76%] Building CXX object CMakeFiles/test_ptxla.dir/test_mayberef.cpp.o
    [ 80%] Building CXX object CMakeFiles/test_ptxla.dir/test_replication.cpp.o
    [ 85%] Building CXX object CMakeFiles/test_ptxla.dir/test_tensor.cpp.o
    [ 90%] Building CXX object CMakeFiles/test_ptxla.dir/test_xla_util_cache.cpp.o
    [ 95%] Building CXX object CMakeFiles/test_ptxla.dir/torch_xla_test.cpp.o
    [100%] Linking CXX executable test_ptxla
    [100%] Built target test_ptxla
    + '[' 1 -eq 0 ']'
    + popd
    ~/Documents/github/pytorch/xla
    + '[' 1 -eq 1 -a 1 -eq 0 ']'
    Creating /home/tyoc213/miniconda3/envs/xla/lib/python3.6/site-packages/torch-xla.egg-link (link to .)
    Adding torch-xla 1.6 to easy-install.pth file

    Installed /home/tyoc213/Documents/github/pytorch/xla
Successfully installed torch-xla
Removed build tracker: '/tmp/pip-req-tracker-rwef3utd'

real	5m16.993s
user	4m35.608s
sys	0m42.595s

But dont know if I need to compile two times one to generate the current .o and the second want after updating manually the lib in the desired path /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/ where it wants to find this lib.

@tyoc213 tyoc213 force-pushed the 2717_silu branch 2 times, most recently from 27d21dc to 01eb9a9 Compare January 9, 2021 01:49
@tyoc213
Copy link
Author

tyoc213 commented Jan 9, 2021

  • how to debug print? I was using just std::cout?
  • I was having a "bad alloc" msg after the python executed and the returned tensor was [] but it did not break in the moment of the python step, but it was printed at the end of execution. How to debug this?
  • I was trying to pass to the operation in ops two inputs input and output as the "above" functions, but eventually got to pass just 1 and replace in "upper" level with SetInPlaceIrValue. How I will go if I needed to pass the 2 values and set the out value inside the ops code?

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 9, 2021

  • how to debug print? I was using just std::cout?

cout/cerr is fine.

  • I was having a "bad alloc" msg after the python executed and the returned tensor was [] but it did not break in the moment of the python step, but it was printed at the end of execution. How to debug this?

it sounds like pt/xla does not return the correct tensor to the upper pytorch layer. Having a gdb and set break point on pt/xla functions you defined and inspect the value of the tensors should help

  • I was trying to pass to the operation in ops two inputs input and output as the "above" functions, but eventually got to pass just 1 and replace in "upper" level with SetInPlaceIrValue. How I will go if I needed to pass the 2 values and set the out value inside the ops code?

Can you give me a more concrete example?

@tyoc213
Copy link
Author

tyoc213 commented Jan 9, 2021

I was trying to do some like

NodePtr SiLU(const Value& input, const Value& output) {
  auto lower_fn = [](const Node& node, LoweringContext* loctx) -> XlaOpVector {
    xla::XlaOp xla_input = loctx->GetOutputOp(node.operand(0));
    xla::XlaOp output = loctx->GetOutputOp(node.operand(1));
    return node.ReturnOp(BuildSiLU(xla_input, output), loctx);
  };
}

And then

// NOTE: there are no `xla::XlaOp& output`like params in the rest of the file
xla::XlaOp BuildSiLU(xla::XlaOp input, xla::XlaOp& output) {
  const xla::Shape& shape = XlaHelpers::ShapeOfXlaOp(input);
  xla::XlaOp half = XlaHelpers::ScalarValue<float>(0.5, shape.element_type(),
                                                   input.builder());
  output = input * (half + half * xla::Tanh(half * input)); // IIRC this fails
  return output; // And this will be weird because value "would be" already set if the line above worked
}

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jan 9, 2021

I was trying to do some like

NodePtr SiLU(const Value& input, const Value& output) {
  auto lower_fn = [](const Node& node, LoweringContext* loctx) -> XlaOpVector {
    xla::XlaOp xla_input = loctx->GetOutputOp(node.operand(0));
    xla::XlaOp output = loctx->GetOutputOp(node.operand(1));
    return node.ReturnOp(BuildSiLU(xla_input, output), loctx);
  };
}

And then

// NOTE: there are no `xla::XlaOp& output`like params in the rest of the file
xla::XlaOp BuildSiLU(xla::XlaOp input, xla::XlaOp& output) {
  const xla::Shape& shape = XlaHelpers::ShapeOfXlaOp(input);
  xla::XlaOp half = XlaHelpers::ScalarValue<float>(0.5, shape.element_type(),
                                                   input.builder());
  output = input * (half + half * xla::Tanh(half * input)); // IIRC this fails
  return output; // And this will be weird because value "would be" already set if the line above worked
}

I don't think you need to manually pass the output and then do a SetInPlaceIrValue . SetInPlaceIrValue usually is needed by inplace operation like add_. What you have right now in the commit seems correct.

In BuildSilu, you can even

xla::XlaOp BuildSiLU(xla::XlaOp input) {
   return input * BuildSigmoid(input);
}

or you don't need to have this helper function and do

NodePtr SiLU(const Value& input, const Value& output) {
  auto lower_fn = [](const Node& node, LoweringContext* loctx) -> XlaOpVector {
    xla::XlaOp xla_input = loctx->GetOutputOp(node.operand(0));
    return node.ReturnOp(xla_input * BuildSigmoid(input), loctx);
  };
 .........
}

SiLU node should take one input and return one output

@tyoc213
Copy link
Author

tyoc213 commented Jan 9, 2021

I see, you can flag the change as review if you preferr one or the other instead of how I have it in code. The "sample above" was one of the things I was trying to do before "latest working commit".

Before I didn't know where to stop thinking of this

he advantage of doing it this way is when we dump the ir_graph, we will see the op with name Silu instead of a mul + sigmoid. It is easier for debug and it is our convention.

So I thought that if I used the other operations at that level it will emit mul+sigmoid in the ir_grap. That is why it ended like it is.

@tyoc213
Copy link
Author

tyoc213 commented Jan 9, 2021

I think I will prefer the latest way without helper function if it emits correctly.

Is there a way to stop the build process on CI? Or should I just commit again? I guess I will just ammend latest commit so that elementwise is not modified.

Copy link
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

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

@tyoc213 Thanks for the contribution! Very minor nits, otherwise LGTM.

@JackCaoG
Copy link
Collaborator

I think I will prefer the latest way without helper function if it emits correctly.

Is there a way to stop the build process on CI? Or should I just commit again? I guess I will just ammend latest commit so that elementwise is not modified.

ir graph only being effected by ir_node you used. In this case you define a NodePtr SiLU so that's what we will see when dumping the ir graph. Whether you used the helper function doesn't matter.

Copy link
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

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

Great work! I will merge it once all tests passed.

@tyoc213
Copy link
Author

tyoc213 commented Jan 11, 2021

Yey! Thanks, was thinking of the other two ops that you said before (except if you have any other "easy one to lvl up"), do you have any plans on taking them in the near future? and to that point default_op_deps is where I can see which ops are used? it is a good guide in that regard or it is not "exhaustive"?

And was thinking also maybe open an issue regarding the path /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so which seems only to happen in my end while some build command tries to find the client in that path.


Extra Q: those build can be installed/downloaded or only the nightly build is available?

Extra Q2: the only way to dump the graph is with the report that makes a zip file?

@JackCaoG
Copy link
Collaborator

Yey! Thanks, was thinking of the other two ops that you said before (except if you have any other "easy one to lvl up"), do you have any plans on taking them in the near future? and to that point default_op_deps is where I can see which ops are used? it is a good guide in that regard or it is not "exhaustive"?

What do you mean by default_op_deps? We can take those two lowerings but I think they are more complicated so it is likely to take longer to implement. I think the biggest difference would be you will define the op under torch_xla/csrc/ops/xxx.h instead of under torch_xla/csrc/ops/ops.h. Changes in aten_xla_type, tensor/tensor_method and cpp test should be similar.

And was thinking also maybe open an issue regarding the path /home/tyoc213/Documents/github/pytorch/xla/build/lib.linux-x86_64-3.6/torch_xla/lib/libxla_computation_client.so which seems only to happen in my end while some build command tries to find the client in that path.

feel free to open the issue but it would be a bit hard to debug if I can't repo it locally.

Extra Q: those build can be installed/downloaded or only the nightly build is available?

what do you mean? You can also build the pt/xla from scratch, we also published built wheel everyday.

Extra Q2: the only way to dump the graph is with the report that makes a zip file?

there are two api you can use at anytime

# print the ir graph
print(torch_xla._XLAC._get_xla_tensors_text([res5]))               

# print the HLO text
for i in torch_xla._XLAC._get_xla_tensors_hlo(tensors).split('\n'): print(i)

@JackCaoG JackCaoG added the lowering ATen Operation lowering label Jan 12, 2021
@tyoc213
Copy link
Author

tyoc213 commented Jan 12, 2021

What do you mean by default_op_deps?

Inside pytorch there is a default_op_deps.yaml that indeed contain a list of names, I thought that this "traces" in some way which other ops are used inside the op.

We can take those two lowerings but I think they are more complicated so it is likely to take longer to implement. I think the biggest difference would be you will define the op under torch_xla/csrc/ops/xxx.h instead of under torch_xla/csrc/ops/ops.h. Changes in aten_xla_type, tensor/tensor_method and cpp test should be similar.

yeah, I was thinking of the time because I too think it will more time (maybe 2-5 weeks hopefully), and most probably will make some mistakes on the way, but if that will take more than what you have in mind for this op(s), will wait/see if there is another I can do or just continue checking the rest of the code.

what do you mean? You can also build the pt/xla from scratch, we also published built wheel everyday.

Oh yeah, I mean, this CI builds can be used from colab? or only the ones of the nightly?

@JackCaoG JackCaoG merged commit bac1d5e into pytorch:master Jan 12, 2021
@JackCaoG
Copy link
Collaborator

What do you mean by default_op_deps?

Inside pytorch there is a default_op_deps.yaml that indeed contain a list of names, I thought that this "traces" in some way which other ops are used inside the op.

I am actually not sure about that file, @ailzhang any ideas?

We can take those two lowerings but I think they are more complicated so it is likely to take longer to implement. I think the biggest difference would be you will define the op under torch_xla/csrc/ops/xxx.h instead of under torch_xla/csrc/ops/ops.h. Changes in aten_xla_type, tensor/tensor_method and cpp test should be similar.

yeah, I was thinking of the time because I too think it will more time (maybe 2-5 weeks hopefully), and most probably will make some mistakes on the way, but if that will take more than what you have in mind for this op(s), will wait/see if there is another I can do or just continue checking the rest of the code.

That time sounds reasonable to me.

what do you mean? You can also build the pt/xla from scratch, we also published built wheel everyday.

Oh yeah, I mean, this CI builds can be used from colab? or only the ones of the nightly?

I don't think you can use CI build for cloab

@tyoc213
Copy link
Author

tyoc213 commented Jan 24, 2021

I might start taking a look at next op which I guess will be 2d :)

ysiraichi added a commit that referenced this pull request May 22, 2025
- `SgnOp` and `SignOp`
    - Full codegen migration: #3577
    - Mistakenly re-introduced: #3572
- `LogSigmoid`
    - Introduced: #3539
    - Full codegen migration: #3743
- `SiLU`
    - Introduced: #2721
    - Full codegen migration: #3780
- `SiLUBackward`
    - Introduced: #3195
    - Full codegen migration: #3780
- `SeLU`
    - Introduced: #3547
    - Full codegen migration: #3780
- `Sigmoid`
    - Introduced: 6a73deb (no PR record)
    - Full codegen migration: #6342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lowering ATen Operation lowering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants