Open i10416 opened 1 year ago
Ah, I overlooked local development guide. I'll try again.
Following https://github.com/microsoft/scala_torch#local-development-macos, I still got error(libtorch 1.13.1)
/path/to/scala_torch/swig/target/src_managed/native/torch_swig.cxx:706:10: fatal error: 'ATen/CUDAGeneratorImpl.h' file not found
[error] #include <ATen/CUDAGeneratorImpl.h>
[error] ^~~~~~~~~~~~~~~~~~~~~~~~~~
sbt runs the following cmd
swig -DSWIGWORDSIZE64 -v -c++ -java -package com.microsoft.scalatorch.torch.internal -Ipath/to/scala_torch/libtorch/include -I/path/to/scala_torch/libtorch/include/torch/csrc/api/include -o /path/to/scala_torch/swig/target/src_managed/native/torch_swig.cxx -outdir /path/to/scala_torch/swig/target/src_managed/com/microsoft/scalatorch/torch/internal /path/to/scala_torch/swig/src/main/swig/torch_swig.i
and there exists CUDAGeneratorImpl.h
find pytorch -name CUDAGeneratorImpl.h
pytorch/aten/src/ATen/CUDAGeneratorImpl.h
find libtorch -name CUDAGeneratorImpl.h
libtorch/include/ATen/cuda/CUDAGeneratorImpl.h
libtorch/include/ATen/cuda/CUDAGeneratorImpl.h
CUDAGeneratorImpl.h is in ATen/cuda/CUDAGeneratorImpl.h
š¤ Perhaps, libtorch has different package structure depending on torch version?
downgrading libtorch to 1.10.2( https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.10.2.zip) solved 'ATen/CUDAGeneratorImpl.h' file not found
error, but then I got linker error.
[error] ld: symbol(s) not found for architecture arm64
[error] clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
It seems arm64 is not supported?
(edited) using libtorch 1.10.2( https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.10.2.zip) on arm64 darwin
using libtorch 1.13.1(https://download.pytorch.org/libtorch/cpu/libtorch-macos-1.13.1.zip) on arm64 darwin
hindsight
environment
reproduction
What I did for now are the followings
git clone git@github.com:microsoft:scala_torch.git --recursive
TORCH_DIR
pathrunbazel build generated_cpp
at pytorch dir to get Declarations.yaml for bindgen.pypython3 -m tools.codegen.gen -s aten/src/ATen -d torch/share/ATen
putDeclarations.yaml
fromscala_torch/pytorch/bazel-bin/aten/src/ATen/Declarations.yaml
topytorch/torch/share/ATen/Declarations.yaml
and I got