pytorch / functorch

functorch is JAX-like composable function transforms for PyTorch.
https://pytorch.org/functorch/
BSD 3-Clause "New" or "Revised" License
1.39k stars 102 forks source link

libtorch #767

Open mkolodziejczyk-piap opened 2 years ago

mkolodziejczyk-piap commented 2 years ago

Hi, are there any plans for C++ libtorch interface? Regards,

Chillee commented 2 years ago

Currently, there are no plans. Do you have a particular use case for this?

mkolodziejczyk-piap commented 2 years ago

Basicly, C++ development. I want to speed up tensor manipulation/computation/autodiff. There's an option to use https://arrayfire.com and https://github.com/flashlight/flashlight , but I'd like smth more JAX-like. Could you please briefly describe what is needs to be done to prepare C++ interface?

hugary1995 commented 2 years ago

+1 for the c++ interface. My use case is to get per batch Jacobian (and possibly higher order derivatives).

I am not sure why the entire ATen/functorch is out-of-tree. For now, I am going through the annoying route of compiling from source and then copying the ATen/functorch into my project. Writing the actual c++ version of vmap is just 20 lines of code (assuming all arguments are flattened tensors), but mirroring all the stuff like DynamicLayer and TensorWrapper gives me headache.

Well, that was a long way of saying I'd appreciate a native c++ interface.