Implement scheme for custom arm_pass_manager insertions (#16396)#16396
Implement scheme for custom arm_pass_manager insertions (#16396)#16396meta-codesync[bot] merged 1 commit intomainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16396
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2e23d86 with merge base d0820e1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
digantdesai
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@pytorchbot label "release notes: none" |
|
NOTE: I have pending changes before merging !! |
Summary: Dual LUT Strategy (from Bolt reference) 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Buck Build Fixes - Created TARGETS file in `/fb` subdirectory to enable Buck discovery - Restructured parent TARGETS to break circular dependency (core → fb, passes → core + fb) - Fixed Python circular import by importing directly from module files Next Steps - Full test suite validation - Performance benchmarking - Reduce number of rescale ops Reviewed By: digantdesai Differential Revision: D87120925
5060a1c to
20401cc
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Reviewed By: digantdesai Differential Revision: D87120925
20401cc to
8614fb8
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Reviewed By: digantdesai Differential Revision: D87120925
8614fb8 to
f2839dd
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Reviewed By: digantdesai Differential Revision: D87120925
f2839dd to
3a6a9bc
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Reviewed By: digantdesai Differential Revision: D87120925
3a6a9bc to
f71e7e5
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts Reviewed By: digantdesai Differential Revision: D87120925
f71e7e5 to
5c8999e
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
5c8999e to
24f8453
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
24f8453 to
47ee19b
Compare
Summary: Port of Dual LUT Strategy (from Bolt reference) to increase reciprocal/rsqrt numerics 1. **Range LUT**: Covers full int16 range, LOW resolution at small values 2. **Resolution LUT**: Scaled input (x*128), HIGH resolution for codes 0-256 Interpolation Weights - **x <= 255**: Use resolution_lut (high accuracy for small values) - **x >= 256**: Use range_lut (works fine for large values) - **Transition at 255/256** to avoid interpolation artifacts bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
47ee19b to
9e1a202
Compare
Summary: Implement scheme for custom arm_pass_manager bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
3a36881 to
5c64e51
Compare
Summary: Pull Request resolved: #16396 Implement scheme for custom arm_pass_manager bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
Summary: Implement scheme for custom arm_pass_manager bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
608d34e to
913af5f
Compare
Summary: Pull Request resolved: #16396 Implement scheme for custom arm_pass_manager bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
Summary: Implement scheme for custom arm_pass_manager bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
54740da to
a2a811c
Compare
|
Hi I see you linkrunner error is I think this was fixed recently You probably need to rebase it. Ill try to rebase rebasing it here to check but you might get meta internal mismatch, let see if so you need to do it on oyr side or re-sync internal version. |
|
hi @3l1 - I'm hoping to use this feature for some changes I'm making - are you aiming to get it in soon? Thanks. |
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
a7867ed to
8cf6f93
Compare
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
8cf6f93 to
1446b8a
Compare
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
1446b8a to
af7da8d
Compare
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
af7da8d to
9d8ed4c
Compare
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
9d8ed4c to
e4b2321
Compare
|
@SS-JIA / @digantdesai this has a conflicting internal Meta version stopping merge, would it be OK to re-import, thanks for the help :) |
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
backends/arm/_passes/TARGETS
Outdated
| @@ -1,13 +1,56 @@ | |||
| load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode") | |||
There was a problem hiding this comment.
This is not available in the shims. For other uses, I guess they are in the .bzl file which is lazily loaded and never loaded in OSS? How about doing something like this,
diff --git a/backends/arm/_passes/TARGETS b/backends/arm/_passes/TARGETS
index e782018f6c..5473ffdec4 100644
--- a/backends/arm/_passes/TARGETS
+++ b/backends/arm/_passes/TARGETS
@@ -1,4 +1,3 @@
-load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
runtime.python_library(
@@ -35,7 +34,7 @@ runtime.python_library(
srcs = [],
deps = [
":arm_pass_manager_base",
- "//executorch/backends/arm/_passes/fb:fb",
+ # @oss-disable: "//executorch/backends/arm/_passes/fb:fb",
],
)
@@ -48,7 +47,7 @@ runtime.python_library(
]),
deps = [
":core",
- ":arm_pass_manager_fb" if is_fbcode else ":arm_pass_manager_base",
+ ":arm_pass_manager_base" if runtime.is_oss else ":arm_pass_manager_fb",
"//executorch/backends/arm/tosa:utils",
"//executorch/backends/arm/tosa/dialect:lib",
"//executorch/backends/transforms:fuse_view_copy",
diff --git a/backends/arm/test/targets.bzl b/backends/arm/test/targets.bzl
index bc7cf84808..c81413ce0f 100644
--- a/backends/arm/test/targets.bzl
+++ b/backends/arm/test/targets.bzl
@@ -1,5 +1,5 @@
# load("//caffe2/test/fb:defs.bzl", "define_tests")
-load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_fbcode")
+load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load("@fbcode_macros//build_defs:python_pytest.bzl", "python_pytest")
load("@bazel_skylib//lib:paths.bzl", "paths")
@@ -67,7 +67,7 @@ def define_arm_tests():
"//executorch/kernels/quantized:custom_ops_generated_lib",
],
deps = [
- "//executorch/backends/arm/test/tester/fb:arm_tester_fb" if is_fbcode else "//executorch/backends/arm/test:arm_tester",
+ "//executorch/backends/arm/test:arm_tester" if runtime.is_oss else "//executorch/backends/arm/test/tester/fb:arm_tester_fb",
"//executorch/backends/arm/test:conftest",
"//executorch/backends/arm/test/misc:dw_convs_shared_weights_module",
"//executorch/backends/arm:ethosu",
Summary: Implement scheme for custom arm_pass_manager + ... bypass-github-export-checks bypass-github-pytorch-ci-checks bypass-github-executorch-ci-checks Reviewed By: digantdesai, Ninja91 Differential Revision: D87120925
Summary:
Implement scheme for custom arm_pass_manager + ...
bypass-github-export-checks
bypass-github-pytorch-ci-checks
bypass-github-executorch-ci-checks
Reviewed By: digantdesai, Ninja91
Differential Revision: D87120925