Re: KaTrain Questions
Posted: Tue Jun 06, 2023 10:42 pm
* You don't need to do anything to make KataGo use tensor cores, and there's not a great way to be absolutely sure whether it does or not, unless you use OpenCL. The OpenCL version will tell you if it's using tensor cores or not as it runs the tuning the first time you run it. Look at the tuning output as it tunes each operation reporting various performance stats and you'll see a section where it tunes (or fails to tune) for tensor cores and whether or not it decides to use them. The CUDA and TensorRT versions just call Nvidia's libraries and those libraries determine what to do by their own underlying magic, and you just have to trust whatever they are doing. Unlike the OpenCL, KataGo has little to no control over it. If CUDA or TensorRT version runs and works without crashing, then that's probably what you're going to get and that's it. So I recommend not worrying about whether it uses tensor cores or whatever or even trying to find that out because *you* also have little to no control over such low-level details, just benchmark each thing and see what finally gives the best visits/s (./katago.exe benchmark).
* KataGo has *always* historically had separate TensorRT and CUDA versions, and the same is true now, it's just that v1.13.0 had a bug with TensorRT (*NOT* a bug with tensor cores, tensor cores and TensorRT are completely different things with no particular relationship to each other), so it got its own release v1.13.1 with a fix, whereas all other versions (OpenCL, Eigen, CUDA) were not because they had no difference. Use TensorRT if you want to attempt Nvidia black magic, which goes beyond even the CUDA version by doing some secret Nvidia proprietary magic optimization of different layers of operations and such, which neither you or I have control over, which if it works, might squeeze out a bit more performance at the cost of much longer startup and loading times. Otherwise, just use whatever version works for you. CUDA is fine if you've installed CUDA. OpenCL is fine too, and has a decent chance of working right out of the box, it comes zipped with all the DLLs already that it should need.
* It's been a long time since I tried to install this stuff on Windows. I think that once you have the right drivers, "installation" consists of just having the right DLLs in your path, which are some some CUDA and CUDNN dlls for CUDA, or some DLL with "nvinfer" in the name for TensorRT ("nvinfer" is Nvidia's technical name for TensorRT that it uses for filenames or some technical docs). So, don't trust me on this too much since it's been a while, but I think for example that one could even crudely find the appropriate DLLs from digging into the installation folders and just copy them into the katago executable directory (since Windows also normally considers the local directory of an exe to be a search location for DLLs for that exe).
* KataGo has *always* historically had separate TensorRT and CUDA versions, and the same is true now, it's just that v1.13.0 had a bug with TensorRT (*NOT* a bug with tensor cores, tensor cores and TensorRT are completely different things with no particular relationship to each other), so it got its own release v1.13.1 with a fix, whereas all other versions (OpenCL, Eigen, CUDA) were not because they had no difference. Use TensorRT if you want to attempt Nvidia black magic, which goes beyond even the CUDA version by doing some secret Nvidia proprietary magic optimization of different layers of operations and such, which neither you or I have control over, which if it works, might squeeze out a bit more performance at the cost of much longer startup and loading times. Otherwise, just use whatever version works for you. CUDA is fine if you've installed CUDA. OpenCL is fine too, and has a decent chance of working right out of the box, it comes zipped with all the DLLs already that it should need.
* It's been a long time since I tried to install this stuff on Windows. I think that once you have the right drivers, "installation" consists of just having the right DLLs in your path, which are some some CUDA and CUDNN dlls for CUDA, or some DLL with "nvinfer" in the name for TensorRT ("nvinfer" is Nvidia's technical name for TensorRT that it uses for filenames or some technical docs). So, don't trust me on this too much since it's been a while, but I think for example that one could even crudely find the appropriate DLLs from digging into the installation folders and just copy them into the katago executable directory (since Windows also normally considers the local directory of an exe to be a search location for DLLs for that exe).