Problem
I’m learning Rust coming from Python by doing a difficult project, and while I can crawl through the difficult terrain, I can not make informed decisions on what a good path to take is. I’ll be using Burn for a neural net soon, and what I need is insight into the different backends and their abilities, so I can pick a good path.
Here are the factors at play:
- I’m making a chess engine.
- The chess engine will use a tree search, where a neural net on my GPU evaluates positions.
- Almost all chess logic is being done with bitwise operations on u64s, utilizing a precomputed array of u64s.
- The heavy u64 focus had a twofold motive
- Gamestates can be represented with 8 u64s and a few small positive integers, which the hope is to be able to convert to a boolean tensor and feed into the neural net as directly as possible.
- That the GPU could also do the chess logic instead of just evaluation, operating on a ton of u64s in parallel to create new gamestates faster than the CPU would. (or just for fun, really)
My thoughts and questions:
- Can Burn with an appropriate back end do these bitwise calculations on u64s? If not, can I use WGPU directly for that?
- What’s a good way to convert u64s into boolean tensors for the neural net using Burn.
- Here it seems that the backend is defined with one float type and one integer type. Is that always the case? If so, I worry that I would need to define the integer as unsigned, and lose out on negative integers.
- Do I need to touch any C++ with the LibTorch backend? Because I can not learn Rust and C++ at the same time, but I know there are bitwise functions in PyTorch, but really I would prefer WGPU if it can do the bitwise things, but having LibTorch available as a last resort would be nice.
I recognize this is both broad and niche, but any insight is valuable here. Thanks in advance!