NVIDIA / NVIDIA/apex

Undefined symbol _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E

Open
#701 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

Hi,
I'm getting an undefined symbol _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E when running amp.initialize(...).

$ ipython3

In [1]: import torch, torchvision 
     ...: from apex import amp 
     ...: model = torch.nn.Linear(1024, 512).cuda() 
     ...: optimiser = torch.optim.SGD(model.parameters(), lr=1e-3) 
     ...: model, optimiser = amp.initialize(model, optimiser, opt_level='O2')
Selected optimization level O2:  FP16 training with FP32 batchnorm and FP32 master weights.

Defaults for this optimization level are:
enabled                : True
opt_level              : O2
cast_model_type        : torch.float16
patch_torch_functions  : False
keep_batchnorm_fp32    : True
master_weights         : True
loss_scale             : dynamic
Processing user overrides (additional kwargs that are not None)...
After processing overrides, optimization options are:
enabled                : True
opt_level              : O2
cast_model_type        : torch.float16
patch_torch_functions  : False
keep_batchnorm_fp32    : True
master_weights         : True
loss_scale             : dynamic
Warning:  multi_tensor_applier fused unscale kernel is unavailable, possibly because apex was installed without --cuda_ext --cpp_ext. Using Python fallback.  Original ImportError was: ImportError('/home/brett/.local/lib/python3.7/site-packages/amp_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E')

Apex is built on an up-to-date Ubuntu 19.10 installation with CUDA 10.1, gcc 9.2.1 and nvcc 10.1.243 using gcc 8.3.0 as the ccbin (see https://github.com/NVIDIA/apex/issues/278#issuecomment-581789063).

Due to pip's habit of removing temporary build directories, I haven't been able to figure out where this symbol originates or what library should contain the symbol (libcaffe.so seemed likely, but I couldn't find the symbol there).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the amp.initialize(...) path and the amp_C extension mentioned in the warning. Inspect how Apex is built with --cuda_ext --cpp_ext and identify which linked library should provide _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E. Done means the extension imports without the undefined-symbol error and the fused unscale kernel is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
build-system, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.