Highly efficient matrix transpose in Mojo
11–20 of 70 posts
Re: Highly efficient matrix transpose in Mojo
#12The "Switching to Mojo gave a 14% improvement over CUDA" title is editorialized, the original is "Highly efficient matrix transpose in Mojo". Also, the improvement is 0.14%, not 14% making the editorialized linkbait particularly egregious.
Re: Highly efficient matrix transpose in Mojo
#13Left unsaid, the 14% improvement in performance came at the cost of increasing dev time by 35%
> "From the moment I understood the weakness of my flesh, it disgusted me. I craved the strength and certainty of steel."
14% all the time vs 35% some of the time
edit: Closing numbers are far less impressive than those buried in the middle of the post. Confusing; bye everyone
Re: Highly efficient matrix transpose in Mojo
#14The "Switching to Mojo gave a 14% improvement over CUDA" title is editorialized, the original is "Highly efficient matrix transpose in Mojo". Also, the improvement is 0.14%, not 14% making the editorialized linkbait particularly egregious.
Re: Highly efficient matrix transpose in Mojo
#15The "Switching to Mojo gave a 14% improvement over CUDA" title is editorialized, the original is "Highly efficient matrix transpose in Mojo". Also, the improvement is 0.14%, not 14% making the editorialized linkbait particularly egregious.
0.14% is within the limits of statistical error. So this is a nothing-"article".
Re: Highly efficient matrix transpose in Mojo
#16Where's the 14%? Looks like their final kernels show a 0.14% improvement of Mojo over the equivalent CUDA kernel?
>(2771.35/2775.49 - 1) * 100 = -.14916285052369131300
Flagged.
Re: Highly efficient matrix transpose in Mojo
#17Where's the 14%? Looks like their final kernels show a 0.14% improvement of Mojo over the equivalent CUDA kernel?
It looks because it does. >(2771.35/2775.49 - 1) * 100 = -.14916285052369131300 Flagged.
"This kernel archives 1437.55 GB/s compared to the 1251.76 GB/s we get in CUDA" (14.8%) which is still impressive
Re: Highly efficient matrix transpose in Mojo
#18Re: Highly efficient matrix transpose in Mojo
#19The "Switching to Mojo gave a 14% improvement over CUDA" title is editorialized, the original is "Highly efficient matrix transpose in Mojo". Also, the improvement is 0.14%, not 14% making the editorialized linkbait particularly egregious.
I think the OP based the title off of "This kernel archives 1437.55 GB/s compared to the 1251.76 GB/s we get in CUDA" (14.8%) and not the final kernels for whatever reason
Re: Highly efficient matrix transpose in Mojo
#20The "Switching to Mojo gave a 14% improvement over CUDA" title is editorialized, the original is "Highly efficient matrix transpose in Mojo". Also, the improvement is 0.14%, not 14% making the editorialized linkbait particularly egregious.
transpose_naive - Basic implementation with TMA transfers
transpose_swizzle - Adds swizzling optimization for better memory access patterns
transpose_swizzle_batched - Adds thread coarsening (batch processing) on top of swizzling
Performance comparison with CUDA: The Mojo implementations achieve bandwidths of:
transpose_naive: 1056.08 GB/s (32.0025% of max)
transpose_swizzle: 1437.55 GB/s (43.5622% of max)
transpose_swizzle_batched: 2775.49 GB/s (84.1056% of max)
via the GitHub - simveit/efficient_transpose_mojo
Comparing to the CUDA implementations mentioned in the article:
Naive kernel: Mojo achieves 1056.08 GB/s vs CUDA's 875.46 GB/s
Swizzle kernel: Mojo achieves 1437.55 GB/s vs CUDA's 1251.76 GB/s
Batched swizzle kernel: Mojo achieves 2775.49 GB/s vs CUDA's 2771.35 GB/s
So there is highly efficient matrix transpose in Mojo
All three Mojo kernels outperform their CUDA counterparts, with the naive and swizzle kernels showing significant improvements (20.6% and 14.8% faster respectively), while the final optimized kernel achieves essentially identical performance (slightly better by 4.14 GB/s).
The "flag" here seemed innapropriate given that its true this implementation is indeed faster, and certainly the final iteration could be improved on further. It wasn't wrong to say 14% or even 20%.