Skip to content

CI fails with dev dependencies: ImportError for 'require_torch_gpu_if_bnb_not_multi_backend_enabled' #4251

@albertvillanova

Description

@albertvillanova

CI fails with dev dependencies: https://github.com/huggingface/trl/actions/runs/18400105862/job/52427161623

ImportError: cannot import name 'require_torch_gpu_if_bnb_not_multi_backend_enabled' from 'transformers.testing_utils'

ERROR tests/test_dpo_trainer.py
ERROR tests/test_peft_models.py

Stacktrace:

ImportError while importing test module '/__w/trl/trl/tests/test_dpo_trainer.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/__w/_tool/Python/3.12.12/x64/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_dpo_trainer.py:33: in <module>
    from transformers.testing_utils import (
E   ImportError: cannot import name 'require_torch_gpu_if_bnb_not_multi_backend_enabled' from 'transformers.testing_utils' (/__w/trl/trl/.venv/lib/python3.12/site-packages/transformers/testing_utils.py)

Metadata

Metadata

Labels

⚡ PEFTRelated to PEFT🏋 DPORelated to DPO🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions