https://github.com/cwsmith/kokkospytorch
kokkos + pytorch
https://github.com/cwsmith/kokkospytorch
Last synced: about 1 year ago
JSON representation
kokkos + pytorch
- Host: GitHub
- URL: https://github.com/cwsmith/kokkospytorch
- Owner: cwsmith
- License: bsd-3-clause
- Created: 2020-11-17T21:04:09.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-18T20:53:39.000Z (over 5 years ago)
- Last Synced: 2025-03-01T00:39:15.968Z (over 1 year ago)
- Language: C++
- Size: 81.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kokkosPytorch
kokkos + pytorch
## create conda env
```
module use /opt/scorec/spack/v0154/lmod2/linux-rhel7-x86_64/Core
module load anaconda3
conda create --prefix ./env
conda init bash
# take the lines out of ~/.bashrc and put them into `setupConda.sh`
source setupConda.sh
conda activate ./env
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi
typing_extensions future six requests dataclasses
```
## build libtorch
```
module use /opt/scorec/spack/v0154/lmod2/linux-rhel7-x86_64/Core
module load anaconda3
source /path/to/setupConda.sh
module load gcc cmake # we want gcc 7.3
```
then follow the instructions here:
https://github.com/pytorch/pytorch/blob/master/docs/libtorch.rst#building-libtorch-using-cmake
Note, this enables AVX512, MKL, and some other features our machines (or yours) don't have. These can be disabled in the cmake command.
## build kokkos pytorch example
```
git clone git@github.com:cwsmith/kokkosPytorch.git
mkdir buildKkPytorch
cd $_
export CMAKE_PREFIX_PATH=/path/to/pytorch/install/dir
module load gcc cmake
cmake ../kokkosPytorch
make -j8
./hello-world ../kokkosPytorch/model.pt
```