Skip to content

Hot fix regional compilation#2005

Merged
regisss merged 2 commits into
mainfrom
use-accelerate-compile-regions
Jun 2, 2025
Merged

Hot fix regional compilation#2005
regisss merged 2 commits into
mainfrom
use-accelerate-compile-regions

Conversation

@IlyasMoutawwakil
Copy link
Copy Markdown
Member

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@IlyasMoutawwakil IlyasMoutawwakil marked this pull request as ready for review May 27, 2025 15:57
@IlyasMoutawwakil IlyasMoutawwakil requested a review from regisss as a code owner May 27, 2025 15:57
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yafshar
Copy link
Copy Markdown
Contributor

yafshar commented May 27, 2025

@IlyasMoutawwakil I am getting an error with this PR

[INFO|trainer.py:831] 2025-05-27 18:16:00,172 >>   Number of trainable parameters = 16,384,000
[rank0]: Traceback (most recent call last):
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/optimum/habana/transformers/trainer.py", line 2587, in _zero_model_grad
[rank0]:     model.zero_grad(set_to_none=set_to_none)
[rank0]: TypeError: DeepSpeedEngine.zero_grad() got an unexpected keyword argument 'set_to_none'

[rank0]: During handling of the above exception, another exception occurred:

[rank0]: Traceback (most recent call last):
[rank0]:   File "/root/optimum-habana/examples/language-modeling/run_lora_clm.py", line 990, in <module>
[rank0]:     main()
[rank0]:   File "/root/optimum-habana/examples/language-modeling/run_lora_clm.py", line 963, in main
[rank0]:     train_result = trainer.train(resume_from_checkpoint=training_args.resume_from_checkpoint)
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/optimum/habana/transformers/trainer.py", line 610, in train
[rank0]:     return inner_training_loop(
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/optimum/habana/transformers/trainer.py", line 882, in _inner_training_loop
[rank0]:     self._zero_model_grad(model)
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/optimum/habana/transformers/trainer.py", line 2590, in _zero_model_grad
[rank0]:     model.zero_grad()
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/deepspeed/runtime/engine.py", line 2119, in zero_grad
[rank0]:     for param_name, param in self.module.named_parameters():
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/deepspeed/runtime/engine.py", line 519, in __getattr__
[rank0]:     return getattr(self, name)
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/deepspeed/runtime/engine.py", line 519, in __getattr__
[rank0]:     return getattr(self, name)
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/deepspeed/runtime/engine.py", line 519, in __getattr__
[rank0]:     return getattr(self, name)
[rank0]:   [Previous line repeated 491 more times]
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/deepspeed/runtime/engine.py", line 518, in __getattr__
[rank0]:     if name in dir(self):
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2972, in __dir__
[rank0]:     module_attrs = dir(self.__class__)
[rank0]: RecursionError: maximum recursion depth exceeded while calling a Python object

@yafshar
Copy link
Copy Markdown
Contributor

yafshar commented May 28, 2025

with the latest fix there is no error for above example

Copy link
Copy Markdown
Collaborator

@regisss regisss left a comment

Choose a reason for hiding this comment

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

LGTM

@regisss regisss merged commit 0c6f256 into main Jun 2, 2025
8 checks passed
@regisss regisss deleted the use-accelerate-compile-regions branch June 2, 2025 12:52
regisss added a commit that referenced this pull request Jun 2, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jun 5, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jun 10, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 3, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 3, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Jul 3, 2025
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
astachowiczhabana added a commit that referenced this pull request Jul 4, 2025
* Hot fix regional compilation (#2005)

Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>

* More makefile fixes (#2036)

* add token to single card tests

* remove non existent diffusers test group

* more makefile and cli fixes

* fix

* Update Makefile

---------

Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com>
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
gplutop7 pushed a commit to HabanaAI/optimum-habana-fork that referenced this pull request Oct 15, 2025
* Merge v1.18-release

* Hot fix regional compilation (huggingface#2005)

Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>

* Enable mixtral 8x7b accuracy evaluation (huggingface#1986)

Co-authored-by: Rafal <rbogdanowicz@habana.ai>

* Update readme files for explicit lazy mode (huggingface#1921)

Co-authored-by: Karol Brejna <karol.brejna@intel.com>
Co-authored-by: Piotr Bielak <piotr.bielak@intel.com>

* [llama-vision] Remove token_idx_cpu parameter (huggingface#2018)

Integer parameter token_idx_cpu passed to mllama's forward()
method caused an issue with hpu graph cache which led to
performance drop.

Signed-off-by: Urszula <urszula.golowicz@intel.com>

* Update README examples (huggingface#2020)

* Fix examples in README

audio-classification:
- add space between "False" and backslash

image-to-text:
- add "datasets" to requirements.txt

pytorch-image-models:
- add "datasets" to requirements.txt

sentence-transformers-training/nli:
- add command to properly discover HABANA_VISIBLE_MODULES

sentence-transformers-training/sts:
- add command to properly discover HABANA_VISIBLE_MODULES

speech-recognition:
- add `--trust_remote_code` for seq2seq examples

stable-diffusion/training:
- add missing OpenCV requirement for ControlNet Training

Co-authored-by: Karol Brejna <karol.brejna@intel.com>

* Review fixes: remove grabbing all modules

---------

Co-authored-by: Karol Brejna <karol.brejna@intel.com>
Co-authored-by: karol-brejna-i <karolbrejna@apache.org>

* Pin latest optimum to force mutual updates (huggingface#2016)

pin latest optimum to force mutual updates

* Fix FP8 support and address related issues (huggingface#2010)

- Resolve bugs related to FP8 (floating point 8-bit) computation
- Improve stability and correctness of FP8 operations
- Add/fix tests to validate FP8 functionality
- Update relevant documentation and comments

Co-authored-by: IlyasMoutawwakil

---------

Signed-off-by: Urszula <urszula.golowicz@intel.com>
Co-authored-by: Adam Stachowicz <astachowicz@habana.ai>
Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com>
Co-authored-by: regisss <15324346+regisss@users.noreply.github.com>
Co-authored-by: Rafal Bogdanowicz <rafal.bogdanowicz@intel.com>
Co-authored-by: Rafal <rbogdanowicz@habana.ai>
Co-authored-by: Jan Kamiński <jkaminski@habana.ai>
Co-authored-by: Karol Brejna <karol.brejna@intel.com>
Co-authored-by: Piotr Bielak <piotr.bielak@intel.com>
Co-authored-by: Urszula Golowicz <urszula.golowicz@intel.com>
Co-authored-by: Piotr Bielak <pbielak@users.noreply.github.com>
Co-authored-by: karol-brejna-i <karolbrejna@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants