SIMD-accelerated computer vision on a $2 microcontroller

(shraiwi.com)

101 points | by zdw 20 hours ago

7 comments

  • lukan 0 minutes ago
    The engineering seems impressive, but how useful is the result? What can you detect exactly with it in real time?
  • jwr 1 hour ago
    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.

    • htrp 32 minutes ago
      what do you do with them?
  • pjmlp 3 hours ago
    > 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

    • asimeqi 2 hours ago
      That was my exact first computer with the CGA graphics, GEM Desktop, Locomotive Basic etc. All the software came in 4 360KB diskettes. The diskettes had each it's own beautiful color. There were 3 sample Basic programs that seemed to me quite advanced. One sample was a document management system. Another was a drawing program where you could draw with a mouse. Didn't know that GEM Desktop was made by Digital Reasearch. It was a very good windowing system. I believe it was based on MS-DOS. There was also a CP/M OS. So much software in only 1.2MB.
      • sedatk 44 minutes ago
        I dearly remember the keyboard's warm red Caps Lock light and my sessions of running Print Master and writing BASIC programs on it.
      • pjmlp 1 hour ago
        Exactly, thanks for sharing.
    • MeteorMarc 1 hour ago
      We will see the day your toothbrush has more compute than the original IBM PC.
    • glouwbug 1 hour ago
      At 8mhz? I'd imagine it rivals at least the Pentium III
      • pavlov 1 hour ago
        Well, probably not, but maybe a plain Pentium?

        The Pentium III was a superscalar core that scaled up to 1.4 GHz. This microcontroller is max 240 MHz and does less work per cycle.

      • pjmlp 1 hour ago
        Probably, I was use this example because I feel youngers can't imagine how much we could do with such MS-DOS class computer, even within its limitations.

        So naturally an ESP32 can do so much more.

  • peesem 3 hours ago
    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 2 hours ago
      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

    • HPsquared 39 minutes ago
      2.2x the speed is 1.2x faster.
  • paaloeye 2 hours ago
    ESP32-S3 SIMDs are super difficult to use unfortunately
    • dsign 56 minutes ago
      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.

    • PowerElectronix 1 hour ago
      Practice makes perfection
      • paaloeye 1 hour ago
        true, but nothing is perfect
    • meindnoch 2 hours ago
      Just LLM it
      • ballmerpoint 2 hours ago
        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 2 hours ago
          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 25 minutes ago
          Have you tried including the instructions documentation to the project?
      • paaloeye 1 hour ago
  • paaloeye 1 hour ago
  • varispeed 36 minutes ago
    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.