Remix.run Logo
▲ paaloeye 5 hours ago

ESP32-S3 SIMDs are super difficult to use unfortunately

▲PowerElectronix 3 hours ago | parent | next [-]

Practice makes perfection

▲paaloeye 3 hours ago | parent [-]

true, but nothing is perfect

▲dsign 3 hours ago | parent | prev | next [-]

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.

▲meindnoch 5 hours ago | parent | prev [-]

Just LLM it

▲ballmerpoint 4 hours ago | parent | next [-]

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.

▲TGower 4 hours ago | parent | next [-]

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.

▲pezgordo 2 hours ago | parent | prev [-]

Have you tried including the instructions documentation to the project?

▲ballmerpoint an hour ago | parent [-]

Yes, of course. It doesn’t seem to recall the specific details very well, or confuses them with x86 or ARM instructions that do similar things. And yes, my AGENTS.md says ONLY USE INSTRUCTIONS IN blah.txt.

I dunno, clearly I need an LLM psychiatrist.

▲pezgordo an hour ago | parent [-]

Haha, maybe try different agent/harness which would the closest thing to that.

▲paaloeye 3 hours ago | parent | prev [-]

https://mitchellh.com/writing/everyone-should-know-simd