← Back to context

Comment by paaloeye

17 hours ago

ESP32-S3 SIMDs are super difficult to use unfortunately

I find it easier than x86 SIMD[^1], but the lack of support for vector operations for 32 bits makes me very grumpy.

[^1] Though, to be honest, x86 has great automatic SIMD tools so I never had to try too hard.

Just LLM it

  • IME, they’re still pretty bad at getting specific implementation details of SIMD correct. The best I’ve done so far is to harness them to an actual piece of hardware and have them iterate until they see performance improvements but 1) Goodhart’s law, they tend to overfit the benchmark suite and 2) the resulting SIMD often becomes illegible.

    • For a lot of SIMD applications, overfitting isn't really a concern. In my use case I need to calculate the sum of absolute difference between two vectors for autocorrelation, there's no real possibility for overfitting, either it gets the correct answer or it doesn't. LLMs are good at reading through the CPU manual and trying different optimizations.

      The resulting SIMD being illegible isn't an issue in my eyes, assembly isn't a language known for it's readability in general. If you want to really understand what the assembly is doing, ask your LLM to whip up a visualization and explanation tailored to your input data where you can see how each operation leads you to the final result.