-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[quant][pt2e][refactor] Remove backend_config
from _maybe_insert_input_observers_for_node
#98094
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
Conversation
…ut_observers_for_node` Summary: The goal is to remove the need to use backend_config when pt2e flow code call this function Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/98094
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1f0dc79: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…_insert_input_observers_for_node`" Summary: The goal is to remove the need to use backend_config when pt2e flow code call this function Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
backend_config
of _maybe_insert_input_observers_for_node
backend_config
from _maybe_insert_input_observers_for_node
…t_observers_for_node` optional Summary: The goal is to enable pt2e flow code call this function without a `backend_config`, we removed `backend_config` in the non-standalone module branch in this PR so we can reuse this code. The standalone_module branch still needs a backend_config, but that doesn't affect pt2e flow Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 7a186e3 Pull Request resolved: #98094
can you share some context on why? |
sure, we don't need this in prepare since validation should be done in quantizer.validate(...) function, so even we have this object (or something similar), it should live in quantizer instead |
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.
LGTM
weight_index = node.meta["target_dtype_info"].get("weight_index", None) | ||
if weight_index is not None and weight_index < len(node.args) and node.args[weight_index] is arg: | ||
return True | ||
return node.kwargs.get("weight") is arg |
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.
I think you can just return False
here?
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.
this might be needed for fx graph mode quantization
…be_insert_input_observers_for_node`" Summary: The goal is to remove the need to use backend_config when pt2e flow code call this function Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
…be_insert_input_observers_for_node`" Summary: The goal is to remove the need to use backend_config when pt2e flow code call this function Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
…t_observers_for_node` optional Summary: The goal is to enable pt2e flow code call this function without a `backend_config`, we removed `backend_config` in the non-standalone module branch in this PR so we can reuse this code. The standalone_module branch still needs a backend_config, but that doesn't affect pt2e flow Test Plan: python test/test_quantization.py TestQuantizeFx Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 11cd27e Pull Request resolved: #98094
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / macos-12-py3-arm64-mps / test (default, 1, 1) Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Stack from ghstack (oldest at bottom):
backend_config
from_maybe_insert_input_observers_for_node
#98094Summary:
The goal is to remove the need to use backend_config when pt2e flow code call this function
Test Plan:
python test/test_quantization.py TestQuantizeFx
Reviewers:
Subscribers:
Tasks:
Tags: