Skip to content

Conversation

@guangy10
Copy link
Contributor

@guangy10 guangy10 commented Mar 18, 2025

What does this PR do?

As titled. Add support for Phi3-mini and Phi4-mini as they are sharing the same modeling code. It's requiring additional configure (rope_type = "default") to make it exportable, otherwise we will have to rewrite the modeling code, specifically, specialize or get rid of the control flow in _longrope_frequency_update.

Before submitting

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.

@ArthurZucker @amyeroberts @qubvel

@github-actions github-actions bot marked this pull request as draft March 18, 2025 00:30
@github-actions
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@guangy10 guangy10 marked this pull request as ready for review March 18, 2025 01:17
@github-actions github-actions bot requested a review from ydshieh March 18, 2025 01:18
Copy link
Contributor

@qubvel qubvel left a comment

Choose a reason for hiding this comment

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

Thanks @guangy10, looks good to me!

@qubvel qubvel added torch export Issues and PRs related to torch.export compatibility Text labels Mar 18, 2025
@qubvel
Copy link
Contributor

qubvel commented Mar 18, 2025

run-slow: phi3

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs: This comment contains run-slow, running the specified jobs:

models: ['models/phi3']
quantizations: [] ...

@guangy10
Copy link
Contributor Author

run-slow: phi3

@guangy10
Copy link
Contributor Author

cc: @tugsbayasgalan

@ydshieh
Copy link
Collaborator

ydshieh commented Mar 18, 2025

run-slow: phi3

FYI: this trigger by comment is only reserved for some transformers internal members.

@ydshieh
Copy link
Collaborator

ydshieh commented Mar 18, 2025

run-slow: phi3

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs: This comment contains run-slow, running the specified jobs:

models: ['models/phi3']
quantizations: [] ...

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Hi @guangy10 Thank you for this PR.

To pass the CI (on our runner), we will have to update the expected value 🙏 .

@ydshieh ydshieh merged commit 69bcb86 into huggingface:main Mar 25, 2025
12 checks passed
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
* Export for Phi4-mini

* Update tests/models/phi3/test_modeling_phi3.py

---------

Co-authored-by: Guang Yang <guangyang@fb.com>
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
soghomon-b pushed a commit to soghomon-b/transformers that referenced this pull request Aug 24, 2025
* Export for Phi4-mini

* Update tests/models/phi3/test_modeling_phi3.py

---------

Co-authored-by: Guang Yang <guangyang@fb.com>
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Text torch export Issues and PRs related to torch.export compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants