New build

Last year, I spent a few weeks dabbling in machine learning, which remains an interesting area to explore though not directly related to my day-to-day work. Although the economics generally work in favor of doing ML in the cloud, there’s something to be said for having all of your code and data local and not having to worry about shutting down virtual hosts all the time. My 10+ year old PC just doesn’t cut it for ML tasks, and so I made a new one.

The main requirements for me are lots of cores (for kernel builds) and a hefty GPU or four (for ML training). For more than two GPUs, you’re looking at AMD Threadrippers; for exactly two you can go with normal AMD or intel processors. The Threadrippers cost about $500 more factoring in the motherboard. I decided that chances of me using more than two GPUs (or even more than one) were pretty darn slim and not worth the premium.

In the end I settled on a 12-core Ryzen 9 3900X with RTX 2070 GPU coming in around $1800 USD with everything. Unfortunately, in this arena everything is marketed to gamers, so I have all kinds of unasked-for bling from militaristic motherboard logos to RGB LEDs in the cooler. Anyway, it works.

Just to make up a couple of CPU benchmarks based on software I care about:

filling a 7x7 word square (single core performance)
~~~~~~~~~~
old:
real	0m10.689s
user	0m10.534s
sys	0m0.105s

new:
real	0m2.274s
user	0m2.243s
sys	0m0.016s

allmodconfig kernel build
with -j $CORES_TIMES_TWO (multicore performance)
~~~~~~~~~~
old:
real	165m11.219s
user	455m42.557s
sys	135m37.557s

new:
real	9m31.778s
user	193m31.477s
sys	23m19.117s

This is all with stock clock settings and so on. I haven’t tried ML training yet, but the speedup there would be +inf considering it didn’t work at all on my old box.

Virtual doorbell

We had some cameras installed at our house last year, partly for security, but mainly so we could know who is at the door before answering it in our PJs. Unfortunately, the software that comes with the camera DVR is pretty clunky, so it takes way too long to bring up the feed when the doorbell rings and I often don’t bother.

Luckily, the DVR exposes RTSP streams that you can capture and playback with your favorite mpeg player. And I just learned how to build a pretty good image classifier that needed a practical application.

A ridiculously good-looking person is at the door

Thus, I built an app to tell whether someone is at the door, before they ring the bell. I labeled some 4000 historical images as person or non-person, trained a CNN, and made a quick python app to run inference on the live feed. When a person is in range of the door camera, it aims the lasers tells you so.

Doorbell MVP

Not bad for having two whole weeks of deep learning under my belt. The interface could stand to be much better, of course. A little web page that sends a browser notification and link to the image or live feed would be the obvious next step. Perhaps the lasers are after that.

I know this is something that comes out of the box with commercial offerings such as Ring, but at least my images aren’t being streamed to the local police.

Uprooting

Summer came late and is leaving early this year, so it’s about harvest time now. This year, I did some radishes, onions, salad greens, carrots, green beans, jalapenos, bell peppers, basil, and tomatoes. Most of the carrots didn’t grow long roots, but I got a few. The rabbits got to the peppers and green beans before I did, while leaving the lettuce mostly alone — I realized when I had a dozen full heads that we just don’t eat that much salad, so a lot of it bolted in the end. Now I know what 4-foot tall red lettuce looks like.

Not planted this time were tomatillos, but I had a bunch of vines grow from last year’s seeds anyway. I have been pulling up most of those while keeping one large bush for possible salsa verde in a month or so.

Anyhow, I got enough produce to make a few jars of red salsa (when supplemented with some store-bought locally grown tomatoes), and I didn’t work as hard at it this year as previously, so I’m calling it a win.

In a few weeks I’ll be pulling up all the remaining plants, and trying to get a cover crop started, which is something I didn’t know about until recently.

In other uprooting news: I previously wrote a post about ending my engagement at facebook. I dropped that post, because the reasons aren’t actually very interesting and that bridge has plenty of water under it by now. But the outcome of all of that is that I’ll be starting at Amazon next week, in an actual, real live office. That last part is going to be a bit of a trial: after ten years of working from home, I’m not especially looking forward to commuting downtown, and it will certainly be a stress on the family to rearrange our schedules to accommodate that. But it will be nice to have non-virtual coworkers for a change, and I’m excited about tackling some of the challenges facing my new team.

In which I trained a neural net

The entire sum of my machine learning experience thus far is a couple of courses in grad school, in which I wrote a terrible handwriting recognizer and various half-baked natural language parsers. As luck would have it, I was just a couple of years too early for the Deep Learning revolution — at the time support vector machines were all the rage — so I’ve been watching the advancements of the last few years with equal measures idle interest and bewilderment. Thus, when I recently stumbled across the fast.ai MOOC, I couldn’t resist following along.

I have to say I really enjoy the approach of “use the tools first, then learn the theory.” In the two days since I started the course, I already built a couple of classifiers and got very good results, much more easily than with my handwriting recognizer of yore.

My first model was trained on 450 baby pictures of my children and achieved 98% accuracy. Surprisingly, the mistakes did not confirm our priors, that Alex and Sam look most similar as babies — instead it tended to confuse them both with Ian. The CNN predicts that I am 80% Alex. Can’t argue with that math.

The second classifier was trained on Pokemon, Transformers, and Jaegers (giant robots from Pacific Rim). This gets about 90% accuracy; not surprisingly, it has a hard time telling apart the robot classes, but has no trouble picking out the Pokemons.

I’m still looking for a practical application, but all in all, it’s a fun use for a GPU.

New Directions in Commandline Editing

Update: I finally isolated this to gnome’s multiple input method support. Shift + Space is bound by default to switch input sources, and it is in whatever the next input method is that unusual things happen. Turn that stuff off in the keyboard shortcuts! Find below the original post about the visible symptoms.

Dear lazyweb,

Where in {bash, readline, gnome terminal, wayland, kernel input} does the following brain damage, newly landed in debian testing, originate?

  • pressing ctrl-u no longer erases to beginning of line, but instead starts unicode entry with a U+ prompt, much like shift-ctrl-u used to do, except the U is upper-cased now
  • hitting slash twice rapidly underlines the first slash (as if to indicate some kind of special entry prompt, but one I’m unfamiliar with and I cannot get it to do anything useful anyhow), and then just eats the second slash and the underline goes away
  • characters typed quickly (mostly spaces) get dropped

This stuff is so hard to google for and it is killing my touch typing. Email me if you know, and I’ll update this accordingly so that maybe google will know next time.

Playing With Flash

I recently picked up one of these $10 CH341A USB flash programmers and a test clip. I didn’t really have any initial plans for that it but thought it might come in useful someday while messing with router bootloaders. This unexpectedly turned out to be a lot of fun so far and not a bad tool for the price.

Rummaging through my parts bin, I found a Winbond 4K SPI flash of unknown provenance, hooked it up, and read out the contents with flashrom. Turns out this was an AMI BIOS that I pulled from some motherboard way back when. Disassembling the BIOS might make a good rainy day exercise.

I tried using chavrprog to program an ATTiny13, which did not work at all. The chip did not appear to respond to any of the SPI commands. Oh well.

On a bricked router I had sitting around, I read the flash directly from the board using the test clip. I happen to remember the confluence of events that lead to me bricking this (writing bootloader to wrong partition), and could finally verify the damage on the flash dump. When I get a free moment, I’ll try bringing it back to life by reflashing a repaired image.

On a different model, unbricked router, reading out the flash on the board didn’t work. Applying power to the flash chip powered up other components on the board, so I’m guessing I’d have to desolder this flash chip in order to read/write it. Maybe worth retrying after spending a few weeks practicing SMT rework.

Planting time

With the terribly cold and gray winter finally starting to abate, I’m going to start my indoor seeds this week. Nearly same setup as last year: I’m sowing the head-start seeds indoors, to go under basement grow lights in a couple of weeks when they have sprouted. A new addition is this heating mat, which I had to laugh at because of the prominently featured cannabis leaves on the package. I wonder just what the distribution of carrot growers to “other” is, now that it’s legal here.

For any curious persons or LEOs reading, no, I’m not planting weed. I’ll be starting basil, tomatoes, peppers, and lettuce in flats, and hopefully it will be warm enough to direct sow carrots and radishes. Beans should come a little later. Can’t wait!

2019 Crossword Tournament

The American Crossword Puzzle Tournament starts this weekend. Once again, a version of my xword webapp is being used, with only a few minor changes since last time (sorry).

I did almost no puzzling last year, so I’ll give it a go, but I’m not expecting to finish in the top 100 this time around. Good luck to anyone participating!

More filler

I noticed some HTML5 crossword construction apps have sprung up over the last year, so I no longer have first mover status on that. Also their UIs are generally better and I dislike UI work, so it seemed reasonable to join forces. Thus, I sent some PRs around.

It was surprising to me that the general SAT solver used by Phil, written in C compiled to asmjs was so much slower than a pure Javascript purpose-built crossword solver (mine). I assumed the SAT solver might make certain search optimizations that could overcome the minor optimizations related to mine being only a crossword solver. So, yay, my code is not that bad?

In these apps the filler runs as a web worker so even when slow it isn’t too noticable (except for hogging a core).

Anyway you can try out my filler today with Kevin (filler code is here, which is exactly the code in my own app except with some janky whitespace because I stripped out all flow annotations).

Peak 2018

I almost let the second half of 2018 go unblogged (are people still saying blog?). It’s not that nothing interesting happened in all of that time, but real life has been ultra busy. Did I mention that Sammy turned one and is on the verge of walking?

The garden delivered tons of produce this year, enough that I didn’t really keep up. I gave myself a crash course in canning, making four jars of tomatillo salsa and six jars of habanero jam. Maybe fewer peppers next year?

I harvested around five bowls of tomatoes, many of which are taking up space in the freezer right now.

And at least four of these basil bowls, mostly frozen pesto at the moment:

This is what it is all about: pizza with homegrown basil, homegrown tomatoes, and sourdough crust from locally cultured yeast.

Anyway, happy New Year!