pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.31k stars 206 forks source link

Add pattern template for binary bitwise ops #3486

Closed swolchok closed 1 week ago

swolchok commented 2 weeks ago

Summary: Similar to D56744651.

Differential Revision: D56852163

pytorch-bot[bot] commented 2 weeks ago

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3486

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

:x: 34 New Failures

As of commit 58dba0c3bacddc3af1c8392a99a3112aafd6e0d4 with merge base f227fc3dab30ed1d2de10452bce7219c9ad47955 (image):

NEW FAILURES - The following jobs have failed:

* [Build documentation / build (buck2) / Build doc](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691063866) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988027/job/24691063866)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-binary-size-linux / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691072495) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691072495)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-binary-size-linux-gcc / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691075337) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691075337)) `/pytorch/executorch/../executorch/kernels/portable/cpu/util/broadcast_util.h:279:13: error: 'void torch::executor::apply_binary_elementwise_fn(const Op&, const Tensor&, const Tensor&, const Tensor&) [with CTYPE_A = bool; CTYPE_B = bool; CTYPE_OUT = bool; Op = torch::executor::native::bitwise_op_out(torch::executor::RuntimeContext&, const Tensor&, const Tensor&, torch::executor::Tensor&, const char*) [with OpFunc = std::bit_and; torch::executor::Tensor = torch::executor::Tensor; torch::executor::RuntimeContext = torch::executor::KernelRuntimeContext]::::::::::::::::::; torch::executor::Tensor = torch::executor::Tensor]', declared using local type 'const torch::executor::native::bitwise_op_out(torch::executor::RuntimeContext&, const Tensor&, const Tensor&, torch::executor::Tensor&, const char*) [with OpFunc = std::bit_and; torch::executor::Tensor = torch::executor::Tensor; torch::executor::RuntimeContext = torch::executor::KernelRuntimeContext]::::::::::::::::::', is used but never defined [-fpermissive]` * [pull / test-custom-ops-linux (buck2) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691078079) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691078079)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-custom-ops-linux (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691081144) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691081144)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, buck2, portable) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691085570) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691085570)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, buck2, xnnpack+custom) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691086722) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691086722)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, buck2, xnnpack+custom+qe) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691083012) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691083012)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, cmake, portable) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691087713) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691087713)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, cmake, xnnpack+custom) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691089162) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691089162)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux (fp32, cmake, xnnpack+custom+qe) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691088361) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691088361)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-llama-runner-linux-android (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691089839) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691089839)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (buck2, mv3, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691100148) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691100148)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (buck2, mv3, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691103135) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691103135)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, add, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691101889) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691101889)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, add, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691105171) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691105171)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, ic3, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691107758) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691107758)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, ic3, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691109661) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691109661)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, llava_encoder, portable, linux.4xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691110467) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691110467)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, mv2, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691111117) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691111117)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, mv2, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691111818) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691111818)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, mv3, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691112645) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691112645)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, mv3, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691113212) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691113212)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, resnet18, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691114859) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691114859)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, resnet18, xnnpack-quantization-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691113653) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691113653)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, vit, portable, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691114278) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691114278)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-models-linux (cmake, vit, xnnpack-delegation, linux.2xlarge, 90) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691115592) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691115592)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-pybind-build-linux (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691091386) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691091386)) ` /pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-quantized-aot-lib-linux (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691090551) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691090551)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-selective-build-linux (buck2) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691092339) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691092339)) `buck-out/v2/gen/root/524f8da68ea2a374/kernels/portable/cpu/pattern/__bitwise_op__/buck-headers/executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-selective-build-linux (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691093401) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691093401)) `/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / test-setup-linux-gcc (cmake) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691094771) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691094771)) `/pytorch/executorch/../executorch/kernels/portable/cpu/util/broadcast_util.h:279:13: error: 'void torch::executor::apply_binary_elementwise_fn(const Op&, const Tensor&, const Tensor&, const Tensor&) [with CTYPE_A = bool; CTYPE_B = bool; CTYPE_OUT = bool; Op = torch::executor::native::bitwise_op_out(torch::executor::RuntimeContext&, const Tensor&, const Tensor&, torch::executor::Tensor&, const char*) [with OpFunc = std::bit_or; torch::executor::Tensor = torch::executor::Tensor; torch::executor::RuntimeContext = torch::executor::KernelRuntimeContext]::::::::::::::::::; torch::executor::Tensor = torch::executor::Tensor]', declared using local type 'const torch::executor::native::bitwise_op_out(torch::executor::RuntimeContext&, const Tensor&, const Tensor&, torch::executor::Tensor&, const char*) [with OpFunc = std::bit_or; torch::executor::Tensor = torch::executor::Tensor; torch::executor::RuntimeContext = torch::executor::KernelRuntimeContext]::::::::::::::::::', is used but never defined [-fpermissive]` * [pull / unittest / linux (buck2) / linux-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691096644) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691096644)) ` /pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression` * [pull / unittest / macos (buck2) / macos-job](https://hud.pytorch.org/pr/pytorch/executorch/3486#24691095683) ([gh](https://github.com/pytorch/executorch/actions/runs/8988988046/job/24691095683)) ` /Users/ec2-user/runner/_work/executorch/executorch/pytorch/executorch/../executorch/kernels/portable/cpu/pattern/bitwise_op.h:40:9: error: constexpr variable 'et_switch_name' must be initialized by a constant expression`

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

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D56852163

facebook-github-bot commented 2 weeks ago

This pull request was exported from Phabricator. Differential Revision: D56852163

facebook-github-bot commented 1 week ago

This pull request was exported from Phabricator. Differential Revision: D56852163

facebook-github-bot commented 1 week ago

This pull request was exported from Phabricator. Differential Revision: D56852163

facebook-github-bot commented 1 week ago

This pull request was exported from Phabricator. Differential Revision: D56852163

swolchok commented 1 week ago

selective build requires constexpr op names, so we can't refactor core parts of ops into template functions until/unless we come up with another way to do selective build.