by simonw on 10/23/2024, 2:20:27 AM
by visarga on 10/23/2024, 4:11:25 AM
That's why it feels like installing a ML repo is like sudoku. You install everything and at the last step you realize your neural net uses FlashAttention2 which only works on NVIDIA compute version that is not deployed in your cloud VM and you need to start over from scratch.
by chatmasta on 10/23/2024, 4:13:34 AM
Here’s the same thing in Poetry (2022): https://www.splitgraph.com/blog/poetry-dependency-resolver-s...
by echoangle on 10/23/2024, 4:52:40 AM
> Solving the versions of python package from your requirements is NP-complete, in the worst case it runs exponentially slow. Sudokus are also NP-complete, which means we can solve sudokus with python packaging.
Is that actually sufficient? Can every system that’s solving something that’s NP-complete solve every other NP-complete problem?
by yochem on 10/21/2024, 2:12:11 PM
No way pip actually is a really inefficient SAT solver!
by alentred on 10/23/2024, 12:57:59 PM
This is BRILLIANT ! I knew of a trend to implement lots of different things at compile-time (in Scala and Haskell communities at least) - definitely fun and quirky, but it never seemed that "special". This one, it has an air of old-school computer magic around it, probably because it is so elegant and simple.
by mi_lk on 10/23/2024, 8:20:42 AM
See also this 2008 post using Debian package system to solve Sudoku:
https://web.archive.org/web/20160326062818/http://algebraict...
by ziofill on 10/23/2024, 1:27:01 AM
but how does it know the constraints?
by worewood on 10/23/2024, 11:33:12 AM
This is type of cool hacking I like to see. Kudos! (Or better, Sukodus :) )
by niyonx on 10/21/2024, 2:38:36 AM
How did you even think of that? Nice!
by revskill on 10/23/2024, 9:43:51 AM
This is a hack.
by anthk on 10/23/2024, 1:09:45 PM
Now, in MicroLisp, Common Lisp and maybe Emacs' Elisp too:
I love this so much. I dug around a bit and figured out how it works - I have an explanation (with an illustrative diagram) here: https://simonwillison.net/2024/Oct/21/sudoku-in-python-packa...
Figuring out how it works is a great way to learn a bit more about how Python packaging works under the hood. I learned that .whl files contain a METADATA file listing dependency constraints as "Requires-Dist" rules.
I ran a speed comparison too. Using the uv pip resolver it took 0.24s - with the older pip-compile tool it took 17s.