Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

"unknown builtin op" error with static library #17984

Open
sausax opened this issue Mar 13, 2019 · 3 comments
Open

"unknown builtin op" error with static library #17984

sausax opened this issue Mar 13, 2019 · 3 comments
Assignees
Labels
module: cpp Related to C++ API triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@sausax
Copy link

sausax commented Mar 13, 2019

Getting error while running libtorch example from https://pytorch.org/tutorials/advanced/cpp_export.html . Getting error only with static library. Shared library works fine.

./libtorch_test model.pt
terminate called after throwing an instance of 'torch::jit::script::ErrorReport'
  what():
unknown builtin op:

def mul(a : float, b : Tensor) -> Tensor:
  return b * a
         ~~~~~ <--- HERE
def add(a : float, b : Tensor) -> Tensor:
  return b + a
def ne(a : float, b : Tensor) -> Tensor:
  return b != a
def eq(a : float, b : Tensor) -> Tensor:
  return b == a
def lt(a : float, b : Tensor) -> Tensor:
  return b > a
def le(a : float, b : Tensor) -> Tensor:
Aborted (core dumped)

Command used to compile libtorch_test

LIBTORCH = /pytorch/torch/lib/tmp_install

g++ -I"$LIBTORCH/include" -I"$LIBTORCH/include/torch/csrc/api/include" -D_GLIBCXX_USE_CXX11_ABI=0 -std=gnu++11 libtorch_test.cpp -o libtorch_test -L"$LIBTORCH/lib"  -ltorch -lcaffe2  -lc10 -lc10d -lTHD -fopenmp -lpthread -lrt -lm -lsleef  -llapack -lblas -lcpuinfo -lclog -lprotobuf -lonnx -lonnx_proto -lcaffe2_protos 

Environment

  • PyTorch Version: 1.0.1:
  • OS: Redhat Linux:
  • Build command:
    EXTRA_CAFFE2_CMAKE_FLAGS="-DTORCH_STATIC=1 -DBUILD_SHARED_LIBS=OFF -DUSE_CUDA=0" python ../tools/build_libtorch.py

cc @yf225

@driazati driazati added oncall: jit Add this issue/PR to JIT oncall triage queue module: cpp Related to C++ API labels Mar 14, 2019
@suo
Copy link
Member

suo commented Mar 19, 2019

@yf225 any idea here? Seems like certain ops aren't getting registsred in the cpp build.

@ckhazan
Copy link

ckhazan commented Jul 12, 2019

Any updates here please? Having exact same issue.

@suo suo removed the oncall: jit Add this issue/PR to JIT oncall triage queue label Oct 3, 2019
@jerryzh168
Copy link
Contributor

@yf225 what's the plan on this?

@jerryzh168 jerryzh168 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cpp Related to C++ API triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

6 participants