Add Python runtime end-to-end tests for XNNPACK on Linux#18703
Open
Lidang-Jiang wants to merge 1 commit intopytorch:mainfrom
Open
Add Python runtime end-to-end tests for XNNPACK on Linux#18703Lidang-Jiang wants to merge 1 commit intopytorch:mainfrom
Lidang-Jiang wants to merge 1 commit intopytorch:mainfrom
Conversation
Export small models (add, linear, conv2d+relu, MLP, depthwise separable conv, classifier head) with XNNPACK delegation and verify correctness through the Python runtime (executorch.runtime.Runtime). This is the Linux XNNPACK portion of the Python runtime test gap described in the issue. Each test exports a model to .pte, loads it via Runtime, and asserts that the output matches PyTorch eager mode. Part of pytorch#11225 Signed-off-by: Lidang-Jiang <lidangjiang@gmail.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18703
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Author
|
@pytorchbot label "release notes: xnnpack" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Python runtime end-to-end tests for the XNNPACK backend on Linux — the first batch for the testing gap described in #11225.
Each test exports a small model with XNNPACK delegation, saves it as
.pte, loads it viaexecutorch.runtime.Runtime, and compares the output against PyTorch eager mode. This covers the "developer exports a model, tests it in Python" flow that was previously untested.Models tested:
test_add— element-wise additiontest_linear— single Linear layer (fp32)test_conv2d_relu— Conv2d + ReLUtest_mlp— multi-layer perceptron (Linear → ReLU → Linear)test_depthwise_separable_conv— depthwise + pointwise conv (MobileNet building block)test_classifier_head— AdaptiveAvgPool2d + Flatten + Lineartest_conv_bn— Conv2d + BatchNorm2d + ReLU (skipped:FuseBatchNormPasscrashes; TODO to re-enable)The test file lives in
test/end2end/and is already picked up bypytest.ini(thetest/testpath covers it).Part of #11225 (Linux XNNPACK)
Test output
Test plan
test_conv_bnskipped with TODO —FuseBatchNormPasshas a known bug onSequential(Conv2d, BN)exportruff checkandruff formatpasspytest.inivia thetest/testpathcc @jathu @larryliu0820