HNHacker News
TopNewBestAskShowJobs

kmod

3,205 karma · joined July 24, 2009

submissionscomments
kmod··on Show HN: Testing HN titles against a neural network
Cool! I'm really curious about what you're up to since I'm doing something similar. Mine's up at https://www.onlyvetted.com/

Hit me up at kevmod at gmail, would love to hear more.

kmod··on Google shouldn’t be the only source of interest-based recommendations
A bit late to the party, but I've recently started a personalized recommendation service, currently focusing on news. So far it's good at identifying which subreddits you are interested in, and soon it will be able to give you recommendations across the web. Check it out!

https://www.onlyvetted.com/

kmod··on PyPy's New JSON Parser
Agreed, I've gotten huge speedups from ujson in the past and the numbers in the post are markedly different from my experience, making me think that they are measuring something different / there is something significant about this use case that is different than the ones I've had in the past.
kmod··on It’s Time for a Modern Synthesis Kernel
I'm working on something that could be applicable to this! There seem to be many areas that would benefit from a pluggable JIT engine, so I started building one: https://github.com/nitrousjit/nitrous/

It's designed to analyze and optimize existing codebases. So far it's produced some pretty decent speedups on the Python interpreter, though with a big drawback of very high compilation times due to using LLVM.

Let me know what you think or if you have performance-sensitive programs that you think would benefit from a low-investment JIT.

kmod··on Cracking Minesweeper with Z3 SMT Solver
There are a couple questions here:

- Can every minesweeper board be solved without guessing?

No:

  1 ?
  1 ?
- If a minesweeper game doesn't require guessing, is there an algorithm that can determine the next move?

Yes. Just enumerate all combinations of mine/not-mine for every hidden cell, and look at all the boards that match the exposed clues. If there is a square that is never a mine, click it. If there isn't, the board requires guessing.

- Is there an efficient algorithm to do the above?

Most likely not. Minesweeper as a decision problem ("is there any solution to these given clues") is NP-complete. http://simon.bailey.at/random/kaye.minesweeper.pdf

kmod··on PYNQ – Python Productivity for Zynq
Here's the relevant bit from the overview:

  Programmable logic circuits are presented as hardware libraries called overlays. These overlays are analogous to software libraries. A software engineer can select the overlay that best matches their application. The overlay can be accessed through an application programming interface (API). Creating a new overlay still requires engineers with expertise in designing programmable logic circuits.
In other words, you're not doing direct programming of the FPGA with these new apis. Instead it looks like they are making it easier to select and use existing overlays (aka existing hardware designs) by wrapping it up in some nice Python interfaces. So as more overlays are released (right now it looks like there is only the "base" overlay) it should be easy to switch between them as you want to accelerate different sorts of problems.

You might say "why doesn't this exist already", but the whole ecosystem is currently quite hard to use (think GPU programming but from 5 or 10 years ago) so putting some nice interfaces on it could be a big step. Will be interesting to watch.

kmod··on Why is Python slow
Something in my server's configuration eats more and more memory, until the OOM killer decides that killing the MySQL database looks like a dandy way to reclaim memory.
kmod··on Chart Shows Who Marries CEOs, Doctors, Chefs and Janitors
At first I found this fascinating -- "data shows that CEOs marry assistants" is a good narrative about gender attitudes towards marrying. But as I played with it, I was kind of bummed to learn: most male professions tend to marry assistants, since there are a lot of married female assistants (second only to teachers for females).

I did a quick search for who male Programmers, Executives, and Janitors marry (tried to pick a diverse set), and then filtered out the top five female occupations in this data (Teachers, Assistants, Nurses, Misc Managers, Salespersons). The remaining results were: male Programmers marry female Programmers, male Executives marry female Executives, male Janitors marry female Janitors or female Maids.

So I whipped up a script that, instead of measuring the absolute frequency, normalizes the data set against how often the target occupation gets married to. ie instead of just counting common pairings, it measures "how much more likely is profession X (compared to the general population) to marry profession Y?".

For male CEOs, the result is: they marry other CEOs. Male CEOs are 12x more likely to marry a female CEO than males in other professions are. They are also 12.6x more likely to marry embalmers! 7x more likely to marry Announcers, 5.3x more likely to marry "Dancers and Choreographers", and 4.9x more likely to marry "Public Relations and Fundraising Managers". They are only 1.2x more likely to marry a Secretary than other males are.

For male programmers, it is similar: male programmers are 20x more likely to marry female programmers than other male occupations are. This is because only 0.2% of men marry female computer programmers, but 3.4% of male programmers do. Male programmers also marry female Materials Engineers (20x more likely), Information Security Analysts (13x), "Surveyors, Cartographers, and Photogrammetrists" (10x), and "Architects, Except Naval" (8x).

I also picked one final way of slicing it: "how many more of these marriages did we see than expected" (expected based on the relation frequencies of the two occupations). This is another way of removing "well we would expect a lot of these marriages", but in a way that is less geared towards low-occurrence matches like CEO-Embalmer. For CEOs, the results are: CEOs, Misc Managers, Elementary and Middle School Teachers, Secretaries, Accountants and Auditors. For Programmers, it's: Programmers, Misc Managers, Other Teachers and Instructors, Software Developers, Accountants and Auditors.

Anyway, this isn't to say that these other ways of looking at the data are any "better", they're just answers to different questions.

I threw up the code in a gist -- sorry it's messy https://gist.github.com/kmod/ee6ac3c029641b39d0b6

kmod··on Tesla Energy
If what you say is true, then with better economies of scale and longer investment horizons, utilities would quickly erase any peak-vs-non-peak arbitrage opportunities.
kmod··on Type hinting for Python
At least for Python, there are a different set of goals for programmer-productivity type hints (such as these) and for static-compilation type hints (such as you would need to provide optimizations).

One particular point is Python subclasses: it makes a lot of sense to say that a Python subclass is a subtype of the parent class, but in reality there are no guarantees about any relationship. This means that a compiler/VM would most likely have a hard time making use of type annotations since it would have to have to support the user passing arbitrary subclasses with completely different behavior.

kmod··on Pyston 0.2, the LLVM-based Python JIT from Dropbox
We could work on language compatibility forever :P

Guido advises but isn't actively involved.

kmod··on Hacker Redirects Traffic From 19 Internet Providers to Steal Bitcoins
The finger-pointing at BGP is red herring: the problem is that the stratum protocol has zero authentication. If you can intercept those streams, you can trivially ask anyone to start mining for you instead. This could also have been done using DNS poisoning, ISP-side intercepts, or anything else in the standard bag of tricks. http://blog.kevmod.com/category/bitcoin/
kmod··on Announcing Pyston: an upcoming, JIT-based Python implementation
It's mostly a question of manpower and the fact that Dropbox is still on Python 2.7 internally. If we can get more people on the team, we'd love to add support for Python 3.
kmod··on Announcing Pyston: an upcoming, JIT-based Python implementation
Definitely true; there are some overheads that could be low-hanging fruit to optimize, but the real solution is most likely to use a tiered-compilation system. ie only invoke the full LLVM code generator once a function has been called 10,000 times. It's definitely an open question as to how to get faster compilation times out of it; we have a simple LLVM interpreter but since LLVM isn't designed for interpretation it's pretty slow.

I think you can look at the people who are interested in adding LLVM tiers to their JITs (ex Apple, Facebook) to see that we're not the only ones that think there can be a place for "good but expensive" code generation in a JIT.

kmod··on Announcing Pyston: an upcoming, JIT-based Python implementation
I can't speak to the non-technical reasons mentioned in the post, but there's good reason to believe that LLVM is in a very different state than the time that Reid wrote this, particularly wrt JIT support: the JIT engine has been completely replaced. Both of the things that he mentions (lack of back-patching, lack of gdb support) have been added to LLVM mainline.
kmod··on Announcing Pyston: an upcoming, JIT-based Python implementation
It seems like there are a couple topics that come up when talking to people about switching to PyPy: - performance or memory usage on larger programs - C extension module support I'm not going to promise that we will do a better job at these, but there are technical reasons to think that it's possible.

You're definitely right, Python has a lot of user-customizability that can make it harder to execute efficiently than JavaScript (though thankfully it has less than Ruby). Both PyPy and Pyston have their techniques for cutting through the complicated+expensive slow case and trying to predict and execute a fast path.

kmod··on Testing Benford's Law
"If a set of values were truly random, each leading digit would appear about 11% of the time"

This kind of mathematically unsophisticated reasoning is exactly why Benford's law is so surprising to people. If you think of what it means for a value to be "truly random", the result is not surprising at all.

kmod··on MIT students develop liquid fuel for electric cars
"liquid fuel for electric cars" -- what if we used refined petroleum as a secondary energy source? we probably wouldn't even need a large electric motor any more.
kmod··on Chromebook
Based on my experiences with the CR-48 (which I used extensively for a few months), I have to suggest that you not get one of these laptops. Basically, ChromeOS is great, but using Atom processors is simply unacceptable for the tasks that they advertise. The only thing the CR-48 can do well is viewing static content -- and I mean truly static! Scrolling around on an otherwise-static web page is far to dynamic for it to handle. Want to play flash? Yeah right.

These new models have dual-core atoms, which will help, but mostly it's just the awful single-core performance that gets you. Even tying emails in gmail was an extremely painful experience; often the characters on the screen would lag significantly behind my tying, and it would take forever to load the different pages.

I don't think anyone is arguing that you can use these things for "real work". I'm going to argue that if you care about your time, you can't even use these things for any of the other stuff they advertise. Unless the new processors are significantly better, I'd say get something else.

kmod··on The next operating system: building an OS for hundreds, thousands of cores
This is an unfortunate case of people adopting technical terms for PR purposes. When we (FOS) say "OS", we mean that when you write a program for FOS, you think about it as if you are writing it for a single computer. It doesn't matter if that computer has multiple processors in it, or even if those processors are in different boxes and are only connected by ethernet.
kmod··on The next operating system: building an OS for hundreds, thousands of cores
I think there's some confusion about this project, since the article doesn't go into to much detail about what it actually is, apart from some high-level technical highlights. My understanding (which is potentially outdated) is that Angstrom is a collaboration effort between different groups who are trying to combine their separate research into a larger project.

For the criticism that the project will "fail", I think there's some merit. Will this produce the next computation system that the world uses? Probably not. Will this push the boundaries of engineering and improve on the state of the art? Almost certainly. And due to its scale, and the fact that Angstrom was created by combining multiple separate projects, there's also room for individual projects or ideas to succeed even if others don't.

My background is that I worked on the FOS project, which is the part that is most related to the title of this post. If you were looking for more technical meat, I encourage you to check out the project page: http://groups.csail.mit.edu/carbon/?page_id=39

kmod··on The next operating system: building an OS for hundreds, thousands of cores
The problem is that parallelism, and performance at this level in general, is not the kind of problem that you can solve by adding additional layers of abstraction. I can only speak to FOS, and not the other projects, but the idea behind it is to optimize the stack all the way down. My guess is that if you tried to run the Erlang VM on a 1000-core cpu, it would run into Linux scalability issues, regardless of how parallel Erlang is. Instead, we need to think about the base primitives of how we interact with the hardware, and potentially redesign them in a way that let us fully utilize the hardware.
kmod··on Nobody Understands Probability
You unfortunately fall right into the trap that he's warning about: just because you can enumerate the possible outcomes doesn't mean that they are all equally likely (cf: the Monty Hall problem).

The conclusion that BB/BG/GB are all equally likely follows from the assumption that the man would definitely state that he has a male child if and only if one of those conditions were true. But what if instead we add the fact that the man would only say that he has a son if he has no daughters? This isn't contradictory with anything else in the problem, but now the answer is clearly "P(BB) = 1", which makes it hard to state that certainly "P(BB) = 1/3" when there is a consistent interpretation of the problem that gives a different answer.

You should reread the way he set up the problem again: he makes the subtle distinction between things that are given to us by the omniscient problem writer and things that are given to us by characters inside the problem, for whom we have to apply Bayes Law an additional time.

kmod··on How I sped up my server by 6x (with 1 linux cmd)
Not quite -- you need to make sure that the counters are on separate cache lines, otherwise you'll still get the same issue.
kmod··on How I sped up my server by 6x (with 1 linux cmd)
This seems to be a cache performance issue:

- The difference in performance is too big to be a memory bus issue

- Since the number of threads doesn't change, just the number of processes, it's not an un-scalability issue of the program.

- It's most likely not a issue with which CPUs he chose; in a hyperthreaded system there can be a pretty large performance hit if he pinned the server to logical cpus that were on the same core. I don't know how Intel numbers its cores in hyperthreaded processors, but their general method is "make the cores that are closest to each other have the biggest difference in cpu ids", which would mean that ex cpus 1 and 5 are on the same core.

- I would guess that it's not a thread migration issue, since I wouldn't expect the Linux scheduler to be that bad.

Poor cache performance is the most likely cause. As a minimal example of what the author concludes, if you have two threads that sit in a loop incrementing the same counter, it is much faster to run those two threads on the same cpu than on their own cpus. This is because when running on separate cpus, that particular cache line will continually be ping-pong'ed between the two. Even if threads don't access the same addresses, if they access addresses that are in the same cache line, you'll still get ping-ponging ("false sharing"). This explanation is also supported by the fact that it disappears on i7 processors; one of the largest improvements with the Nehalem line is the improved cache architecture.

Poor cache behavior is usually the culprit in non-cpu-bound and non-io-bound systems.

kmod··on Google Prediction API
Using past data to give you better service for future data -- isn't this exactly what you want a prediction algorithm to do?
kmod··on Google Prediction API
I don't think Google has some magic "make this algorithm scale to huge datasets" box that they can run things through. The reason why Google can run predictions on huge datasets is because they designed an algorithm that has lower accuracy but greater scalability; this service seems to be just them giving you an API to that algorithm. I think your comment sounds like "I like your algorithm, but I'd rather use my algorithm, so please run my algorithm but make it have the features of your algorithm"...
kmod··on go to xkcd.com: The webcomic XKCD now has a command prompt
They do log them, via a GET request to /unixkcd/missing
kmod··on go to xkcd.com: The webcomic XKCD now has a command prompt
Interestingly, you can see it log every unrecognized command via a GET request to /unixkcd/missing (look at source/firebug). It appears that he's been updating the source code with things that people commonly try ('rm' didn't used to be supported); I also look forward to a "what you crazy people on my site tried" comic.
kmod··on How to quadruple your productivity with an army of student interns
Simple:

- Get a bunch of well-respected people together

- Create something exciting

- Use your connections to find people that you know are good

← PreviousPage 6 of 7Next →