Skip to content

compatibility patch for BnB >=0.46 #20926

@Borda

Description

@Borda

Bug description

see update for litGPT:

What version are you seeing the problem on?

v2.5

Reproduced in studio

No response

How to reproduce the bug

This is not the right way:

            if hasattr(bnb.functional, "double_quant"):
                CB, _, SCB, _, _ = bnb.functional.double_quant(B)
            else:  # for bitsandbytes versions ≥0.46
>               CB, SCB = bnb.functional.int8_double_quant(B)
E               ValueError: too many values to unpack (expected 2)

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):

More info

No response

cc @Borda

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions