Skip to content

Fix the seamless_m4t cannot work on Gaudi - #38363

Merged
IlyasMoutawwakil merged 11 commits into
huggingface:mainfrom
yuanwu2017:facebook
Jun 25, 2025
Merged

Fix the seamless_m4t cannot work on Gaudi#38363
IlyasMoutawwakil merged 11 commits into
huggingface:mainfrom
yuanwu2017:facebook

Conversation

@yuanwu2017

Copy link
Copy Markdown
Contributor

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 read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Signed-off-by: yuanwu <yuan.wu@intel.com>
@yuanwu2017
yuanwu2017 marked this pull request as draft May 26, 2025 07:27
@Rocketknight1

Copy link
Copy Markdown
Member

cc @IlyasMoutawwakil I think? Feel free to ping me if this should go to someone else!

@IlyasMoutawwakil

Copy link
Copy Markdown
Member

@yuanwu2017 can be more specific about what you're fixing here ?

@yuanwu2017

Copy link
Copy Markdown
Contributor Author

@IlyasMoutawwakil The torch.gather cannot work correctly on Gaudi with seamless_m4t. The patch is only for tracking this issue. I will closed it.

@yuanwu2017 yuanwu2017 closed this May 28, 2025
Signed-off-by: yuanwu <yuan.wu@intel.com>
Signed-off-by: yuanwu <yuan.wu@intel.com>
@yuanwu2017 yuanwu2017 reopened this Jun 17, 2025
@yuanwu2017

Copy link
Copy Markdown
Contributor Author

git clone https://github.com/yuanwu2017/llm-dbg.git
PT_HPU_LAZY_MODE=1 run_text-to-speech.py
Before:
image
After:
image

@yuanwu2017
yuanwu2017 marked this pull request as ready for review June 17, 2025 07:25
@github-actions
github-actions Bot requested a review from eustlb June 17, 2025 07:25
@yuanwu2017

Copy link
Copy Markdown
Contributor Author

@IlyasMoutawwakil Can we merge this patch first? The root cause is that Gaudi torch.gather cannot support input of int64 or long . It seems slow to fix this bug from the Gaudi pytorch. After they fix, I will remove the workaround.

@yuanwu2017

Copy link
Copy Markdown
Contributor Author

@yao-matrix

@IlyasMoutawwakil

Copy link
Copy Markdown
Member

@yuanwu2017 you can patch it in the is_torch_hpu_available method, the same way we patched masked_fill_ :

def patched_masked_fill_(self, mask, value):

the transformers modeling code can't afford to be bloated with accelerator specific patches.

Signed-off-by: yuanwu <yuan.wu@intel.com>
Signed-off-by: yuanwu <yuan.wu@intel.com>
@yuanwu2017

Copy link
Copy Markdown
Contributor Author

Done.

Signed-off-by: yuanwu <yuan.wu@intel.com>
@yuanwu2017

Copy link
Copy Markdown
Contributor Author

Test passed.
image
image

Signed-off-by: yuanwu <yuan.wu@intel.com>
Comment thread src/transformers/utils/import_utils.py
@yuanwu2017

Copy link
Copy Markdown
Contributor Author

Done.

Signed-off-by: yuanwu <yuan.wu@intel.com>
@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.

@IlyasMoutawwakil
IlyasMoutawwakil enabled auto-merge (squash) June 20, 2025 07:16
@IlyasMoutawwakil
IlyasMoutawwakil requested a review from ydshieh June 20, 2025 07:16
@IlyasMoutawwakil
IlyasMoutawwakil merged commit de98fb2 into huggingface:main Jun 25, 2025
20 checks passed
@ydshieh

ydshieh commented Jun 25, 2025

Copy link
Copy Markdown
Collaborator

sorry I missed this.

You might consider open an issue to track the patched stuffs and remove them once things are fixed (as mentioned in the added comments)

@yuanwu2017

Copy link
Copy Markdown
Contributor Author

Done.

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.

5 participants