Skip to content

Remove bitsandbytes monkey-patching #2057

Merged
vivekgoe merged 2 commits into
huggingface:v1.19-releasefrom
ckvermaAI:dev/ckvermaAI/monkey-patching
Jun 13, 2025
Merged

Remove bitsandbytes monkey-patching #2057
vivekgoe merged 2 commits into
huggingface:v1.19-releasefrom
ckvermaAI:dev/ckvermaAI/monkey-patching

Conversation

@ckvermaAI
Copy link
Copy Markdown
Contributor

  1. Currently, OH installs transformers-4.49.0 (https://github.com/huggingface/optimum-habana/blob/v1.19-release/setup.py#L32)
  2. With this version of transformers
    a) We can get rid of all the bitsandbytes patching except _gaudi_validate_bnb_multi_backend_availability
    b) Because of a lack of support from transformers for hpu (in get_available_devices function)
    c) And in transformers-4.50.0, hpu is listed in get_available_devices function. And here we can get rid of the entire patching for bitsandbytes.

@ckvermaAI ckvermaAI requested a review from regisss as a code owner June 13, 2025 05:30
@ckvermaAI
Copy link
Copy Markdown
Contributor Author

@vivekgoe @regisss @astachowiczhabana Please review this change.

Copy link
Copy Markdown
Collaborator

@vivekgoe vivekgoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckvermaAI you also need to delete the actual functions defined in optimum-habana/optimum/habana/quantizers/bitsandbytes.py

Copy link
Copy Markdown
Collaborator

@vivekgoe vivekgoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vivekgoe vivekgoe added the run-test Run CI for PRs from external contributors label Jun 13, 2025
@vivekgoe vivekgoe merged commit fe56b03 into huggingface:v1.19-release Jun 13, 2025
1 check passed
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-test Run CI for PRs from external contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants