Skip to content

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Mar 31, 2023

Stack from ghstack (oldest at bottom):

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:

…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]
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 31, 2023

🔗 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 Failures

As of commit 1f0dc79:
💚 Looks good so far! There are no failures yet. 💚

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

@github-actions github-actions bot added the release notes: quantization release notes category label Mar 31, 2023
…_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]
@jerryzh168 jerryzh168 changed the title [quant][pt2e][refactor] Remove backend_config of _maybe_insert_input_observers_for_node [quant][pt2e][refactor] Remove backend_config from _maybe_insert_input_observers_for_node Apr 1, 2023
jerryzh168 added a commit that referenced this pull request Apr 1, 2023
…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
@jerryzh168 jerryzh168 requested review from andrewor14 and vkuzo April 1, 2023 00:13
@vkuzo
Copy link
Contributor

vkuzo commented Apr 1, 2023

The goal is to remove the need to use backend_config when pt2e flow code call this function

can you share some context on why?

@jerryzh168
Copy link
Contributor Author

The goal is to remove the need to use backend_config when pt2e flow code call this function

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

Copy link
Contributor

@jcaip jcaip left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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]
jerryzh168 added a commit that referenced this pull request Apr 3, 2023
…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
@jerryzh168
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 3, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / macos-12-py3-arm64-mps / test (default, 1, 1)

Details for Dev Infra team Raised by workflow job

@jerryzh168
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/865/head branch June 8, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: AO frontend release notes: quantization release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants