conda-forge / tensorflow-feedstock

A conda-smithy repository for tensorflow.
BSD 3-Clause "New" or "Revised" License
92 stars 81 forks source link

Document differences between `libtensorflow` & `libtensorflow_cc` #172

Open h-vetinari opened 2 years ago

h-vetinari commented 2 years ago

I was wondering about this in the context of https://github.com/conda-forge/staged-recipes/pull/16888, and the recipe here doesn't contain much information, IMO.

This part of the recipe predates my involvement, perhapse @njzjz or someone else from @conda-forge/tensorflow who knows can fill in some gaps?

IMO that could just be a comment in the meta.yaml, but we can also add something to the package-descriptions

njzjz commented 2 years ago

One is C library and another one is C++ library.

h-vetinari commented 2 years ago

Thanks for the quick response... But C++ can use C libraries, so is the C++ lib a superset of the C lib? If not, why?

Also, do both contain CUDA? libtensorflow_cc doesn't seem to use a cuda-compiler, but it has a bigger file footprint than libtensorflow. I realise that there are likely many things (including the naming?) that are coming from upstream, but all that should IMO be obvious (at least) from looking at the meta.yaml

njzjz commented 2 years ago

C API: https://www.tensorflow.org/install/lang_c https://github.com/tensorflow/tensorflow/blob/master/tensorflow/c/c_api.h

C++ API: https://www.tensorflow.org/api_docs/cc

In fact, TensorFlow's C API is based on the C++ API, but just rewrites the interface. They have the same core.

So both of them supports CUDA (built by bazel).

h-vetinari commented 2 years ago

In fact, TensorFlow's C API is based on the C++ API, but just rewrites the interface. They have the same core.

Cool thanks. Do you see a chance that we could share "the same core" here between the two libraries? As it is, both are pretty heavyweight at 250-300MB, and that sounds like unnecessary duplication.

njzjz commented 2 years ago

In fact, TensorFlow's C API is based on the C++ API, but just rewrites the interface. They have the same core.

Cool thanks. Do you see a chance that we could share "the same core" here between the two libraries? As it is, both are pretty heavyweight at 250-300MB, and that sounds like unnecessary duplication.

Two libraries are defined here: https://github.com/tensorflow/tensorflow/blob/fd72ea470038a431ddfafd7510c307362a775cab/tensorflow/BUILD#L986-L1063