Skip to content

model-maker 0.3.3

Choose a tag to compare

@cicadapark-dev cicadapark-dev released this 27 Nov 08:44

model-maker 0.3.3: a security update. The libraries the models run on are raised past GitHub's dependency alerts; the new ones paint another draw, not a worse one.

Nothing in model-maker's own pipeline changed: no check, setting, model or step. What changed is underneath it:
PyTorch 2.5.1 to 2.10.0 (its CUDA 12.8 build), transformers 4.46.3 to 5.10.1, diffusers 0.31.0 to 0.38.0, accelerate
1.1.1 to 1.15.0, bitsandbytes 0.44.1 to 0.46.1, and what they pull along. Run ./setup.sh again to install them: the
environment now takes 7.5 GB (was 6); keep 77 GB free.

Why:

  • 30 of GitHub's 31 alerts closed: the critical one, all 9 high, all 15 moderate and 5 of the 6 low, in torch,
    transformers, diffusers and accelerate. None of them could be reached in 0.3.2 (model-maker runs offline, checks
    every model file against its sum and refuses code it does not list), but the faults now leave the libraries
    instead of resting on that guard alone.
  • Two advisories stay open, both in torch 2.10.0, the last PyTorch built for CUDA 12; neither has a fixed CUDA 12
    build. One is GitHub's last alert (low: torch.jit.script, which model-maker never calls). The other is not among
    GitHub's 31 but is high by its score (7.8): loading a .pt2 archive, by someone already on the machine.
    model-maker never loads one: nothing in its code, in the pinned code of the models it runs, or in the libraries it
    imports calls that loader, and no model folder holds such a file. So "every high alert closed" holds for GitHub's
    31, not for this one. Both are listed with their reasons in tools/ci/pip-audit-ignore.toml.

What changes for you:

  • The same prompt and seed now make a slightly different object. The new PyTorch paints another picture from
    the same seed. Mostly you would not see it (on average under 2 of 255 per pixel), but in places it is another
    detail: another top rail on a chair, a leg drawn a little otherwise, and that can turn a check's verdict either way
    on an object that sat near its limit. On 4 of the 50 prompts another of the four picture tries was chosen, so the object is another one altogether.
  • About as good, measured. On 50 prompts made with both versions on a 16 GB card and judged blind by two judges,
    the good objects (passing every check and judged right) went from 21 to 22 under one judge and from 24 to 23 under
    the other, and the wrong objects that pass fell from 13 to 9 and from 10 to 8. Fewer objects pass every check (31
    against 34): the checks refused more on this draw, about as many right objects as wrong ones.
  • A prompt takes about 6 % longer on a 16 GB card. On the 12 GB card the computer's memory at its highest rose from
    23.2 to 25.5 GB during painting; why is not known yet. With a 12 GB card, have 32 GB of memory: 0.3.3
    peaked at 25.5 GB there, and one object in a 23 GiB limit with no swap was stopped by the out-of-memory killer. With a 16 GB card 24 GB or more stays enough.

How we know, and what the first test got wrong:

  • The first test failed. Before any measured run, six objects were made with the old and the new libraries from
    the same seeds. The bar was "the same picture from the same seed", and it failed: some pictures moved more than
    allowed, and an armchair that passed with 0.3.2 was refused with 0.3.3, because its picture now showed other slats
    and the shape closed a narrow gap between two of them. We traced it: not the shape code (the new shape stage on the
    old picture passes), but PyTorch itself, whose small changes in arithmetic the picture model turns into a locally
    different picture. Any PyTorch after 2.5.1 does this, so a same-seed bar can never pass.
  • So the bars were set anew, before the measured run, and written down, dated, before it began: the new
    libraries must be another draw, not a worse one. No release if the good objects lost outnumber those gained by
    6 or more, or if more than 3 extra wrong objects pass; every object whose verdict flipped shown with a map of where
    its picture changed (each one has the painter's change on it); and a closing run of the old libraries after the
    whole run identical to their first. Under both judges every bar passed: lost 4 and gained 5, lost 4 and gained 3.
    The six objects of the first test were spent on finding the cause and are not counted.
  • What 50 prompts can and cannot see. They would have caught a real loss of about 8 objects in 50. A smaller
    loss, or a small gain, cannot be told from the draw with 50 prompts, so 0.3.3 claims no quality change either way.
  • Measured in full on the 16 GB card only. The 12 GB card was checked on the six first-test objects (the 4-bit
    picture model loads, the card's memory is as before) and on its 25 fixed reference objects (22 pass every check,
    against 20 with 0.3.2; these are a check, not judged by eye).
  • One bar of the first, processor-only test was changed after its result, and that is said in the record: the shape
    model's picture features differed by more than the bar we had set without measuring (1.09e-3 against 1e-4); on the
    worst picture the old libraries differ by as much between their own two ways of computing the same thing. A second
    part of the new bar failed on 2 of 11 pictures and was traced to 32-bit rounding: in 64-bit numbers old and new
    agree. The details, every table and every flip:
    docs/results.md, "0.3.3 against 0.3.2".

Pictures (docs/images/0.3.3/): an armchair, a wheelbarrow, an oak writing desk and a copper tea kettle, each from the
same prompt and seed with 0.3.2 and with 0.3.3: the two pictures, where they differ, and each object turned round.