News for hackers. Stuff that matters.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by nl on Thursday September 01, 2022 @10:34PM (#32685949)
I don't think this is particularly fair. This is literally hours old, and people installing now are really debugging rather than installing a "finished" build.

The forks are weird mashups of bits of repos, and running on a M1 GPU is something that barely works itself.

Give it maybe 3 months and it will be much smoother.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by bschwindHN on Thursday September 01, 2022 @10:57PM (#32686082)
I think it is fair, actually. This is not unique to hours-old python projects, it's a common theme among almost all python tools I've used.

I have a suspicion that that something written in Julia, Go, Rust, or possibly even C wouldn't have nearly this many issues. I'm not talking about debugging the actual functionality of the software, but rather the environment and tooling surrounding the language and software built with it.

This project in particular should be an easy case because you know the hardware you'll be running on ahead of time.

I'm ranting a bit, but I've tried so many tools based on python and almost _none_ of them built/installed/ran correctly on the happy path laid out in each project's readme.

Anyway, sorry, rant over.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by nl on Friday September 02, 2022 @12:45AM (#32686691)
Yes there is a fair amount of truth in that.

I do think that experience helps here. I have a recipe for installing Python that works on most python projects most of the time.

  git clone <project>
  python3 -m venv ./venv
  source ./venv/bin/activate
  pip install -r requirements.txt
  deactiviate # need to do this to include the correct command line tools in path (eg Jupyter)
  source ./venv/bin/activate
Done.

On a Linux or Intel Mac system this works with pretty much every reasonable Python project.

On M1 Macs the situation isn't great at the moment, though.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by nerdponx on Friday September 02, 2022 @02:00AM (#32687112)
As if compiling any given C program wasn't also a crap shoot.

People also tend to forget that these ML packages are ridiculously complicated, and have a lot of dependencies not just on other libraries but on particularities of your system.

That, and ML researchers can't also be expected to be good at everything. They are busy doing ML research and waiting to be given a recipe to follow.

Meanwhile I can put together a Python package in my sleep that works perfectly on pretty much any system, but I don't know a damn thing about Autotools and would probably make a total mess if I tried use it. Or CMake. Or whatever Java uses.

This "look Python bad!!" stuff has some merit (if only historical), but it mostly amounts to FUD and does a big disservice to the people who have worked hard over the past few years to get everything fixed up.

Plus at least one of the issues I see here is because people disregarded the instructions and used Python 3.9 even though it says to use 3.10 because the code assumes it's running under 3.10.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by nerdponx on Saturday September 03, 2022 @07:30AM (#32700799)
Also, sorry to double post, but you don't actually need to activate the venv. You can just invoke `venv/bin/pip`. That should hopefully save you a bit of time and annoyance.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by nl on Sunday September 04, 2022 @07:55AM (#32712094)
That's bad advice for two reasons:

Firstly, non-experiences Python users (the kind who need recipes to follow) will also blindly follow installation instructions on websites. These all say "pip install xxx" and users will inevitably forget they need to change the path to make that work for their environment. By getting into the habit of activating the environment this problem goes away.

Secondly, you do need to activate the venv so that command line tools in ./venv/bin are used (instead of whatever is in your default path).

This includes both the correct version of python (if you set it when you setup the virtual environment) and importantly jupyter. From personal experience there's a whole set of pain when you don't realize your jupyter isn't the one inside the virtual environment and so is using other libraries.

Because many shells cache the location of executables, if you don't deactivate and reactivate your virtual environment after installing Jupyter into it then it may (in some circumstances) use a globally installed version.

Re:Run Stable Diffusion on Your M1 Mac’s GPU by bschwindHN on Friday September 02, 2022 @02:06AM (#32687150)
Noted! I'll try this out next time I have to use a python project and see how it goes.
Re:Run Stable Diffusion on Your M1 Mac’s GPU by nl on Friday September 02, 2022 @07:11AM (#32689248)
Notably, it works perfectly on the linked repo for this story (unlike the conda version which is the first comment and is a complete mess).
Re:Run Stable Diffusion on Your M1 Mac’s GPU by pdehaan on Thursday September 01, 2022 @11:22PM (#32686218)
My anecdotal experience is that it briefly gets better, then much worse. Build scripts downloading tarballs from dead URLs and dependencies on unspecified versions of libraries that have since had breaking API changes are frequent issues.

…it’s still awesome that people put in the effort to do these things at all, but the tools often have a tendency to make me feel like an archaeologist trying to piece what ancient artifacts are missing and how they were supposed to all fit together.