Thanks a lot for replying. Completely understand the difficulty of debugging.
I’m building/linking against headers/libs out of the conda environment I’m testing in (and tried in a docker), so not quite sure how they’d be out of sync, unless I’m missing something there.
I have now put up the source for the extension. There’s a setup.py (and Dockerfile I also tested against). As noted the error is only on import so:
$ pip install git+https://github.com/thomasbrandon/mish-cuda && python -c "import mish_cuda"
:Collecting git+https://github.com/thomasbrandon/mish-cuda
<snip>
ImportError: /home/user/dev/mish-cuda/.venv/lib/python3.7/site-packages/mish_cuda/_C.cpython-37m-x86_64-linux-gnu.so:
undefined symbol: _ZN2at6native6legacy4cuda27_th_copy_ignoring_overlaps_ERNS_6TensorERKS3_

And here’s an inline JIT reproduction (just directly using the function causing issues not the CUDA_tensor_apply which is actually what I care about): Gives me the same error as above.
#!/usr/bin/env python
from torch.utils.cpp_extension import load_inline
src = """
#include <ATen/LegacyTHFunctionsCUDA.h>
void import_test(torch::Tensor x, const torch::Tensor y) {
    auto z = at::native::legacy::cuda::_th_copy_ignoring_overlaps_(x, y);
}
"""
mod = load_inline(name='import_error_test', cpp_sources=src, functions='import_test')

I’ll also try and replicate against libtorch to see if it’s just an extension issue (though as it also looks to dynamically link I suspect not, statically linking may behave differently, on my minimal knowledge here). Just need to get on top of the process there.
One thing I’m a bit unclear on is exactly what is supposed to be externally usable in PyTorch, if I was more sure this was externally usable and it wasn’t a system config error at my end I’d submit an issue. Ideally I’d submit a PR but I struggle a bit to understand how exactly the declaration generation stuff works in PyTorch.
It is defined in src/Aten/Declarations.cwrap and does appear in the generated include/ATen/LegacyTHFunctionsCUDA.h.
So just some confirmation there would be great. Or pointers about what parts in the generation process I might look at.