Most active commenters

    ←back to thread

    1311 points msoad | 18 comments | | HN request time: 2.424s | source | bottom
    Show context
    jart ◴[] No.35393615[source]
    Author here. For additional context, please read https://github.com/ggerganov/llama.cpp/discussions/638#discu... The loading time performance has been a huge win for usability, and folks have been having the most wonderful reactions after using this change. But we don't have a compelling enough theory yet to explain the RAM usage miracle. So please don't get too excited just yet! Yes things are getting more awesome, but like all things in science a small amount of healthy skepticism is warranted.
    replies(24): >>35393868 #>>35393942 #>>35394089 #>>35394097 #>>35394107 #>>35394203 #>>35394208 #>>35394244 #>>35394259 #>>35394288 #>>35394408 #>>35394881 #>>35395091 #>>35395249 #>>35395858 #>>35395995 #>>35397318 #>>35397499 #>>35398037 #>>35398083 #>>35398427 #>>35402974 #>>35403334 #>>35468946 #
    intelVISA ◴[] No.35394288[source]
    Didn't expect to see two titans today: ggerganov AND jart. Can ya'll slow down you make us mortals look bad :')

    Seeing such clever use of mmap makes me dread to imagine how much Python spaghetti probably tanks OpenAI's and other "big ML" shops' infra when they should've trusted in zero copy solutions.

    Perhaps SWE is dead after all, but LLMs didn't kill it...

    replies(11): >>35395112 #>>35395145 #>>35395165 #>>35395404 #>>35396298 #>>35397484 #>>35398972 #>>35399367 #>>35400001 #>>35400090 #>>35456064 #
    MontyCarloHall ◴[] No.35395145[source]
    >how much Python spaghetti probably tanks OpenAI's and other "big ML" shops' infra when they should've trusted in zero copy solutions

    Probably not all that much. All of the Python numeric computing frameworks (Numpy, PyTorch, TensorFlow, etc.) are basically just wrappers for lower level C++/C/Fortran code. Unless you’re doing something boneheaded and converting framework-native tensors to Python objects, passing tensors around within a framework essentially just passes a pointer around, which has marginal overhead even when encapsulated in a bloated Python object.

    Indeed, a huge number of PyTorch operations are explicitly zero copy: https://pytorch.org/docs/stable/tensor_view.html

    replies(2): >>35396982 #>>35408170 #
    oceanplexian ◴[] No.35396982[source]
    It’s not that the performance is the issue, it’s that it’s unmaintainable and prone to break. Exceptions aren’t handled right, dependencies are a disaster (Proprietary NVIDIA drivers+CUDA+PyTorch+ the various versions of stuff are a complete disaster)

    This leads to all sorts of bugs and breaking changes that are cool in an academic or hobbyist setting but a total headache on a large production system.

    replies(3): >>35397515 #>>35397551 #>>35398182 #
    1. CurrentB ◴[] No.35397551[source]
    Yeah, I've been using python for the first time in a while to try out some of the llm stuff and I can't believe how bad the dependency hell is. It's probably particularly bad due to the pace of change in this field. But I spend an hour getting dependencies fixed every time I touch anything. 80% of the Google Collabs I find are just outright broken. I wish there were other viable non python options to try out these things.
    replies(3): >>35398107 #>>35399048 #>>35424595 #
    2. bboygravity ◴[] No.35398107[source]
    No idea what a Google Collab is, but does the code come with an environment or at least a specifications of which packages and versions to use (requirements.txt)?

    It sounds unnecessarily weird to me that people would share Python code that simply doesn't work out at all out of the box.

    replies(2): >>35398243 #>>35402417 #
    3. version_five ◴[] No.35398243[source]
    Its rarely as easy as sharing a requirements.txt. There are lots of things that can still break - for examples you get weird situations where different modules require different versions of a third module. Or all the Cuda toolkit version issues thsy seem to come up with gpu stuff. When we share python, we tend to share a docker image, and even this isn't foolproof. A big problem I think is that it doesn't incentivize building something portable. And it's very hard to test across different machines. Add to that all the different practices re virtual environments, venv, conda, etc, everyone tries to install the dependencies differently or is starting from some nonstandard state. It's a mess.
    replies(1): >>35400039 #
    4. hunta2097 ◴[] No.35399048[source]
    You're using virtual environments, right?

    ML libraries are particularly bad, most other stuff works well.

    Friends don't let friends install pip into /usr/lib.

    replies(1): >>35406036 #
    5. pablo1107 ◴[] No.35400039{3}[source]
    Maybe using Nix it's a better experience for creating such an environment where you depending also on system utilities.
    replies(1): >>35401252 #
    6. superkuh ◴[] No.35401252{4}[source]
    Everyone is using llama.cpp because we reject the idea of giving up on system libraries like nix does. That kind of tomfoolery (at least in the desktop context) is only required when you use software projects that use libraries/languages which break forwards compatibility every 3 years.

    If you just write straight c++ (without c++xx, or anything like it) you can compile the code on machines from decades ago if you want.

    replies(2): >>35402510 #>>35405209 #
    7. vkou ◴[] No.35402417[source]
    > No idea what a Google Collab is

    It's ~equivalent to a Jupyter notebook.

    8. ◴[] No.35402510{5}[source]
    9. remexre ◴[] No.35405209{5}[source]
    What's c++xx?
    replies(1): >>35407666 #
    10. AnthonyMouse ◴[] No.35406036[source]
    This just goes to show what a mess this is.

    Suppose you have a big piece of compute hardware (e.g. at a university) which is shared by multiple users. They all want to come in and play with these models. Each one is tens to hundreds of gigabytes. Is each user supposed to have their own copy in their home directory?

    replies(1): >>35406562 #
    11. Accujack ◴[] No.35406562{3}[source]
    This is not exactly a new problem.
    replies(1): >>35406640 #
    12. AnthonyMouse ◴[] No.35406640{4}[source]
    That's kind of the point. We solved this problem decades ago. You have a system package manager that installs a system-wide copy of the package that everybody can use.

    But now we encounter this broken nonsense because solved problems get unsolved by bad software.

    13. opless ◴[] No.35407666{6}[source]
    C++11, and greater.
    replies(1): >>35416499 #
    14. remexre ◴[] No.35416499{7}[source]
    Huh, I was proficient in Rust before "properly" learning C++, so maybe that accounts for it, but I didn't realize C++11 was controversial. Is it just move semantics, or are there some library things that are hard to implement?
    replies(1): >>35431561 #
    15. nyarlathotep_ ◴[] No.35424595[source]
    IME the ML world with Python is a whole mess on top of the existing dependency issues.

    I've been very _careful_ too (using pyenv/virtualenvs etc) for dependency management, but with Nvidia driver dependencies and "missing 'sqlite3/bz2' issues related to the underlying interpreter (not to mention issues with different Python3.x versions) I'm lucky to be able to even run a 'hello world' ML sample after an afternoon of fighting with it.

    My Ubuntu install w/ Nvidia card only seems to recognize the GPU in some circumstances even when using the same `conda` env. Often this is remedied by rebooting the machine(?).

    No idea how companies manage this stuff in production. Absolute minefield that seems to catastrophically break if you sneeze at it.

    I'll admit I am not an expert in managing ML envs, but I've dealt with a lot of python environments for typical CRUD stuff, and while rough at times, it was never this bad.

    16. int_19h ◴[] No.35431561{8}[source]
    I think what OP is saying is that decades-old systems wouldn't have C++11-compatible compilers on them.
    replies(1): >>35441542 #
    17. bboygravity ◴[] No.35441542{9}[source]
    And maybe that "C++" is now basically a bunch of different incompatible languages instead of just 1 language, depending on what "xx" is (11, 14, 17, 20, 23, etc).

    It's like Python 2 vs Python 3 except even worse.

    replies(1): >>35444029 #
    18. int_19h ◴[] No.35444029{10}[source]
    In my experience, C++03 code works just fine without changes on a C++11 and C++14 compilers, so no, it's not at all like Python 2/3. The few features that were ripped out were exactly the stuff that pretty much no-one was using for good reasons (e.g. throw-specifications).