TensorComprehensions icon indicating copy to clipboard operation
TensorComprehensions copied to clipboard

Question about how to integrate TC to my project

Open SharonLi01 opened this issue 7 years ago • 1 comments

TensorComprehensions is a great lib, it saves a lot of work of writing CUDA kernel and finetune, so I attempt to integrate TC to my Framework. But I am curious about how to integrate TC to my Framework. I saw that build.sh has make install, but the install path include only has gtest.

|-- include
|   `-- gtest
|       |-- gtest-death-test.h
|       |-- gtest-message.h
|       |-- gtest-param-test.h
|       |-- gtest-param-test.h.pump
|       |-- gtest-printers.h
|       |-- gtest-spi.h
|       |-- gtest-test-part.h
|       |-- gtest-typed-test.h
|       |-- gtest.h
|       |-- gtest_pred_impl.h
|       |-- gtest_prod.h
|       `-- internal
|           |-- custom
|           |   |-- gtest-port.h
|           |   |-- gtest-printers.h
|           |   `-- gtest.h
|           |-- gtest-death-test-internal.h
|           |-- gtest-filepath.h
|           |-- gtest-internal.h
|           |-- gtest-linked_ptr.h
|           |-- gtest-param-util-generated.h
|           |-- gtest-param-util-generated.h.pump
|           |-- gtest-param-util.h
|           |-- gtest-port-arch.h
|           |-- gtest-port.h
|           |-- gtest-string.h
|           |-- gtest-tuple.h
|           |-- gtest-tuple.h.pump
|           |-- gtest-type-util.h
|           `-- gtest-type-util.h.pump
`-- lib
    |-- libgtest_maind.a
    |-- libgtestd.a
    |-- libtc_aten.so
    |-- libtc_autotuner.so
    |-- libtc_core.so
    |-- libtc_core_cpu.so
    |-- libtc_core_cuda_no_sdk.so
    |-- libtc_cuda.so
    |-- libtc_lang.so
    |-- libtc_proto.so
    `-- pkgconfig
        |-- gflags.pc
        |-- gtest.pc
        `-- gtest_main.pc

I use ubuntu 16.04.

SharonLi01 avatar Nov 09 '18 16:11 SharonLi01

Hello @SharonLi01,

My apologies for the long delay, I am sorry to say that the core TC team has moved on to other things. As far as I know the project is not maintained anymore but someone from Facebook should voice in, I am not in a position to speak for them.

On to your specific question, it depends what language you want.

For C++ you essentially need to do 2 things:

  1. port tc/aten/ to your C++ tensor library (or just use Pytorch's ATen, but the caveat is you must use PyTorch 0.3's ATen version for);
  2. call TC directly using the interfaces in tc/aten/aten_compiler.h and tc/aten/aten_autotuner.h You can reproduce the above easily by just looking at how tc/examples/tensordot.cc works, it should be pretty straightforward.

For Python, you need to do the above and additionally port tensor_comprehensions/pybinds/ to your tensor library/framework as well as the python parts of tensor_comprehensions/

For my information, what is your framework of choice?

All the best!

N

nicolasvasilache avatar Nov 16 '18 19:11 nicolasvasilache