-
Notifications
You must be signed in to change notification settings - Fork 848
Add memory planning to oss tests #17596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| from typing import Any, Callable, List, Optional, Tuple, Type | ||
|
|
||
| import executorch.exir as exir | ||
|
|
||
| import torch | ||
| from executorch.exir import ExecutorchBackendConfig, to_edge | ||
| from executorch.exir.capture._capture import patch_forward | ||
|
|
@@ -37,7 +36,6 @@ | |
| from executorch.exir.tensor import TensorSpec | ||
| from functorch.experimental.control_flow import map as torch_map | ||
| from parameterized import parameterized | ||
|
|
||
| from torch import nn | ||
| from torch.ao.quantization import ( # @manual=//caffe2:torch | ||
| float_qparams_weight_only_qconfig, | ||
|
|
@@ -61,7 +59,21 @@ | |
| from torch.nn import functional as F | ||
| from torch.utils import _pytree as pytree | ||
|
|
||
| torch.ops.load_library("//executorch/kernels/portable:custom_ops_generated_lib") | ||
| try: | ||
| torch.ops.load_library("//executorch/kernels/portable:custom_ops_generated_lib") | ||
| except (OSError, RuntimeError): | ||
| # When running outside of Buck (e.g., CMake/pip), find the shared library | ||
| # by globbing relative to the kernels/portable directory. | ||
| from pathlib import Path | ||
|
|
||
| _libs = list( | ||
| Path(__file__) | ||
| .parent.parent.parent.resolve() | ||
| .glob("**/kernels/portable/**/*custom_ops_generated_lib.*") | ||
| ) | ||
| if _libs: | ||
| torch.ops.load_library(str(_libs[0])) | ||
|
Comment on lines
+69
to
+75
|
||
| del Path | ||
|
|
||
|
|
||
| def swap_modules( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ addopts = | |
| --ignore=exir/backend/test/demos/test_delegate_aten_mode.py | ||
| --ignore=exir/backend/test/demos/test_xnnpack_qnnpack.py | ||
| --ignore=exir/tests/test_memory_format_ops_pass_aten.py | ||
| --ignore=exir/tests/test_memory_planning.py | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol. Didnt realize we had so much stuff disabled |
||
| --ignore=exir/tests/test_passes.py | ||
| --ignore=exir/tests/test_quantization.py | ||
| --ignore=exir/tests/test_verification.py | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Buck target load fails and the glob finds no matches, the module import continues without loading
custom_ops_generated_lib, which will likely cause later failures inToOutVarPass(missing out variants) with a less-direct error. Consider failing fast with a clearer error or skipping these tests when the library cannot be located/loaded.