Skip to content

[Quantization]Quant and Dequant is changing memory layout #33643

@lly-zero-one

Description

@lly-zero-one

🐛 Bug

THe quantize and dequantize currently call into contiguous, which may lead to underlying NHWC=>NCHW change.

To Reproduce

qtensor = qtensor.contiguous();

Steps to reproduce the behavior:

  1. construct a residual add path, one is from qconv and another is directly from quantize input.

Expected behavior

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version (e.g., 1.0):
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

cc @jerryzh168 @jianyuh @dzhulgakov @raghuramank100 @jamesr66a @vkuzo

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions