Skip to content

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Nov 10, 2023

Stack from ghstack (oldest at bottom):

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

  • Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

…same place

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Nov 10, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/113458

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

✅ No Failures

As of commit 23e2da8 with merge base 2a271a3 (image):
💚 Looks good so far! There are no failures yet. 💚

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

jerryzh168 added a commit that referenced this pull request Nov 10, 2023
…same place

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: d515759
Pull Request resolved: #113458
@github-actions github-actions bot added the release notes: quantization release notes category label Nov 10, 2023
…ing in the same place"

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]

# sharing with other users of the previous output
# (arg, user)
for user in arg.users:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a refactor change, right?

Copy link
Contributor Author

@jerryzh168 jerryzh168 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a refactor, we removed this logic from insert observers and added it here

Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment

@jerryzh168
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 15, 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

@huydhn
Copy link
Contributor

huydhn commented Nov 16, 2023

@pytorchbot revert -m 'Sorry for reverting your change but it is failing executorch export test for llama2' -c ghfirst

The error is:

======================================================================
ERROR: test_llama_qnn (executorch.examples.models.llama2.fb.test_llama_qnn.LlamaLiteModelExportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/executorch/examples/models/llama2/fb/test_llama_qnn.py", line 70, in test_llama_qnn
    prepared_gm = prepare_pt2e(captured_gm, QnnHtpQuantizer())
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/quantize_pt2e.py", line 109, in prepare_pt2e
    model = prepare(model, node_name_to_scope, is_qat=False)
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/pt2e/prepare.py", line 442, in prepare
    edge_or_node_to_group_id = _get_edge_or_node_to_group_id(edge_or_node_to_qspec)
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/pt2e/prepare.py", line 206, in _get_edge_or_node_to_group_id
    for user in arg.users:
AttributeError: 'int' object has no attribute 'users'

----------------------------------------------------------------------
Ran 1 test in 6.339s

Just FYI, I'm working on bring this test to OSS https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/test.sh#L1014-L1016

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@jerryzh168 your PR has been successfully reverted.

pytorchmergebot added a commit that referenced this pull request Nov 16, 2023
… in the same place (#113458)"

This reverts commit 585e315.

Reverted #113458 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it is failing executorch export test for llama2 ([comment](#113458 (comment)))
jerryzh168 added a commit that referenced this pull request Nov 17, 2023
… in the same place (#113458)

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 17, 2023
… in the same place (#113458)

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: dadc425
Pull Request resolved: #113920
@jerryzh168
Copy link
Contributor Author

@pytorchbot revert -m 'Sorry for reverting your change but it is failing executorch export test for llama2' -c ghfirst

The error is:

======================================================================
ERROR: test_llama_qnn (executorch.examples.models.llama2.fb.test_llama_qnn.LlamaLiteModelExportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/executorch/examples/models/llama2/fb/test_llama_qnn.py", line 70, in test_llama_qnn
    prepared_gm = prepare_pt2e(captured_gm, QnnHtpQuantizer())
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/quantize_pt2e.py", line 109, in prepare_pt2e
    model = prepare(model, node_name_to_scope, is_qat=False)
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/pt2e/prepare.py", line 442, in prepare
    edge_or_node_to_group_id = _get_edge_or_node_to_group_id(edge_or_node_to_qspec)
  File "/data/sandcastle/boxes/eden-trunk-hg-fbcode-fbsource/buck-out/v2/gen/fbcode/24c04fc3eb9063ab/executorch/examples/models/llama2/fb/__test_llama_qnn__/test_llama_qnn#link-tree/torch/ao/quantization/pt2e/prepare.py", line 206, in _get_edge_or_node_to_group_id
    for user in arg.users:
AttributeError: 'int' object has no attribute 'users'

----------------------------------------------------------------------
Ran 1 test in 6.339s

Just FYI, I'm working on bring this test to OSS https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/test.sh#L1014-L1016

this feels like an error on HtpQnnQuantizer side actually, I'll check with Shen

jerryzh168 added a commit that referenced this pull request Nov 20, 2023
…rver to do sharing checking in the same place (#113458)"

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D51420029](https://our.internmc.facebook.com/intern/diff/D51420029)

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 20, 2023
… in the same place (#113458)

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9888739
Pull Request resolved: #113920
jerryzh168 added a commit that referenced this pull request Nov 20, 2023
…ng checking in the same place (#113458)"

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D51420029](https://our.internmc.facebook.com/intern/diff/D51420029)

[ghstack-poisoned]
@jerryzh168
Copy link
Contributor Author

reland PR: #113920

@jerryzh168 jerryzh168 closed this Nov 21, 2023
pytorchmergebot pushed a commit that referenced this pull request Nov 22, 2023
… in the same place (#113458) (#113920)

Summary:
Previously it is scatter in two different places: before inserting observer and during observer,
this PR moved everything before we insert observer

* Next: refactor QuantizationSpec and check more fields for sharing

Test Plan:
CI (regression tests)

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D51420029](https://our.internmc.facebook.com/intern/diff/D51420029)
Pull Request resolved: #113920
Approved by: https://github.com/andrewor14
@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/933/head branch November 25, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants