Skip to content

Conversation

@metascroy
Copy link
Contributor

@metascroy metascroy commented Sep 8, 2025

This PR adds new tests that the pre-quantized model checkpoints we publish on pytorch work with ExecuTorch (lowering and C++ runner).

qwen3-4b is tested for both lowering and runtime.

phi4-mini is tested for lowering. There appears to be a regression in the C++ HF tokenizer used in the ExecuTorch, and it no longer works with the phi4-mini tokenizer. See #14077

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 8, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14074

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Cancelled Job, 37 Pending

As of commit 2f47f54 with merge base a90e907 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 8, 2025
@metascroy metascroy added ciflow/trunk and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Sep 8, 2025
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 8, 2025
case "$MODEL_NAME" in
qwen3_4b)
echo "Running Qwen3-4B export..."
HF_MODEL_DIR=$(hf download metascroy/Qwen3-4B-INT8-INT4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: before landing, update the PyTorch checkpoint and change this to pytorch/Qwen3-4B-INT8-INT4


phi_4_mini)
echo "Running Phi-4-mini export..."
HF_MODEL_DIR=$(hf download metascroy/Phi-4-mini-instruct-INT8-INT4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: before landing, update the PyTorch checkpoint and change this to pytorch/Phi-4-mini-instruct-INT8-INT4

Comment on lines +109 to +124
cmake -DPYTHON_EXECUTABLE=python \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DEXECUTORCH_ENABLE_LOGGING=1 \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM_RUNNER=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
-Bcmake-out .
cmake --build cmake-out -j16 --config Release --target install
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we just test via the preset now?

https://github.com/pytorch/executorch/blob/main/examples/models/llama/README.md#step-3-run-on-your-computer-to-validate

cmake --preset llm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't seem to work. I'm reverting back to not using the preset.

I filed an issue here: #14132

@metascroy metascroy merged commit dc944fe into main Sep 9, 2025
462 of 466 checks passed
@metascroy metascroy deleted the add-torchao-checkpoint-tests branch September 9, 2025 22:05
@@ -0,0 +1,139 @@
#!/usr/bin/env bash
set -euo pipefail
Copy link
Contributor

Choose a reason for hiding this comment

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

please use -x as well for scripts that will run in CI; makes debugging easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants