Skip to content

Transferring a small chunk of data from the Torch model to the cuda memory of re-initializing elements and returning it back.

License

Notifications You must be signed in to change notification settings

AlexTitovWork/torch_cuda_data_transfer

Repository files navigation

The Torch data to cuda transferring.

Transferring a small chunk of data from the Torch model to the cuda memory. Re-initializing elements and returning it back.

USAGE

1. Prepare libtorch folder

Download libtorch from:
https://pytorch.org/get-started/locally/#supported-linux-distributions
- for CPU libtorch-shared-with-deps-1.9.1+cpu.zip
- for GPU libtorch-shared-with-deps-1.9.1+cu102.zip
Place unzipped files to the path_to_libtorch/libtorch:
  ./libtorch_
            |_bin
    |_include
    |_lib
    |_share
    |_build-hash
    |_build-version

2. Compilation with libtorch library folder.


Install CMAKE on you machine(for UBUTU sudo apt-get install cmake )
From terminal:
$ sudo cmake -DCMAKE_PREFIX_PATH=/home/path_to_libtorch/libtorch
terminal logs:
_search_engine_CUDA/torch_cuda/libtorch
-- Configuring done
-- Generating done
-- Build files have been written to:

3. Build release file:

$ sudo cmake --build . --config Release
terminal logs:
[ 40%] Built target particles_new_lib
[100%] Built target particle_cuda_test

Additional links. https://pytorch.org/tutorials/advanced/cpp_export.html

About

Transferring a small chunk of data from the Torch model to the cuda memory of re-initializing elements and returning it back.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published