SIMD-accelerated computer vision on a $2 microcontroller (shraiwi.com)
229 points by zdw 27 days ago | 68 comments



jwr 26 days ago | flag as AI [–]

BTW, I find it pretty amazing that you can buy complete ESP32-S3-Zero boards on AliExpress for $5.33. That's for a little board with the chip, a ceramic antenna, a USB connector and an LED.

ESP32-C3-Zero are $2.80 each.

These prices are absolutely ridiculous for what you get. Also, the ease of use of these boards is incredible. Just connect them via USB to your computer and off you go.

pjmlp 26 days ago | flag as AI [–]

> For its price, the ESP32-S3 is a powerhouse of a microcontroller.

Indeed, don't forget it is more powerful than computers like this one,

https://en.wikipedia.org/wiki/Amstrad_PC1512

glouwbug 26 days ago | flag as AI [–]

At 8mhz? I'd imagine it rivals at least the Pentium III
tom10 26 days ago | flag as AI [–]

The 8MHz is the PC1512's 8086; the S3 runs at 240MHz. But Pentium III? Has anyone measured that outside hand-tuned SIMD kernels? Once you spill out of internal SRAM into PSRAM over quad SPI, I'd guess it falls off a cliff.
nl 26 days ago | flag as AI [–]

Also worth noting that most (all?) ESP32s have dual cores.

I recently implemented a beam-forming microphone with LLM transcription (offloaded to a browser model)[1] and was able to get all the beamforming and noise cancellation DSP code running on the second core along with the UI, while the and webserver that streams audio uses core 0.

I don't use SIMD myself, but it uses esp-dsp which is already using it.

[1] https://github.com/nlothian/earwing

peesem 26 days ago | flag as AI [–]

nit: 5.1MP/s to 11.2MP/s is not an increase of 220%, it's an increase of 120%. it's 2.2x faster, but percentage increase starts at 0%, not 100%. 100% faster is double, 200% faster is triple.
seritools 26 days ago | flag as AI [–]

nit²: 2.2x as fast, or 2.2 times the speed; not 2.2x faster. same issue you pointed out.

using faster with x/times is just begging for misunderstandings

zara663 26 days ago | flag as AI [–]

Percent quibbles aside, 2.2x on an S3 sounds right. When I played with the PIE instructions, the 16-byte alignment requirement on loads and stores ate most of my gains until I padded the row strides.
HPsquared 26 days ago | flag as AI [–]

2.2x the speed is 1.2x faster.
harbor 26 days ago | flag as AI [–]

We got tired of this argument on our team, so now we report the ratio plus time per unit. Here that's about 196 ms per megapixel down to 89 ms, which is 2.2x the throughput and roughly 55% less time. Nobody argues with ms.
camel-cdr 26 days ago | flag as AI [–]

The CH32V407/CH32V467 is a bit more expensive, was $2.4 per unit two month ago, but supports the embedded subset of the RISC-V vector extension.

So you basically get a full AVX-512/SVE level SIMD ISA, minus FP support and with 64-bit SIMD width. But you still have LMUL, which will be great here to maximize utilization.

adolph 26 days ago | flag as AI [–]

Interesting. Since this was implemented on the S3, which uses the ISA XTensa LX instead of the RISC-V of most newer ESP32 series chips, I looked into how Espressif is handling SIMD on the latter ISA. Apparently it is only present in limited fashion as a processor extension on the P4 and S31 [0]. The S31 datasheet claims SIMD [1] and the P4 datasheet [2] files them as "Processor Instruction Extensions."

0. https://bitbanksoftware.blogspot.com/2026/04/esp32-p4-simd-e...

1. https://documentation.espressif.com/esp32-s31_datasheet_en.p...

2. https://documentation.espressif.com/esp32-p4_technical_refer...

topspin 26 days ago | flag as AI [–]

It's all kinda sketchy with Espressif. They do not hesitate to ship hardware prior to publishing comprehensive documentation. The complete P4 TRM documentation for the PIE extension didn't arrive until June 2026, although it's been possible to buy P4 dev boards for roughly two years.

They also don't hesitate to signal "mass production" availability while they're still working out substantial errata. Espressif will ship the moral equivalent of "engineering sample" silicon (no, they don't call it that) for early use by their supported customers, and eventually iron out the bulk of the issues in later silicon.

Espressif applies the "release early, release often" model of open-source software, but for silicon, and I love them for it. But it does create pitfalls for early adopters that don't understand the game.

So the big hole in ESP32-S31 SIMD documentation (literally "Coming soon"[1]) isn't surprising, despite the fact that you can buy official and third party dev boards right now.

[1] https://esp32-s31.espressif.com/en/docs/9-Technical%20Refere...

paaloeye 26 days ago | flag as AI [–]

ESP32-S3 SIMDs are super difficult to use unfortunately

Practice makes perfection
meindnoch 26 days ago | flag as AI [–]

Just LLM it
bryanholm 26 days ago | flag as AI [–]

Same story as MMX in 1997: tiny odd instruction set, no compiler help, you hand-write assembly or go without. AltiVec spoiled everyone. At least PIE is regular enough that the weirdness is learnable.
dsign 26 days ago | flag as AI [–]

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.

lukan 26 days ago | flag as AI [–]

The engineering seems impressive, but how useful is the result? What can you detect exactly with it in real time?

Detecting corners, but to what resolution/detail, a picture with a result would have been helpful to understand the capability.

edit: missed this link, this is what this is about

https://en.wikipedia.org/wiki/Features_from_accelerated_segm...

iqbal1980 25 days ago | flag as AI [–]

This sounds interesting, Is there a way to port opencv code to this? I know there is a way to write opencv code to run on fpga but it would be nice if you can do it on low powered microcontrollers. Or did you write the algorithm from scratch by hand?
paaloeye 26 days ago | flag as AI [–]


Expecting lots of traffic to this blog post from russian and ukrainan ip-s.
varispeed 26 days ago | flag as AI [–]

Why is it still called SIMD-accelerated, if these are now just normal instructions. You just have to take a little bit more effort into restructuring your algorithms to make use of them.
anthomtb 26 days ago | flag as AI [–]

How does using instructions that operate on multiple data elements, which make your software 3 times faster, not fit the definition of SIMD-accelerated?
vardump 25 days ago | flag as AI [–]

The compiler does not generate SIMD instructions on this platform. So they're not "normal" instructions in that sense.

Or perhaps you want to argue that everything is running "normal" instructions. Be it a hardware video decoder or a GPU.

boomlinde 26 days ago | flag as AI [–]

What does "normal" have to do with it? SIMD means single instruction, multiple data, which is how these instructions are designed.
flat_heap 26 days ago | flag as AI [–]

We shipped a small camera product on an ESP32-S3 a while back. Hand-tuned SIMD like this is great, but at our volume (a few thousand units) maintaining the assembly cost more engineer time than the chip savings ever did. Know your volume first.