• Stefy Lanza (nextime / spora )'s avatar
    accelerate 1.x moves a quantized model, which transformers 4.42 forbids · d4458b43
    Stefy Lanza (nextime / spora ) authored
    The last reason MM-Embed ran on the CPU, and the one that only the new
    diagnosis could have found. Its quantized GPU load died in accelerate's own
    frame:
    
        transformers/modeling_utils.py:3904 in from_pretrained
          dispatch_model(model, **device_map_kwargs)
        accelerate/big_modeling.py:514 in dispatch_model
          model.to(device)
        transformers/modeling_utils.py:2774 in to
          ValueError: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes
          models.
    
    accelerate 1.x takes a `model.to(device)` shortcut for a single-device map, and
    transformers 4.42 refuses that for a bnb model -- so the fallback ran it on the
    CPU at 30x the latency and 33 GB of host RAM, for a model that fits in 5.7 GB
    of card. accelerate==0.32.1 now sits in that pin's extras with peft, datasets,
    pyarrow and bitsandbytes; the shared requirements carry none of them, because
    only the quantizing pin needs them.
    
    Verified live on zeiss after the relaunch:
    
        [tf4-embed] nvidia/MM-Embed ready on cuda (4096-d, transformers 4.42.4,
                    quantized)
        card: 5666 MiB   (the planner estimated 5.18 GB)
        text: dims=4096 finite=True   image: dims=4096 finite=True
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
    d4458b43
tf4_embedders.py 31.4 KB