TinyCudaNN

摘要: TinyCudaNN是一个用于训练和查询神经网络的小型、自包含框架。最值得注意的是,它包含一个极快的“全融合”多层感知机(技术论文)、一个多功能的多分辨率哈希编码(技术论文),以及对各种其他输入编码、损失函数和优化器的支持。


〓 Table of Contents 〓




源码主页

GitHub - NVlabs/tiny-cuda-nn: Lightning fast C++/CUDA neural network framework

我们需要在源码主页上查询最新版本对于一些硬件条件的支持,例如:

1
2
3
4
5
6
7
8
9
10
Requirements
An NVIDIA GPU; tensor cores increase performance when available. All shown results come from an RTX 3090.
A C++14 capable compiler. The following choices are recommended and have been tested:
Windows: Visual Studio 2019 or 2022
Linux: GCC/G++ 8 or higher
A recent version of CUDA. The following choices are recommended and have been tested:
Windows: CUDA 11.5 or higher
Linux: CUDA 10.2 or higher
CMake v3.21 or higher.
The fully fused MLP component of this framework requires a very large amount of shared memory in its default configuration. It will likely only work on an RTX 3090, an RTX 2080 Ti, or higher-end GPUs. Lower end cards must reduce the n_neurons parameter or use the CutlassMLP (better compatibility but slower) instead.

安装

便捷安装

1
pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

便捷安装能成功的前提条件是上一节中描述的prerequirements都满足。这里需要着重注意cuda版本要满足,同时要在环境变量PATH中存在。 我之前安装老编译失败, 就是忘了export

1
2
export PATH="/usr/local/cuda-11.8/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH"

源码安装

1
2
3
4
5
6
7
8
git clone --recursive https://github.com/nvlabs/tiny-cuda-nn
cd tiny-cuda-nn

cmake . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --config RelWithDebInfo -j

cd bindings/torch
python setup.py install

同样要注意把环境都配置好再进行编译。




作者

Jiawei Li

发布于

2024-06-06

更新于

2024-06-06

许可协议