-
Notifications
You must be signed in to change notification settings - Fork 536
Add Phi-4-mini-instruct #8856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Phi-4-mini-instruct #8856
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/8856
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New FailuresAs of commit a8231d8 with merge base 7aa6494 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@guangy10 any way I can run some on demand benchmarks for this model? |
This is awesome to enable a new model in a day! |
.ci/scripts/gather_test_models.py
Outdated
@@ -90,7 +90,7 @@ def model_should_run_on_event(model: str, event: str) -> bool: | |||
We put higher priority and fast models to pull request and rest to push. | |||
""" | |||
if event == "pull_request": | |||
return model in ["mv3", "vit"] | |||
return model in ["mv3", "vit", "phi4_mini"] # TODO: remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to remove it, probably it's mostly covered by llama tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it's just too large to run on every pull request, we only run the small ones on pull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks
It's nice that the exported .pte file can be verified via python binding. That inspired me if we could automate the process, similar to MLX. Essentially we could have hugging face model card name as input, and with a prompt we get the output. |
Summary
Add phi-4-mini 3.8B with fractional rotary embeddings. Only works for short context, still need to implement longrope for longer sequence lengths.
Sample prompt and response (xnnpack + 8da4w quant):
Closes #8813
Test plan
Convert weights:
Export xnnpack with quantization:
Run via pybindings: