Optimize GPU performance

Hello everyone,

My GPU is RTX 5060 which has 3840 physical cores on the hardware. What number should I set to grid_dim and block_dim in Mojo to get the best performance?

This depends a lot on the application, but the block size should at least be a multiple of 32. A decent place to start would beblock_dim=512, grid_dim=ceildiv(problem_size, block_dim). I can strongly recommend watching this video on the topic!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.