Skip to content

Conversation

@jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Oct 14, 2019

Stack from ghstack:

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

Differential Revision: D18360139

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 15, 2019
Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1176493
Pull Request resolved: #27950
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 17, 2019
Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: ee15097
Pull Request resolved: #27950
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@jerryzh168 jerryzh168 requested a review from eellison October 17, 2019 18:22
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 17, 2019
Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: 4c406ac
Pull Request resolved: #27950
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@jerryzh168 jerryzh168 requested a review from apaszke as a code owner October 18, 2019 19:02
jerryzh168 added a commit that referenced this pull request Oct 18, 2019
Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: 769c265
Pull Request resolved: #27950
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 2, 2019
Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: e14178b
Pull Request resolved: #27950
… in graph mode"

Summary:
Make observers scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
… in graph mode"

Summary:
Make HistogramObserver scriptable with `@torch.jit.ignore`

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
…`@torch.jit.ignore`"

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@jerryzh168 jerryzh168 changed the title [quant][graphmode] Accept observers with ignored functions in graph mode [quant][graphmode] Make HistogramObserver scriptable with @torch.jit.ignore Nov 6, 2019
jerryzh168 added a commit that referenced this pull request Nov 6, 2019
….ignore`

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: 87194aa
Pull Request resolved: #27950
@jerryzh168
Copy link
Contributor Author

This is ready for review please take a look

@jerryzh168 jerryzh168 requested a review from bzinodev November 6, 2019 02:21
@eellison eellison removed their request for review November 6, 2019 03:19
@jerryzh168 jerryzh168 requested a review from jamesr66a November 6, 2019 17:53
Copy link

@ZolotukhinM ZolotukhinM left a comment

Choose a reason for hiding this comment

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

Looks good, but please remove unnecessary changes and split out unrelated changes and avoid that in future.

r.register_attribute(
s.name,
s.value.type(),
type()->getAttribute(s.name),

Choose a reason for hiding this comment

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

This is an unrelated change.

def _combine_histograms(
self, dst_histogram, dst_min, dst_max, src_histogram, src_min, src_max
):
# type: (Tensor, float, float, Tensor, float, float) -> Tensor

Choose a reason for hiding this comment

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

Do you need this if the function is ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, we need this otherwise everything will be treated as Tensor

# remaining should go to dst_bin2
if dst_bin_cnt < src_bin_count:
dst_histogram[dst_bin2] += src_bin_count - dst_bin_cnt
return dst_histogram

Choose a reason for hiding this comment

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

This seems to be an unnecessary change.

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 is needed for compile as well, ignored functions seems to take Tensor as return only

…`@torch.jit.ignore`"

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
…`@torch.jit.ignore`"

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 6, 2019
….ignore`

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: bf26f89
Pull Request resolved: #27950
…`@torch.jit.ignore`"

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 4bcf479.

xxtEchjovs44 pushed a commit to xxtEchjovs44/pytorch that referenced this pull request Jan 29, 2020
….ignore`

Summary:
att

Test Plan:
python test/test_quantization.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: add7f5d
Pull Request resolved: pytorch/pytorch#27950
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.

5 participants