-
Notifications
You must be signed in to change notification settings - Fork 524
[not yet for review] migrate pt2e from torch.ao to torchao #10294
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?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10294
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New FailuresAs of commit daadb76 with merge base 08c07fa ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
@@ -34,25 +34,25 @@ | |||
is_ethosu, | |||
) # usort: skip | |||
from executorch.exir.backend.compile_spec_schema import CompileSpec | |||
from torch.ao.quantization.fake_quantize import ( | |||
from torch.fx import GraphModule, Node | |||
from torchao.quantization.pt2e import _ObserverOrFakeQuantizeConstructor |
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.
Correct me if I am wrong but torchao
isn't a mandetory dep today but now it is?
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.
How do we define mandatory dependencies? It is installed by the install_requirements script?
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.
Seems like we pull in source -
Line 60 in 647e1f1
url = https://github.com/pytorch/ao.git |
So this submodule is already updated since the tests are passing here.
check (1) if we run tests on et wheels with something quant, (2) if we do are they passing for this diff.
@@ -16,25 +16,25 @@ | |||
propagate_annotation, | |||
QuantizationConfig, | |||
) | |||
from torch.ao.quantization.fake_quantize import ( | |||
from torchao.quantization.pt2e.fake_quantize import ( |
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.
Adding partners for visibility |
from torch.ao.quantization.observer import HistogramObserver, MinMaxObserver | ||
from torch.ao.quantization.quantizer import DerivedQuantizationSpec, Quantizer | ||
from torch.ao.quantization.quantizer.composable_quantizer import ComposableQuantizer | ||
from torchao.quantization.pt2e.observer import HistogramObserver, MinMaxObserver |
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.
cc @robert-kalmar FYI
|
||
from torch.export import export | ||
from torch.export.exported_program import ExportedProgram | ||
from torchao.quantization.pt2e.quantize_pt2e import convert_pt2e, prepare_pt2e |
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.
FYI @mcremon-meta
@@ -34,25 +34,25 @@ | |||
is_ethosu, | |||
) # usort: skip | |||
from executorch.exir.backend.compile_spec_schema import CompileSpec | |||
from torch.ao.quantization.fake_quantize import ( | |||
from torch.fx import GraphModule, Node | |||
from torchao.quantization.pt2e import _ObserverOrFakeQuantizeConstructor |
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.
FYI @freddan80 @per
Most code related to PT2E quantization is migrating from torch.ao.quantization to torchao.quantization.pt2e.
torchao.quantization.pt2e contains an exact copy of PT2E code in torch.ao.quantization.
The torchao pin in ExecuTorch has already been bumped pick up these changes.