Giter Club home page Giter Club logo

intel-extension-for-pytorch's Introduction

Intel® Extension for PyTorch*

CPU 💻main branch   |   🌱Quick Start   |   📖Documentations   |   🏃Installation   |   💻LLM Example
GPU 💻main branch   |   🌱Quick Start   |   📖Documentations   |   🏃Installation   |   💻LLM Example

Intel® Extension for PyTorch* extends PyTorch* with up-to-date features optimizations for an extra performance boost on Intel hardware. Optimizations take advantage of Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Vector Neural Network Instructions (VNNI) and Intel® Advanced Matrix Extensions (Intel® AMX) on Intel CPUs as well as Intel Xe Matrix Extensions (XMX) AI engines on Intel discrete GPUs. Moreover, Intel® Extension for PyTorch* provides easy GPU acceleration for Intel discrete GPUs through the PyTorch* xpu device.

ipex.llm - Large Language Models (LLMs) Optimization

In the current technological landscape, Generative AI (GenAI) workloads and models have gained widespread attention and popularity. Large Language Models (LLMs) have emerged as the dominant models driving these GenAI applications. Starting from 2.1.0, specific optimizations for certain LLM models are introduced in the Intel® Extension for PyTorch*. Check LLM optimizations for details.

Optimized Model List

MODEL FAMILY MODEL NAME (Huggingface hub) FP32 BF16 Static quantization INT8 Weight only quantization INT8 Weight only quantization INT4
LLAMA meta-llama/Llama-2-7b-hf 🟩 🟩 🟩 🟩 🟨
LLAMA meta-llama/Llama-2-13b-hf 🟩 🟩 🟩 🟩 🟨
LLAMA meta-llama/Llama-2-70b-hf 🟩 🟩 🟩 🟩 🟨
GPT-J EleutherAI/gpt-j-6b 🟩 🟩 🟩 🟩 🟩
GPT-NEOX EleutherAI/gpt-neox-20b 🟩 🟨 🟨 🟩 🟨
DOLLY databricks/dolly-v2-12b 🟩 🟨 🟨 🟩 🟨
FALCON tiiuae/falcon-40b 🟩 🟩 🟩 🟩 🟩
OPT facebook/opt-30b 🟩 🟩 🟩 🟩 🟨
OPT facebook/opt-1.3b 🟩 🟩 🟩 🟩 🟨
Bloom bigscience/bloom-1b7 🟩 🟨 🟩 🟩 🟨
CodeGen Salesforce/codegen-2B-multi 🟩 🟩 🟨 🟩 🟩
Baichuan baichuan-inc/Baichuan2-7B-Chat 🟩 🟩 🟩 🟩
Baichuan baichuan-inc/Baichuan2-13B-Chat 🟩 🟩 🟩 🟩
Baichuan baichuan-inc/Baichuan-13B-Chat 🟩 🟨 🟩 🟩
ChatGLM THUDM/chatglm3-6b 🟩 🟩 🟨 🟩
ChatGLM THUDM/chatglm2-6b 🟩 🟩 🟨 🟩
GPTBigCode bigcode/starcoder 🟩 🟩 🟨 🟩 🟨
T5 google/flan-t5-xl 🟩 🟩 🟨 🟩
Mistral mistralai/Mistral-7B-v0.1 🟩 🟩 🟨 🟩 🟨
MPT mosaicml/mpt-7b 🟩 🟩 🟨 🟩 🟩
Mixtral mistralai/Mixtral-8x7B-v0.1 🟩 🟩 🟩
Stablelm stabilityai/stablelm-2-1_6b 🟩 🟩 🟨
Qwen Qwen/Qwen-7B-Chat 🟩 🟩 🟩
  • 🟩 signifies that the model can perform well and with good accuracy (<1% difference as compared with FP32).

  • 🟨 signifies that the model can perform well while accuracy may not been in a perfect state (>1% difference as compared with FP32).

Note: The above verified models (including other models in the same model family, like "codellama/CodeLlama-7b-hf" from LLAMA family) are well supported with all optimizations like indirect access KV cache, fused ROPE, and prepacked TPP Linear (fp32/bf16). We are working in progress to better support the models in the tables with various data types. In addition, more models will be optimized in the future.

Support

The team tracks bugs and enhancement requests using GitHub issues. Before submitting a suggestion or bug report, search the existing GitHub issues to see if your issue has already been reported.

License

Apache License, Version 2.0. As found in LICENSE file.

Security

See Intel's Security Center for information on how to report a potential security issue or vulnerability.

See also: Security Policy

intel-extension-for-pytorch's People

Contributors

blzheng avatar caoe avatar chunyuan-w avatar chunyuanw avatar eikanwang avatar jianan-gu avatar jianpingchen066 avatar jiayisunx avatar jingxu10 avatar juliusshufan avatar leslie-fang-intel avatar liangan1 avatar min-jean-cho avatar pinzhenx avatar sanchitintel avatar tangleintel avatar valentine233 avatar violetch24 avatar wei-lin-intel avatar weizhuozhang-intel avatar wenzhe-nrv avatar xia-weiwen avatar xiaobingsuper avatar xuhancn avatar yanbing-j avatar zailiwang avatar zejun-chen avatar zhaoqiongz avatar zhuhaozhe avatar zhujewel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intel-extension-for-pytorch's Issues

There has some failed test case for test_torch.py

'''
ERROR: test_copy_all_dtypes_and_devices_dpcpp (main.TestTorchDeviceTypeDPCPP)

Traceback (most recent call last):
File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_device_type.py", line 227, in instantiated_test
return test(self, device_arg)
File "test_torch.py", line 10281, in test_copy_all_dtypes_and_devices
y = copy(x)
File "/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/copy.py", line 96, in copy
rv = reductor(4)
File "/home/xiaobinz/Downloads/pytorch-xiaobing/torch/tensor.py", line 132, in reduce_ex
args = (self.storage(),
RuntimeError: unsupported Storage type

======================================================================
FAIL: test_broadcast_batched_matmul_dpcpp (main.TestTorchDeviceTypeDPCPP)

Traceback (most recent call last):
File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_device_type.py", line 227, in instantiated_test
return test(self, device_arg)
File "test_torch.py", line 7589, in test_broadcast_batched_matmul
verify_batched_matmul(*indices)
File "test_torch.py", line 7581, in verify_batched_matmul
self.assertEqual(truth, maybe_squeeze_result(l, r, out))
File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_utils.py", line 782, in assertEqual
assertTensorsEqual(x, y)
File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_utils.py", line 752, in assertTensorsEqual
self.assertLessEqual(max_err, prec, message)
AssertionError: tensor(2.8768, device='dpcpp') not less than or equal to 1e-05 :

======================================================================
FAIL: test_memory_format_clone_dpcpp (main.TestTorchDeviceTypeDPCPP)

Traceback (most recent call last):
File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_device_type.py", line 227, in instantiated_test
return test(self, device_arg)
File "test_torch.py", line 12852, in test_memory_format_clone
device, get_generator(mf, shape), transformation_fn, mf, True, default_is_preserve=True)
File "test_torch.py", line 12788, in _test_memory_format_transformations
self.assertFalse(clone.is_contiguous())
AssertionError: True is not false
''''

DNNl MaxPool can't get nan result when input's value is nan

DNNL MaxPool should get nan value when input values are all nan.

test case:

import torch
import intel_pytorch_extension
from torch._six import inf, nan
intel_pytorch_extension.core.enable_auto_dnnl()

input = torch.full([1, 1] + 2 * [3], nan).to('dpcpp')
output = F.max_pool2d(x, 3, 3)

[RFC] Explicitize datatype conversion in JIT for auto-mixed precision

Feature

Add a JIT graph rewrite pass to turn a graph with auto-mixed datatype conversion to a graph with explicit conversion. After the conversion, the graph won't rely on global configuration and would comply with later optimization passes, like fusion/quantization passes from PyTorch proper and the oneDNN graph pass. The converted graph is also free from misconfiguration issues due to inter-op parallelism or other optimizations that might change the topological order.

Motivation

Implicit data type (for either bfloat16 and qint8) would make graph optimization harder since all the optimization passes have to take care of an additional quantization configuration. This is not compatible with all other optimization passes in PyTorch as well as oneDNN graph which rely on the info only from the graph itself.

Pitch

Add a JIT graph rewrite pass to turn a graph with auto datatype implicit conversion to a graph with explicit conversion.

Alternatives

Make all graph rewrite passes aware of the auto datatype conversion rules. As a result, we are not able to reuse existing graph rewrite passes in IPEX like the oneDNN graph pass and has to re-implement all of them again in IPEX. We are not able to do fusion pattern matching with existing pattern matching utility directly since the pattern matching has to comply with the auto conversion rules too.

Additional context

Take int8 quantization for an example, users do calibration or QAT with implicit data type in the imperative mode. The generated quantization configuration is passed to the proposed JIT graph rewrite pass which would add data type conversions and quantization ops into the graph first before passing the graph for later passes for optimization.

For op-wise quantization configuration, JIT trace mode is simpler to support than JIT script mode. The former has one-to-one mapping of graph ops to the configuration but the latter might contain conditionals and cannot be easily mapped to the configuration. We may consider to support JIT trace mode first. Later on, for script mode without conditionals, we may consider to symbolically follow the programming order and do the configuration mapping.

Incompatible function arguments when enabling the auto-mix-precision

I installed PyTorch v1.5.0 rc3 and Extension for PyTorch following the guide. However, when I tried to enable the auto-mix-precision as guided, it throws the error:

TypeError: enable_auto_dnnl(): incompatible function arguments. The following argument types are supported:
    1. () -> None

Invoked with: True

Attached with the complete log:

>>> import torch
>>> import torch.nn as nn
>>> import intel_pytorch_extension as ipex
>>> ipex.enable_auto_optimization(mixed_dtype = torch.bfloat16)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/envs/pytorchextension/lib/python3.7/site-packages/torch_ipex-1.0.0-py3.7-linux-x86_64.egg/intel_pytorch_extension/__init__.py", line 25, in enable_auto_optimization
    core.enable_auto_dnnl(True)
TypeError: enable_auto_dnnl(): incompatible function arguments. The following argument types are supported:
    1. () -> None

Invoked with: True

Is it because I didn't install Extension for PyTorch properly?

ValueError: batch_sizes should always be on CPU.

File "../code/semivae/model.py", line 186, in forward_encoder
x = nn.utils.rnn.pack_sequence(x)
File "../envs/pytorch-bf16-molan/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 411, in pack_sequence
return pack_padded_sequence(pad_sequence(sequences), lengths, enforce_sorted=enforce_sorted)
File "..anaconda3/envs/pytorch-bf16-molan/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 245, in pack_padded_sequence
return _packed_sequence_init(data, batch_sizes, sorted_indices, None)
File "/../anaconda3/envs/pytorch-bf16-molan/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 182, in _packed_sequence_init
data, batch_sizes, sorted_indices, unsorted_indices)
File "..anaconda3/envs/pytorch-bf16-molan/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 166, in _packed_sequence_init_args
"batch_sizes should always be on CPU. "
ValueError: batch_sizes should always be on CPU. Instances of PackedSequence should never be created manually. They should be instantiated by functions like pack_sequence and pack_padded_sequences in nn.utils.rnn. https://pytorch.org/docs/stable/nn.html#torch.nn.utils.rnn.pack_sequence

RuntimeError: could not construct a memory descriptor using strides

RuntimeError: could not construct a memory descriptor using strides

File ".../pytorch_bf16/adorym/adorym/adorym/wrappers.py", line 584, in reshape
arr = func(var, newshape)
File ".../python3.6/site-packages/torch_ipex-1.0.0-py3.6-linux-x86_64.egg/intel_pytorch_extension/ops/reshape.py", line 15, in reshape
return ReshapeFunction.apply(input, size)
File "/...anaconda3/envs/pytorch-bf16/lib/python3.6/site-packages/torch_ipex-1.0.0-py3.6-linux-x86_64.egg/intel_pytorch_extension/ops/reshape.py", line 10, in forward
output = core.reshape(input, size)
RuntimeError: could not construct a memory descriptor using strides

_torch_ipex.cpython-36m-x86_64-linux-gnu.so has many undefined symbols

ldd -r _torch_ipex.cpython-36m-x86_64-linux-gnu.so:

ndefined symbol: PyExc_ValueError      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_KeyError        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_FalseStruct       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_BufferError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_RuntimeError    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyComplex_Type        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_Type        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_MemoryError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBaseObject_Type     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_CheckRecursionLimit       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySlice_Type  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyModule_Type (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyType_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyProperty_Type       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySet_Type    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_NoneStruct        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_UserWarning     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_NotImplementedStruct      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_TypeError       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_RuntimeWarning  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_SystemError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_Type        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_DeprecationWarning      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_Exception       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_TrueStruct        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_Type  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFloat_Type  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_IndexError      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBool_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_StopIteration   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFrozenSet_Type      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_Type  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCFunction_Type      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyMethod_Type (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _Py_EllipsisObject    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_AttributeError  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyInstanceMethod_Type (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThread_get_key_value        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromLong       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_AsUTF8String        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_GetBuiltins    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_FromFormat  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyModule_Create2      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_And  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThread_create_key   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsVoidPtr      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_SetItemString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_GetName     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyImport_ImportModule (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyComplex_AsCComplex  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromSsize_t    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyType_IsSubtype      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyException_SetTraceback      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_SetAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_Fetch   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _PyThreadState_UncheckedGet   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Copy   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_RestoreThread  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_GetSlice      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Size   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_DecodeUTF8  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_FromString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_SetString       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_CallObject   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_FromString    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_AcquireThread  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_GetItem        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Check        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_FromStringAndSize   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_IsInstance   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThreadState_Get     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_Append (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_HasAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyMem_Free    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_GetBuffer    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromDouble     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyArg_ParseTuple      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThreadState_New     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_Pack  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_AsString      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromUnsignedLongLong   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_NormalizeException      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_GetFrame       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_Repr (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFrame_GetLineNumber (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_ClearWeakRefs        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyStructSequence_New  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Merge  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Next   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_IsSubclass   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_GetContext  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_GetPointer  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyArg_ParseTupleAndKeywords   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_SetItem        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThreadState_Clear   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _PyType_Lookup        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyMemoryView_FromMemory       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyInstanceMethod_New  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCallable_Check      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_Clear   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Xor  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_New (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyMem_Calloc  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_ExceptionMatches        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_New    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBuffer_Release      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_Join        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_RichCompareBool      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_Size  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyModule_AddObject    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Or   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_NewException    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySet_Add     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_GetItem    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsUnsignedLong (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFrame_FastToLocals  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsSsize_t      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Index        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_Size       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_GetItem      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThread_set_key_value        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Long (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Contains       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyModule_New  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: Py_BuildValue (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyType_GenericNew     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_InitThreads    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_SetItem      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyType_Ready  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyComplex_FromDoubles (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_Items  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyGILState_Check      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFloat_FromDouble    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyStructSequence_InitType     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_IsTrue       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_GetItemString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySet_New     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyNumber_Float        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySlice_GetIndicesEx  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBool_FromLong       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsLongLongAndOverflow  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsLong (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: _PyObject_GetDictPtr  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_GetItem       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_AsFileDescriptor     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyComplex_FromCComplex        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_Size (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_Malloc       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_AsLongLong     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_InternInPlace       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromLongLong   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyFloat_AsDouble      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyEval_SaveThread     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_SetItem       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyIter_Next   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_Restore (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_SetName     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_WarnExplicit    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_WarnEx  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_SetContext  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_List       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_Call (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_Check      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_GC_UnTrack   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromVoidPtr    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCapsule_Import      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_CallMethod   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyLong_FromSize_t     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_Size   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_GetAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyGILState_GetThisThreadState (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_AsStringAndSize       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyModule_GetName      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyList_New    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_AsEncodedString     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_GetIter      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_GetItem        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyImport_AddModule    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_AsUTF8      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_CallFunctionObjArgs  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_New   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_Str  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_Format  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyObject_SetAttr      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCFunction_NewEx     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_AsUTF8AndSize       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyThreadState_DeleteCurrent   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySlice_Unpack        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyTuple_Size  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyCode_Addr2Line      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_Fast       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyUnicode_InternFromString    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyErr_Occurred        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PySequence_Tuple      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyBytes_FromStringAndSize     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyDict_DelItemString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyWeakref_NewRef      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch/lib/libtorch_python.so)
undefined symbol: PyExc_ValueError      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _Py_FalseStruct       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_RuntimeError    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_MemoryError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyBaseObject_Type     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyType_Type   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyProperty_Type       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _Py_NoneStruct        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _Py_NotImplementedStruct      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_TypeError       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_SystemError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_Type        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _Py_TrueStruct        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyFloat_Type  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_IndexError      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCFunction_Type      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyExc_ImportError     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyInstanceMethod_Type (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThread_get_key_value        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyUnicode_AsUTF8String        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyEval_GetBuiltins    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyModule_Create2      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThread_create_key   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_GetName     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyLong_FromSsize_t    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyType_IsSubtype      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyException_SetTraceback      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_SetAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_Fetch   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _PyThreadState_UncheckedGet   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_Copy   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_Size   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyUnicode_DecodeUTF8  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyUnicode_FromString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_SetString       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_CallObject   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyEval_AcquireThread  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyNumber_Check        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_IsInstance   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThreadState_Get     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyList_Append (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_HasAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyMem_Free    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThreadState_New     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyBytes_AsString      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_NormalizeException      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_Repr (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyFrame_GetLineNumber (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_ClearWeakRefs        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_Next   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_GetContext  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_GetPointer  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThreadState_Clear   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _PyType_Lookup        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyInstanceMethod_New  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_Clear   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_New (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyMem_Calloc  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_ExceptionMatches        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_New    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyBytes_Size  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyModule_AddObject    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PySequence_GetItem    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PySequence_Size       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_GetItem      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThread_set_key_value        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyNumber_Long (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyEval_InitThreads    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_SetItem      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyType_Ready  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_GetItemString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyNumber_Float        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyLong_AsLongLongAndOverflow  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyLong_AsLong (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: _PyObject_GetDictPtr  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyTuple_GetItem       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyFloat_AsDouble      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyEval_SaveThread     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyTuple_SetItem       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_Restore (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCapsule_SetContext  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: Py_GetVersion (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PySequence_Check      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_GetAttrString        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyGILState_GetThisThreadState (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyBytes_AsStringAndSize       (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyList_New    (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyUnicode_AsEncodedString     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyTuple_New   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyObject_Str  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_Format  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyCFunction_NewEx     (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyThreadState_DeleteCurrent   (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyTuple_Size  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyErr_Occurred        (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyDict_DelItemString  (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)
undefined symbol: PyWeakref_NewRef      (/home/xiaobinz/anaconda3/envs/pytorch-test/lib/python3.6/site-packages/torch_ipex-0.1-py3.6-linux-x86_64.egg/_torch_ipex.cpython-36m-x86_64-linux-gnu.so)

conv transpose dispatch into wrong kernel

As conv and deconv shares the same entry convolution_overrideable and we ignored transposed parameter, deconv is dispatched into dil_convolution

dil_convolution_overrideable(const at::Tensor & input, const at::Tensor & weight, const at::Tensor & bias, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool transposed, at::IntArrayRef output_padding, int64_t groups)

undefined symbol: sgemm_ when importing IPEX

I build pytorch and IPEX according to the README in Ubuntu 20.04

Everything is find until I execute import intel_pytorch_extension as ipex.

Error reported:

ImportError                               Traceback (most recent call last)
<ipython-input-3-1031a6c8b3e2> in <module>
----> 1 import intel_pytorch_extension as ipex

~/.pyenv/versions/pytorch/lib/python3.7/site-packages/torch_ipex-1.0.0-py3.7-linux-x86_64.egg/intel_pytorch_extension/__init__.py in <module>
      5 from .version import __version__
      6 from .tensor import *
----> 7 from .optim import *
      8 from .ops import *
      9 import _torch_ipex as core

~/.pyenv/versions/pytorch/lib/python3.7/site-packages/torch_ipex-1.0.0-py3.7-linux-x86_64.egg/intel_pytorch_extension/optim/__init__.py in <module>
----> 1 from .split_sgd import is_available
      2 from .split_sgd import SplitSGD

~/.pyenv/versions/pytorch/lib/python3.7/site-packages/torch_ipex-1.0.0-py3.7-linux-x86_64.egg/intel_pytorch_extension/optim/split_sgd.py in <module>
      1 import torch
      2 from torch.optim.optimizer import Optimizer, required
----> 3 import _torch_ipex
      4
      5 _available = False

ImportError: /home/user/.pyenv/versions/pytorch/lib/python3.7/site-packages/torch_ipex-1.0.0-py3.7-linux-x86_64.egg/_torch_ipex.cpython-37m-x86_64-linux-gnu.so: undefined symbol: sgemm_

It can barely find any thing about sgemm__ symbol in Google. What happened here?

Only PyTorch v1.5.0-rc3 supported?

Hello,

I would like to know if only the rc3 of the v1.5.0 is supported or are there just outdated docs and it works with the newer versions of pytorch as well?

Install IPEX with non-system gcc

Dear developers,
it seems to be that the installation of the IPEX always uses the (on CentOS very outdated) system's 'gcc' and does not recognize the PATH environment, e.g. if multiple compiler versions are managed by 'modules' environment tool.
Best, Th.

shallowUpgradeToDPCPPTensor is unsafe

It does this:

    // [NOTE]: If the deleter of DPCPP::CPU is different form CPU deleter, we need to call
    //         compare_exchange_deleter of DataPtr to update deleter
    cpu_storage->data_ptr().unsafe_set_device(c10::Device(at::DeviceType::DPCPP));

But there may be other CPU tensors aliasing with this storage, and now you have violated all of their internal invariants. For the CPU_RAW shader context, why can't you just use stock CPU tensor representation in this case?

[Bug] Importing intel_pytorch_extension throws illegal instruction (core dumped)

As the title said, when I attended to import the ipex extension package as import intel_pytorch_extension, it terminated with an error: illegal instruction (core dumped), but I have no idea about this.
I followed the guide to install Pytorch v1.5.0 rc3 from the source successfully, and also applied those two patches as recommended. I can normally import torch and call many functions it contained. I installed the torch-ipex extension successfully as well. These showes in the pip list correctly.
Any possibilities of the Python's version which led to this problem? I used Python 3.6.9 [GCC 8.4.0] in my virtual environment. I compiled pytorch and this extension via dpcpp compiler.

Thanks,

baddbmm might output random result

baddbmm requires the input tensors must be broadcastable. But DNNL does not support this case. So if the shape of the input tensor does not meet the requirement, the dnnl baddbmm will output random results.
torch.baddbmm(input, batch1, batch2, *, beta=1, alpha=1, out=None) → Tensor
For example, If batch1 is a (b * n * m) tensor, batch2 is a (b * m * p) tensor, but input is a (n * p) tensor, then the baddbmm will output incorrect result. Actually, the input should be a (b * n * p) tensor.

Rename intel-pytorch-extension

We cannot use "intel-pytorch-extenion" because of ambiguous and might mislead the user that intel owns a pytorch. So we need to use "intel extension for pytorch"

Loss function RuntimeError when use BF16

Description:
when I use the latest IPEX to enable DLRM MLPerf BF16 training on real data, I get the RuntimeError as follows, but there is no this error in tags/v0.1 -b v0.1:
Traceback (most recent call last): File "dlrm_s_pytorch.py", line 988, in <module> E = loss_fn_wrap(Z, T, use_gpu, use_ipex, device) File "dlrm_s_pytorch.py", line 859, in loss_fn_wrap return loss_fn(Z, T.to(device)) File "anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File "anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 516, in forward return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction) File "anaconda3/lib/python3.7/site-packages/torch/nn/functional.py", line 2379, in binary_cross_entropy input, target, weight, reduction_enum) RuntimeError: all elements of input should be between 0 and 1

All data types have not been registered for DPCPP

Unit test case

ERROR: test_copy_all_dtypes_and_devices_dpcpp (__main__.TestTorchDeviceTypeDPCPP)

PyTorch source code(csrc/generic/Storage.cpp)

void THPStorage_(postInit)(PyObject *module)
{
  THPStorageClass = PyObject_GetAttrString(module,(char*)TH_CONCAT_STRING_2(Real,Storage));
  if (!THPStorageClass) throw python_error();

  at::Backend backend = at::Backend::CPU;
#ifdef THC_GENERIC_FILE
  backend = at::Backend::CUDA;
#endif

#ifdef THQUANTIZED
  backend = at::Backend::QuantizedCPU;
#endif

  torch::registerStoragePyTypeObject((PyTypeObject*)THPStorageClass, backend, TH_CONCAT_2(at::k, Real));
}

Revisit all *_out ops

Pytorch has a legacy resizing behavior in *_out ops (see here) in which out= tensor will only reuse the underlying buffer (if it's large enough, or new buffer will be allocated) regardless of its metadata. And the metadata will be rewritten by the op itself.

import torch

o = torch.rand(42)
print(o.size())
print(o.data_ptr())

torch.add(torch.rand(3, 8), torch.rand(3, 8), out=o)
print(o.size())
print(o.data_ptr())

torch.add(torch.rand(43), torch.rand(43), out=o)
print(o.size())
print(o.data_ptr())
torch.Size([42])
93863984799808
torch.Size([3, 8])
93863984799808   # 3 x 8 < 42, reuse old buffer
torch.Size([43])
93864012230144   # 43 > 42, allocate new buffer

enable slice semantics

For bf16, we may support slicing in such a way:

A tensor slice like a[4:8, 4:8, 4:8, 4:8] will call the slice() by four times, and in the first call to the slice(), we could convert the whole buffer to bf16, and all subsequent calls will only change its shape info.

This way, no matter users are reading or writing a submemory, we don't have to worry about writing a bf16 tensor back to original buffer, as the whole buffer has already been bf16 as well.

Caveats:

  1. This approach assumes that when a user is using a part of memory, he/she is also going to use the remaining part sooner or later. To put it another way, if the user will only use part of a memory, why would he/she allocate the whole buffer in the first place? (Correct me if I'm wrong)

  2. Since DNNL may not optimize or even correctly handle non-contiguous tensors for all situations (check this). We may still need contiguous checks in slice(), that is, we are not going to fully support slicing semantics.

question about pytorch extension

Can people run pytorch on a GPU with your DPCPP extension ? DPCPP, which is a component in oneAPI, enables people to run a program on multiple computing platforms. This may explain that "ipex.DEVICE" is needed although the device may be just a CPU device.

matmul does not support broadcast.

The unit test case of test_torch.py failed because matmul does not support broadcast.

Unit test case:

FAIL: test_broadcast_batched_matmul_dpcpp (main.TestTorchDeviceTypeDPCPP)

test_rn50_cpu_ops.py failed for test_addmm case

There has a failed case when run test_rn50_cpu_ops.py test case:

FAIL: test_addmm (__main__.TestOP)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_rn50_cpu_ops.py", line 688, in test_addmm
    self.assertEqual(m1_dpcpp.grad.to('cpu'), m1_cpu.grad, prec=0.0)
  File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_utils.py", line 782, in assertEqual
    assertTensorsEqual(x, y)
  File "/home/xiaobinz/Downloads/intel-extension-for-pytorch/tests/cpu/common_utils.py", line 752, in assertTensorsEqual
    self.assertLessEqual(max_err, prec, message)
AssertionError: tensor(2.8610e-06) not less than or equal to 0.0 :

----------------------------------------------------------------------
Ran 36 tests in 21.070s

May need increase the tolerance number.

[RFC] Support auto type conversion on visible data types other than float32

Currently IPEX supports auto mixed precision by automatically converting float32 tensors into bfloat16 tensors (or maybe other types in the future). The target data type can be configured via the API ipex.enable_auto_optimization(mixed_dtype = torch.bfloat16). But the user visible data type is always float32. This would cause issues when the model code has explicit bfloat16 tensors or when users want to inspect bfloat16 tensor content directly. This applies to other data types too, e.g. half etc.

This RFC proposes to extend the auto type conversion design to support other visible data types than float32. As long as the precision of visible data type is no worse than the target data type, auto type conversion should work. Below are some examples:

  1. visible: float32, dest: bfloat16 (current design)
  2. visible: float32, dest: half (naturally supported by current design)
  3. visible: float32, dest: qint8 (naturally supported by current design)
  4. visible: bfloat16, dest: bfloat16 (this RFC)
  5. visible: half, dest: half (this RFC)
  6. visible: bfloat16, dest: qint8 (this RFC)
  7. visible: int8, dest: int4 (this RFC, future possibility)

Conv module prepack

Conv = torch.nn.Conv.to(torch.float64)
Conv.to('dpcpp')

this will call our prepack but our prepack interface (use oneDNN) does not support "Double" type

Error Occured with DockerFile

Hello,

I tried to build docker with dockerfile, and get following errors.
Can you help me please?

...

#12 3708.   copying intel_pytorch_extension_py/ops/embeddingbag.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3708.   running build_ext
#12 3708.   run
#12 3709.   Extracted 58 functions (0 errors) from /opt/conda/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/generated/RegistrationDeclarations.h
#12 3709.   Tensor clone(const Tensor & self, optional<MemoryFormat> memory_format) Tensor clone(const Tensor & self, optional<MemoryFormat> memory_format)
#12 3709.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/SparseOPs.h
#12 3709.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/SparseOPs_0.cpp
#12 3710.   Extracted 1291 functions (0 errors) from /opt/conda/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/generated/RegistrationDeclarations.h
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs.h
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_0.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_1.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_2.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_3.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_4.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_5.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_6.cpp
#12 3710.   writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_7.cpp
#12 3710.   CMake Warning (dev) in CMakeLists.txt:
#12 3710.     No project() command is present.  The top-level CMakeLists.txt file must
#12 3710.     contain a literal, direct call to the project() command.  Add a line of
#12 3710.     code such as
#12 3710. 
#12 3710.       project(ProjectName)
#12 3710. 
#12 3710.     near the top of the file, but after cmake_minimum_required().
#12 3710. 
#12 3710.     CMake is pretending there is a "project(Project)" command on the first
#12 3710.     line.
#12 3710.   This warning is for project developers.  Use -Wno-dev to suppress it.
#12 3710. 
#12 3711.   -- The C compiler identification is GNU 9.3.0
#12 3711.   -- The CXX compiler identification is GNU 9.3.0
#12 3711.   -- Check for working C compiler: /usr/bin/cc
#12 3711.   -- Check for working C compiler: /usr/bin/cc -- works
#12 3711.   -- Detecting C compiler ABI info
#12 3711.   -- Detecting C compiler ABI info - done
#12 3711.   -- Detecting C compile features
#12 3711.   -- Detecting C compile features - done
#12 3711.   -- Check for working CXX compiler: /usr/bin/c++
#12 3711.   -- Check for working CXX compiler: /usr/bin/c++ -- works
#12 3711.   -- Detecting CXX compiler ABI info
#12 3711.   -- Detecting CXX compiler ABI info - done
#12 3711.   -- Detecting CXX compile features
#12 3711.   -- Detecting CXX compile features - done
#12 3711.   -- Found PythonInterp: /opt/conda/bin/python (found version "3.8.3")
#12 3711.   -- Found PythonLibs: /opt/conda/lib/libpython3.8.so
#12 3711.   -- Performing Test HAS_CPP14_FLAG
#12 3711.   -- Performing Test HAS_CPP14_FLAG - Success
#12 3711.   -- pybind11 v2.4.dev4
#12 3711.   -- Looking for pthread.h
#12 3711.   -- Looking for pthread.h - found
#12 3711.   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#12 3711.   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
#12 3711.   -- Looking for pthread_create in pthreads
#12 3711.   -- Looking for pthread_create in pthreads - not found
#12 3711.   -- Looking for pthread_create in pthread
#12 3711.   -- Looking for pthread_create in pthread - found
#12 3711.   -- Found Threads: TRUE
#12 3711.   -- Found OpenMP_C: -fopenmp (found version "4.5")
#12 3711.   -- Found OpenMP_CXX: -fopenmp (found version "4.5")
#12 3711.   -- Found OpenMP: TRUE (found version "4.5")
#12 3711.   -- GPU support is disabled
#12 3712.   -- Found Git: /usr/bin/git (found version "2.25.1")
#12 3712.   -- Primitive cache is enabled
#12 3712.   -- Performing Test C_HAS_AVX512_1
#12 3712.   -- Performing Test C_HAS_AVX512_1 - Failed
#12 3712.   -- Performing Test C_HAS_AVX512_2
#12 3712.   -- Performing Test C_HAS_AVX512_2 - Failed
#12 3712.   -- Performing Test CXX_HAS_AVX512_1
#12 3712.   -- Performing Test CXX_HAS_AVX512_1 - Failed
#12 3712.   -- Performing Test CXX_HAS_AVX512_2
#12 3712.   -- Performing Test CXX_HAS_AVX512_2 - Failed
#12 3712.   -- Performing Test C_HAS_AVX512_BF16_1
#12 3713.   -- Performing Test C_HAS_AVX512_BF16_1 - Failed
#12 3713.   -- Performing Test C_HAS_AVX512_BF16_2
#12 3713.   -- Performing Test C_HAS_AVX512_BF16_2 - Failed
#12 3713.   -- Performing Test CXX_HAS_AVX512_BF16_1
#12 3713.   -- Performing Test CXX_HAS_AVX512_BF16_1 - Failed
#12 3713.   -- Performing Test CXX_HAS_AVX512_BF16_2
#12 3713.   -- Performing Test CXX_HAS_AVX512_BF16_2 - Failed
#12 3713.   CMake Error at cmake/CPU.cmake:21 (message):
#12 3713.     Please build IPEX on Machines that support AVX512.
#12 3713.   Call Stack (most recent call first):
#12 3713.     CMakeLists.txt:19 (include)
#12 3713. 
#12 3713. 
#12 3713.   -- Configuring incomplete, errors occurred!
#12 3713.   See also "/tmp/pip-req-build-f_rgarrq/build/CMakeFiles/CMakeOutput.log".
#12 3713.   See also "/tmp/pip-req-build-f_rgarrq/build/CMakeFiles/CMakeError.log".
#12 3713.   Traceback (most recent call last):
#12 3713.     File "<string>", line 1, in <module>
#12 3713.     File "/tmp/pip-req-build-f_rgarrq/setup.py", line 244, in <module>
#12 3713.       setup(
#12 3713.     File "/opt/conda/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
#12 3713.       return distutils.core.setup(**attrs)
#12 3713.     File "/opt/conda/lib/python3.8/distutils/core.py", line 148, in setup
#12 3713.       dist.run_commands()
#12 3713.     File "/opt/conda/lib/python3.8/distutils/dist.py", line 966, in run_commands
#12 3713.       self.run_command(cmd)
#12 3713.     File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3713.       cmd_obj.run()
#12 3713.     File "/opt/conda/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 223, in run
#12 3713.       self.run_command('build')
#12 3713.     File "/opt/conda/lib/python3.8/distutils/cmd.py", line 313, in run_command
#12 3713.       self.distribution.run_command(command)
#12 3713.     File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3713.       cmd_obj.run()
#12 3713.     File "/opt/conda/lib/python3.8/distutils/command/build.py", line 135, in run
#12 3713.       self.run_command(cmd_name)
#12 3713.     File "/opt/conda/lib/python3.8/distutils/cmd.py", line 313, in run_command
#12 3713.       self.distribution.run_command(command)
#12 3713.     File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3713.       cmd_obj.run()
#12 3713.     File "/tmp/pip-req-build-f_rgarrq/setup.py", line 169, in run
#12 3713.       self.build_extension(ext)
#12 3713.     File "/tmp/pip-req-build-f_rgarrq/setup.py", line 212, in build_extension
#12 3713.       check_call([self.cmake, ext.project_dir] + cmake_args, cwd=ext.build_dir, env=env)
#12 3713.     File "/opt/conda/lib/python3.8/subprocess.py", line 364, in check_call
#12 3713.       raise CalledProcessError(retcode, cmd)
#12 3713.   subprocess.CalledProcessError: Command '['/usr/bin/cmake', '/tmp/pip-req-build-f_rgarrq', '-DCMAKE_BUILD_TYPE=Release', '-DPYTORCH_INSTALL_DIR=/opt/conda/lib/python3.8/site-packages/torch', '-DPYTHON_EXECUTABLE=/opt/conda/bin/python', '-DCMAKE_INSTALL_PREFIX=/tmp/pip-req-build-f_rgarrq/build/lib.linux-x86_64-3.8', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-f_rgarrq/build/lib.linux-x86_64-3.8', '-DPYTHON_INCLUDE_DIR=/opt/conda/include/python3.8']' returned non-zero exit status 1.
#12 3713.   Building wheel for torch-ipex (setup.py): finished with status 'error'
#12 3713.   ERROR: Failed building wheel for torch-ipex
#12 3713.   Running setup.py clean for torch-ipex
#12 3713.   Running command /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
#12 3713.   /tmp/pip-req-build-f_rgarrq/setup.py:183: SyntaxWarning: "is" with a literal. Did you mean "=="?
#12 3713.     if ext.name is 'torch_ipex' and _check_env_flag("USE_SYCL"):
#12 3714.   Building torch_ipex version: 1.0.0
#12 3714.   running clean
#12 3714.   'build/lib.linux-x86_64-3.8' does not exist -- can't clean it
#12 3714.   'build/bdist.linux-x86_64' does not exist -- can't clean it
#12 3714.   'build/scripts-3.8' does not exist -- can't clean it
#12 3714. Failed to build torch-ipex
#12 3714. Installing collected packages: torch-ipex
#12 3714.   Created temporary directory: /tmp/pip-record-70mkv95j
#12 3714.     Running setup.py install for torch-ipex: started
#12 3714.     Running command /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-70mkv95j/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.8/torch-ipex
#12 3714.     /tmp/pip-req-build-f_rgarrq/setup.py:183: SyntaxWarning: "is" with a literal. Did you mean "=="?
#12 3714.       if ext.name is 'torch_ipex' and _check_env_flag("USE_SYCL"):
#12 3715.     Building torch_ipex version: 1.0.0
#12 3715.     running install
#12 3715.     running build
#12 3715.     running build_py
#12 3715.     package init file 'torch_ipex/__init__.py' not found (or not a regular file)
#12 3715.     creating build
#12 3715.     creating build/lib.linux-x86_64-3.8
#12 3715.     creating build/lib.linux-x86_64-3.8/intel_pytorch_extension
#12 3715.     copying intel_pytorch_extension_py/__init__.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension
#12 3715.     copying intel_pytorch_extension_py/tensor.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension
#12 3715.     copying intel_pytorch_extension_py/version.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension
#12 3715.     creating build/lib.linux-x86_64-3.8/intel_pytorch_extension/optim
#12 3715.     copying intel_pytorch_extension_py/optim/split_sgd.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/optim
#12 3715.     copying intel_pytorch_extension_py/optim/__init__.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/optim
#12 3715.     creating build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/jit.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/mlp.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/__init__.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/reshape.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/interaction.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/pooling.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/linear.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     copying intel_pytorch_extension_py/ops/embeddingbag.py -> build/lib.linux-x86_64-3.8/intel_pytorch_extension/ops
#12 3715.     running build_ext
#12 3715.     run
#12 3715.     Extracted 58 functions (0 errors) from /opt/conda/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/generated/RegistrationDeclarations.h
#12 3715.     Tensor clone(const Tensor & self, optional<MemoryFormat> memory_format) Tensor clone(const Tensor & self, optional<MemoryFormat> memory_format)
#12 3715.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/SparseOPs.h
#12 3715.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/SparseOPs_0.cpp
#12 3717.     Extracted 1291 functions (0 errors) from /opt/conda/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/generated/RegistrationDeclarations.h
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs.h
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_0.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_1.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_2.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_3.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_4.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_5.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_6.cpp
#12 3717.     writing /tmp/pip-req-build-f_rgarrq/torch_ipex/csrc/cpu/DenseOPs_7.cpp
#12 3717.     CMake Warning (dev) in CMakeLists.txt:
#12 3717.       No project() command is present.  The top-level CMakeLists.txt file must
#12 3717.       contain a literal, direct call to the project() command.  Add a line of
#12 3717.       code such as
#12 3717. 
#12 3717.         project(ProjectName)
#12 3717. 
#12 3717.       near the top of the file, but after cmake_minimum_required().
#12 3717. 
#12 3717.       CMake is pretending there is a "project(Project)" command on the first
#12 3717.       line.
#12 3717.     This warning is for project developers.  Use -Wno-dev to suppress it.
#12 3717. 
#12 3717.     -- The C compiler identification is GNU 9.3.0
#12 3717.     -- The CXX compiler identification is GNU 9.3.0
#12 3717.     -- Check for working C compiler: /usr/bin/cc
#12 3717.     -- Check for working C compiler: /usr/bin/cc -- works
#12 3717.     -- Detecting C compiler ABI info
#12 3718.     -- Detecting C compiler ABI info - done
#12 3718.     -- Detecting C compile features
#12 3718.     -- Detecting C compile features - done
#12 3718.     -- Check for working CXX compiler: /usr/bin/c++
#12 3718.     -- Check for working CXX compiler: /usr/bin/c++ -- works
#12 3718.     -- Detecting CXX compiler ABI info
#12 3718.     -- Detecting CXX compiler ABI info - done
#12 3718.     -- Detecting CXX compile features
#12 3718.     -- Detecting CXX compile features - done
#12 3718.     -- Found PythonInterp: /opt/conda/bin/python (found version "3.8.3")
#12 3718.     -- Found PythonLibs: /opt/conda/lib/libpython3.8.so
#12 3718.     -- Performing Test HAS_CPP14_FLAG
#12 3718.     -- Performing Test HAS_CPP14_FLAG - Success
#12 3718.     -- pybind11 v2.4.dev4
#12 3718.     -- Looking for pthread.h
#12 3718.     -- Looking for pthread.h - found
#12 3718.     -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#12 3718.     -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
#12 3718.     -- Looking for pthread_create in pthreads
#12 3718.     -- Looking for pthread_create in pthreads - not found
#12 3718.     -- Looking for pthread_create in pthread
#12 3718.     -- Looking for pthread_create in pthread - found
#12 3718.     -- Found Threads: TRUE
#12 3718.     -- Found OpenMP_C: -fopenmp (found version "4.5")
#12 3718.     -- Found OpenMP_CXX: -fopenmp (found version "4.5")
#12 3718.     -- Found OpenMP: TRUE (found version "4.5")
#12 3718.     -- GPU support is disabled
#12 3718.     -- Found Git: /usr/bin/git (found version "2.25.1")
#12 3718.     -- Primitive cache is enabled
#12 3718.     -- Performing Test C_HAS_AVX512_1
#12 3718.     -- Performing Test C_HAS_AVX512_1 - Failed
#12 3718.     -- Performing Test C_HAS_AVX512_2
#12 3719.     -- Performing Test C_HAS_AVX512_2 - Failed
#12 3719.     -- Performing Test CXX_HAS_AVX512_1
#12 3719.     -- Performing Test CXX_HAS_AVX512_1 - Failed
#12 3719.     -- Performing Test CXX_HAS_AVX512_2
#12 3719.     -- Performing Test CXX_HAS_AVX512_2 - Failed
#12 3719.     -- Performing Test C_HAS_AVX512_BF16_1
#12 3719.     -- Performing Test C_HAS_AVX512_BF16_1 - Failed
#12 3719.     -- Performing Test C_HAS_AVX512_BF16_2
#12 3719.     -- Performing Test C_HAS_AVX512_BF16_2 - Failed
#12 3719.     -- Performing Test CXX_HAS_AVX512_BF16_1
#12 3720.     -- Performing Test CXX_HAS_AVX512_BF16_1 - Failed
#12 3720.     -- Performing Test CXX_HAS_AVX512_BF16_2
#12 3720.     -- Performing Test CXX_HAS_AVX512_BF16_2 - Failed
#12 3720.     CMake Error at cmake/CPU.cmake:21 (message):
#12 3720.       Please build IPEX on Machines that support AVX512.
#12 3720.     Call Stack (most recent call first):
#12 3720.       CMakeLists.txt:19 (include)
#12 3720. 
#12 3720. 
#12 3720.     -- Configuring incomplete, errors occurred!
#12 3720.     See also "/tmp/pip-req-build-f_rgarrq/build/CMakeFiles/CMakeOutput.log".
#12 3720.     See also "/tmp/pip-req-build-f_rgarrq/build/CMakeFiles/CMakeError.log".
#12 3720.     Traceback (most recent call last):
#12 3720.       File "<string>", line 1, in <module>
#12 3720.       File "/tmp/pip-req-build-f_rgarrq/setup.py", line 244, in <module>
#12 3720.         setup(
#12 3720.       File "/opt/conda/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
#12 3720.         return distutils.core.setup(**attrs)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/core.py", line 148, in setup
#12 3720.         dist.run_commands()
#12 3720.       File "/opt/conda/lib/python3.8/distutils/dist.py", line 966, in run_commands
#12 3720.         self.run_command(cmd)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3720.         cmd_obj.run()
#12 3720.       File "/opt/conda/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
#12 3720.         return orig.install.run(self)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/command/install.py", line 545, in run
#12 3720.         self.run_command('build')
#12 3720.       File "/opt/conda/lib/python3.8/distutils/cmd.py", line 313, in run_command
#12 3720.         self.distribution.run_command(command)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3720.         cmd_obj.run()
#12 3720.       File "/opt/conda/lib/python3.8/distutils/command/build.py", line 135, in run
#12 3720.         self.run_command(cmd_name)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/cmd.py", line 313, in run_command
#12 3720.         self.distribution.run_command(command)
#12 3720.       File "/opt/conda/lib/python3.8/distutils/dist.py", line 985, in run_command
#12 3720.         cmd_obj.run()
#12 3720.       File "/tmp/pip-req-build-f_rgarrq/setup.py", line 169, in run
#12 3720.         self.build_extension(ext)
#12 3720.       File "/tmp/pip-req-build-f_rgarrq/setup.py", line 212, in build_extension
#12 3720.         check_call([self.cmake, ext.project_dir] + cmake_args, cwd=ext.build_dir, env=env)
#12 3720.       File "/opt/conda/lib/python3.8/subprocess.py", line 364, in check_call
#12 3720.         raise CalledProcessError(retcode, cmd)
#12 3720.     subprocess.CalledProcessError: Command '['/usr/bin/cmake', '/tmp/pip-req-build-f_rgarrq', '-DCMAKE_BUILD_TYPE=Release', '-DPYTORCH_INSTALL_DIR=/opt/conda/lib/python3.8/site-packages/torch', '-DPYTHON_EXECUTABLE=/opt/conda/bin/python', '-DCMAKE_INSTALL_PREFIX=/tmp/pip-req-build-f_rgarrq/build/lib.linux-x86_64-3.8', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-req-build-f_rgarrq/build/lib.linux-x86_64-3.8', '-DPYTHON_INCLUDE_DIR=/opt/conda/include/python3.8']' returned non-zero exit status 1.
#12 3720.     Running setup.py install for torch-ipex: finished with status 'error'
#12 3720. Cleaning up...
#12 3720.   Removing source in /tmp/pip-req-build-f_rgarrq
#12 3721. Removed build tracker: '/tmp/pip-req-tracker-e0dhh_29'
#12 3721. ERROR: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-70mkv95j/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.8/torch-ipex Check the logs for full command output.
#12 3721. Exception information:
#12 3721. Traceback (most recent call last):
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
#12 3721.     status = self.run(options, args)
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 395, in run
#12 3721.     installed = install_given_reqs(
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 67, in install_given_reqs
#12 3721.     requirement.install(
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 820, in install
#12 3721.     install_legacy(
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/operations/install/legacy.py", line 70, in install
#12 3721.     runner(
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 271, in runner
#12 3721.     call_subprocess(
#12 3721.   File "/opt/conda/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
#12 3721.     raise InstallationError(exc_msg)
#12 3721. pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-f_rgarrq/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-70mkv95j/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.8/torch-ipex Check the logs for full command output.
------
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to build LLB: executor failed running [/bin/sh -c pip install torchvision==${TORCHVISION_VERSION}+cpu --no-deps     -f https://download.pytorch.org/whl/torch_stable.html &&     pip install lark-parser hypothesis &&     git clone https://github.com/intel/intel-extension-for-pytorch &&     cd intel-extension-for-pytorch && git submodule sync &&     git submodule update --init --recursive &&     git clone https://github.com/pytorch/pytorch &&     cd pytorch && git checkout v1.5.1 && git submodule sync &&     git submodule update --init --recursive &&     git apply ../torch_patches/dpcpp-v1.5.1.patch &&     USE_MKLDNN=1 USE_CUDA=0 USE_NNPACK=0 USE_CUDNN=0     CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" pip install -v . &&     cd .. && pip install -v . && rm -rf *]: runc did not terminate sucessfully
dh@dh-d

DNNL Python OP cannot fallback to CPU

The semantic of DNNL cannot exactly be as same as CPU OP. So we need to fall back to CPU path if DNNL does not support the current OP. (Try/Except)

MKLDNN support for bidirectional LSTM in PyTorch

In the code I don’t see example for MKLDNN for bidirectional LSTMs on CPUs. Also, when I run my code in verbose, I find calls only for MKL not for MKLDNN. I checked my pytorch configuration which shows both MKL and MKLDNN are ON.

Am I missing something or there is no support of MKLDNN for bidirectional LSTMs on CPUs in Pytorch?

I am doing a comparison of LSTMs on Tensorflow/Keras and PyTorch so just want to be sure that I am not missing anything.

[RFC] Memory optimization with memory planning aware memory allocator and memory planning graph pass

Feature

This RFC proposes the following features in order to support memory optimizations like A/B buffer and zero-copy concatenation for IPEX.

  1. Add a memory planning context to IPEX memory allocator. The context carries the information on how to allocate the requested buffer.
  2. Add a JIT graph pass to generate the memory planning context for each JIT op and attach it to each op.
  3. Activate the corresponding memory planning context before executing each op. This context will control how the memory is allocated during the op execution.

Motivation

Memory planning optimization is one of the key optimization techniques to reduce the memory footprint and improve the cache locality for DL workloads. It is particularly useful for improving inference performance where lots of intermediate buffers can be reused immediately after use (e.g. A/B buffer optimization) or memory copy can be shortcut (e.g. zero-copy concatenation).

Pitch

Support memory optimization for IPEX.

Alternatives

Add a graph rewrite pass to convert functional ops to ops with explicit output tensors. Then the memory planning rewrite pass can assign memory to those output tensors via a special "tensor_allocate" op. This approach only needs on graph rewrite and does not depend on runtime (apply context to memory allocator etc.). But it requires to add many new ops if the functional ops do not have their "xyz_out" counterparts. Also code refactoring is needed for these new ops to reuse existing code.

Additional context

Some open questions:

  1. Some ops might allocate temporary buffers internally (we would hope to pool these buffers too) but graph analysis and the resulting memory planning context only cares about the input and output buffers. How to differentiate these two types of allocation? (Note that Tensorflow has allocate_temp and allocate_output to tell them apart but PyTorch does not.)
  2. Alias/mutation op semantics would complicate the analysis. Unclear if there are blocking issues. Is it better to "functionalize" the graph before memory planning analysis?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.