Skip to content

Conversation

@dzdang
Copy link
Contributor

@dzdang dzdang commented Mar 25, 2022

Stack from ghstack:

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:

python run_test.py

Differential Revision: D35148152

…-quantized reflection_pad1d_out_template

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

facebook-github-bot commented Mar 25, 2022

🔗 Helpful links

💊 CI failures summary and remediations

As of commit c6a3219 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

…zed and non-quantized reflection_pad1d_out_template"

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

[ghstack-poisoned]
dzdang added a commit that referenced this pull request Mar 25, 2022
…-quantized reflection_pad1d_out_template

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: 7a9b135
Pull Request resolved: #74755
…zed and non-quantized reflection_pad1d_out_template"

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

[ghstack-poisoned]
dzdang added a commit that referenced this pull request Mar 25, 2022
…-quantized reflection_pad1d_out_template

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: 03cc045
Pull Request resolved: #74755
@dzdang
Copy link
Contributor Author

dzdang commented Mar 25, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dzdang dzdang requested review from jerry39213gh and jerryzh168 and removed request for jerry39213gh March 25, 2022 17:35
…zed and non-quantized reflection_pad1d_out_template"

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
@dzdang dzdang requested a review from bdhirsh as a code owner March 25, 2022 20:05
dzdang added a commit that referenced this pull request Mar 25, 2022
…-quantized reflection_pad1d_out_template

Summary: This PR is part of a series of PRs addressing #54150,
related to using dispatcher for calls to quantized backends as opposed to if/else conditionals.
This particular PR separates the quantized and non-quantized implementation for reflection_pad1d_out_template
and reflection_pad1d_out_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: 342ac73
Pull Request resolved: #74755
@bdhirsh bdhirsh removed their request for review March 25, 2022 20:06
@dzdang
Copy link
Contributor Author

dzdang commented Mar 25, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dzdang dzdang added release notes: quantization release notes category topic: improvements topic category labels Mar 28, 2022
Copy link
Contributor

@jerryzh168 jerryzh168 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, thanks!

Comment on lines 284 to 288
pad_l = padding[0];
pad_r = padding[1];
nplane = input_.size(dim_plane);
input_w = input_.size(dim_w);
output_w = input_w + pad_l + pad_r;
Copy link
Contributor

Choose a reason for hiding this comment

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

actually I don't feel it's a good practice to pass in reference and modify them in the function, can we just copy around this code or have a function that returns these things?

Copy link
Contributor

@jerryzh168 jerryzh168 Apr 1, 2022

Choose a reason for hiding this comment

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

does structured kernel help here as well? cc @ezyang

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea what this code is trying to do, but yes, structured kernels let you precompute quantities like this so they are passed in directly to the function.

@dzdang dzdang changed the title [quant][improvements] Separated implementations for quantized and non-quantized reflection_pad1d_out_template [quant][core][improvements] Removed reflection_pad1d_quantized_cpu and Apr 5, 2022
…ized_cpu and"

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template (this code already present in reflection_pad1d), as well as the implementation for
reflection_pad1d_quantized_cpu.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
@dzdang dzdang changed the title [quant][core][improvements] Removed reflection_pad1d_quantized_cpu and [quant][core][improvements] Removed reflection_pad1d_quantized_cpu, dimension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu Apr 5, 2022
…ized_cpu, dimension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu"

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
dzdang added a commit that referenced this pull request Apr 5, 2022
…imension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: 0fb6446
Pull Request resolved: #74755
@dzdang
Copy link
Contributor Author

dzdang commented Apr 5, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

…ized_cpu, dimension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu"

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
dzdang added a commit that referenced this pull request Apr 5, 2022
…imension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: 3ba98d0
Pull Request resolved: #74755
@dzdang
Copy link
Contributor Author

dzdang commented Apr 5, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

…ized_cpu, dimension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu"

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
…ized_cpu, dimension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu"

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

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

[ghstack-poisoned]
dzdang added a commit that referenced this pull request Apr 6, 2022
…imension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu

Summary: With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test plan:
```
python run_test.py
```

ghstack-source-id: e81672a
Pull Request resolved: #74755
@dzdang
Copy link
Contributor Author

dzdang commented Apr 6, 2022

@dzdang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Apr 7, 2022
…imension and output resizing code in reflection_pad1d_out_template and implemented reflection_pad1d_out_quantized_cpu (#74755)

Summary:
Pull Request resolved: #74755

With the introduction of structured kernel support for quantized tensors in
#74560, we are able to remove the dimension and output
resizing code in reflection_pad1d_out_template. This code is already present in reflection_pad1d.
reflection_pad1d_quantized_cpu has also been removed as quantized tensors can now use reflection_pad1d
after the changes in the linked PR.
reflection_pad1d_out_quantized_cpu was implemented for quantized tensors.

This PR should introduce no functional changes.

Test Plan:
```
python run_test.py
```

```
python run_test.py
```

Differential Revision:
D35148152
D35148152

Reviewed By: mruberry

Pulled By: dzdang

fbshipit-source-id: aa41e0704655f9b97ca6032159662ea86609a964
@facebook-github-bot facebook-github-bot deleted the gh/dzdang/63/head branch April 10, 2022 14:17
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