by w-m · 4y ago · 0 comments
I haven't looked at implementing these things, but I imagine uf you have smaller networks and thus less data, the large building blocks may not be optimal. You may for example want to fuse some operations to reduce memory latency from repeated memory access.
In PyTorch world, there are approaches for small networks as well, there is https://github.com/NVlabs/tiny-cuda-nn - as far as I understand from the first link in the README, it makes clever use of the CUDA shared memory, which can hold all the weights of a tiny network (but not larger ones).
Warning: FullyFusedMLP is not supported for the selected architecture 70. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
Warning: FullyFusedMLP is not supported for the selected architecture 70. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
Initial Train Loss: 5.7188
Initial Test Loss: 5.2812
Took: 11.41 seconds
Train Loss: 0.0354
Test Loss: 0.0514
Took: 11.58 seconds
Train Loss: 0.0327
Test Loss: 0.0511
Took: 11.42 seconds
Train Loss: 0.0316
Test Loss: 0.0505
I think almost of the time here is python overhead because if we increase the batch size 10x, it still takes the same time: Warning: FullyFusedMLP is not supported for the selected architecture 70. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
Warning: FullyFusedMLP is not supported for the selected architecture 70. Falling back to CutlassMLP. For maximum performance, raise the target GPU architecture to 75+.
Initial Train Loss: 5.5391
Initial Test Loss: 5.5938
Took: 11.03 seconds
Train Loss: 0.0444
Test Loss: 0.0545
Took: 11.16 seconds
Train Loss: 0.0388
Test Loss: 0.0496
Took: 11.01 seconds
Train Loss: 0.0384
Test Loss: 0.0490
See [gist](https://gist.github.com/rejuvyesh/6c428ea12154edbb36cd4359fa...) for the implementation.