Repository navigation
Conversation
Find single-input, single-output pointwise regions in a shared pass and lower each region directly to one lookup table. Extend Arm table insertion to use the region search, including int16 tables and their output rescale, and configure Cortex-M lowering through a subclass. Fuse add, subtract, multiply and divide with one-element constants. Evaluate regions in FP32, preserving input and constant dequantization and quantizing only the final table entries with backend rounding. Keep graph search independent of backend operators and quantization conventions. Preserve standalone requantization and unary input boundaries, and retain valid suffixes after multi-input operations. Cover integer code domains, branches, constants, mutation boundaries, explicit Q/DQ, Arm int16 interpolation and both Cortex-M layouts. Authored with AI assistance using OpenAI Codex. Jira: MLETORCH-2880 Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com> Change-Id: I79816eec03db314c38d90faa8a6ef9fa4719f83c
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24985
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit 9792a0e with merge base f8373ec ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Collaborator
|
Hi @rascani and @digantdesai this adds a file outside Arm :) |
This branch has not been deployed
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
Pointwise quantized chains currently leave separate operations for backends to lower, limiting LUT fusion and duplicating graph search. Add a shared pass that finds single-input, single-output pointwise regions and evaluates each region as one lookup table. Arm uses the pass for int8 and int16 tables, while Cortex-M configures its backend-specific lowering through a subclass. The pass fuses unary operators and add, subtract, multiply, and divide with scalar constants.
Table evaluation keeps FP32 intermediates and quantizes only the final entries using backend rounding. Region boundaries preserve standalone requantization, avoid fusing pure Q/DQ, and retain valid suffixes after multi-input operations.
For review, start with
backends/transforms/fuse_elementwise_to_lut.py, then the Arm and Cortex-M pass integrations and their tests.Jira: MLETORCH-2880
Authored with AI assistance using OpenAI Codex.
Test plan
pytest -q backends/arm/test/passes/test_arm_fuse_elementwise_to_lut.py backends/arm/test/passes/test_insert_table_ops_lowering.py backends/arm/test/passes/test_insert_table_ops_pass.py pytest -q backends/transforms/test/test_fuse_elementwise_to_lut.py backends/cortex_m/test/test_cortex_m_fuse_elementwise_to_lut.py backends/cortex_m/test/test_activation_lut.py pytest -q backends/cortex_m/test/misc/test_quantization.py pytest -q backends/cortex_m/test/ops/test_sdpa.py -k 'not test_implementation_sdpa'Full TOSA reference and FVP validation were unavailable locally.
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani