pytorch/torch
Jerry Zhang ace645a017 Add support for prototype affine quantization in pt2e flow (#141421)
Summary:
duplicated affine quantization functionality including
observer (https://github.com/pytorch/ao/blob/main/torchao/quantization/observer.py)
and some quant_primitive ops (7c3c51fd0d/torchao/quantization/quant_primitives.py (L26-L30))
to allow for per group quantization min max observer in pt2e flow

Next: We can follow up to add moving average min max observer

Test Plan:
python test/test_quantization.py -k test_channel_group_quantization

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/141421
Approved by: https://github.com/cccclai
2024-12-24 04:22:18 +00:00
..
_awaits
_C dynamo tracing perf: no re in arg_ref: 33.9 -> 33.7 (#143069) 2024-12-23 05:32:09 +00:00
_C_flatbuffer
_custom_op
_decomp [Inductor][CPU] disable bernoulli_p decomposition (#143460) 2024-12-19 11:21:35 +00:00
_dispatch Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_dynamo [dynamo] Remove dead code after introducing UserDefinedDictVariable (#143699) 2024-12-24 02:00:18 +00:00
_export graph module retracing without preserving MCS (#143676) 2024-12-21 07:57:43 +00:00
_functorch [1/n] Support Dynamic Memory Budget in Auto AC (#143539) 2024-12-21 07:38:52 +00:00
_higher_order_ops [user triton] Raise an exception when encountering nested @triton.autotune decorators or @triton.heuristics (#143519) 2024-12-20 06:38:45 +00:00
_inductor [inductor] Fix for extract_target with dots (#143766) 2024-12-24 03:42:15 +00:00
_lazy remove allow-untyped-defs from torch/_lazy/config.py (#143603) 2024-12-20 05:34:19 +00:00
_library Revert "[export] don't decompose custom triton op when exporting (#142426)" 2024-12-19 21:21:38 +00:00
_logging [ca] add compiled autograd to CompileId (#141907) 2024-12-21 00:41:24 +00:00
_numpy Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_prims Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_prims_common Pass allow_rhs_unbacked to the stride test in metadata test too (#143040) 2024-12-19 09:37:50 +00:00
_refs Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_strobelight Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_subclasses Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_vendor
accelerator torch/accelerator: fix device type comparison (#143541) 2024-12-23 10:54:53 +00:00
amp
ao Add support for prototype affine quantization in pt2e flow (#141421) 2024-12-24 04:22:18 +00:00
autograd Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
backends [ARM][feat]: Add 4 bit dynamic quantization matmuls & KleidiAI Backend (#134124) 2024-12-20 19:32:03 +00:00
compiler [export] add is_exporting flag (#142425) 2024-12-18 21:36:28 +00:00
contrib [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
cpu
csrc [16/N] Fix extra warnings brought by clang-tidy-17 (#143714) 2024-12-24 03:29:38 +00:00
cuda [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
distributed Enable ruff's unused variable checking everywhere in pytorch (#136965) 2024-12-22 02:33:11 +00:00
distributions
export Enable ruff's unused variable checking everywhere in pytorch (#136965) 2024-12-22 02:33:11 +00:00
fft [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
func [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
futures [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
fx Enable ruff's unused variable checking everywhere in pytorch (#136965) 2024-12-22 02:33:11 +00:00
jit Add warning to torch.jit.load (#143403) 2024-12-18 00:17:41 +00:00
legacy
lib
linalg [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
masked remove allow-untyped-defs for torch/masked/maskedtensor/creation.py (#143321) 2024-12-17 16:44:50 +00:00
monitor [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
mps
mtia Revert "[MTIA] (3/n) Implement PyTorch APIs to query/reset device peak memory usage (#143347)" 2024-12-21 04:04:16 +00:00
multiprocessing
nested [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
nn Rewrite _reparametrize_module to use contextmanager (#138203) 2024-12-20 12:02:27 +00:00
onnx [Codemod][AddExplicitStrictExportArg] caffe2/torch/onnx/_internal/exporter (#143542) 2024-12-20 00:54:52 +00:00
optim Refactor AdamW into Adam (heavily inspired by tfsingh) (#143710) 2024-12-23 23:27:28 +00:00
package [BE]: Properly forward raise pickle exception with from (#143761) 2024-12-23 20:21:30 +00:00
profiler Revert "[pytorch/et] Allow ET to save additional resources for completing a trace like generated kernels and index tensor data (#143430)" 2024-12-21 07:26:34 +00:00
quantization
signal [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
sparse
special [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
testing Add support for prototype affine quantization in pt2e flow (#141421) 2024-12-24 04:22:18 +00:00
utils Revert "[reland][AMD] Turn on TF32 for aten::mm (#143549)" 2024-12-23 06:47:36 +00:00
xpu [BE][Easy] enable PYFMT for torch/[a-s]*/ (#138447) 2024-12-23 14:04:00 +00:00
__config__.py remove allow-untyped-defs for torch/__config__.py (#143320) 2024-12-17 00:16:09 +00:00
__future__.py
__init__.py Rename cache limit to recompile limit in configs (#143709) 2024-12-22 10:03:57 +00:00
_appdirs.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_classes.py
_compile.py
_custom_ops.py
_deploy.py
_environment.py
_guards.py [ca] add compiled autograd to CompileId (#141907) 2024-12-21 00:41:24 +00:00
_jit_internal.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_linalg_utils.py
_lobpcg.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_lowrank.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_meta_registrations.py [ARM][feat]: Add 4 bit dynamic quantization matmuls & KleidiAI Backend (#134124) 2024-12-20 19:32:03 +00:00
_namedtensor_internals.py
_ops.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_python_dispatcher.py
_size_docs.py
_sources.py
_storage_docs.py
_streambase.py
_tensor.py __cuda_array_interface__: Use "<V2" for bfloat16. (#143042) 2024-12-14 06:27:52 +00:00
_tensor_docs.py
_tensor_str.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
_thread_safe_fork.py
_torch_docs.py [Easy] Add torch.range, torch.arange params optional description (#143731) 2024-12-24 01:29:24 +00:00
_utils.py Reraise worker errors as runtime errors in more cases when the original exception can't be constructed (#140911) 2024-12-14 03:11:36 +00:00
_utils_internal.py [reland] Kill capture_pre_autograd_graph API (#143426) 2024-12-18 12:07:09 +00:00
_VF.py
_vmap_internals.py
_weights_only_unpickler.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
abi-check.cpp
CMakeLists.txt Revert "export AOTI_TORCH_EXPORT on Windows. (#140030)" 2024-12-21 08:06:19 +00:00
custom_class.h
custom_class_detail.h
extension.h
functional.py
hub.py
library.h
library.py make it clearer (in docs) one can double decorate with torch.library.impl_* APIs (#137608) 2024-12-17 15:13:58 +00:00
overrides.py
py.typed
quasirandom.py
random.py
README.txt
return_types.py
script.h
serialization.py Add config.save.use_pinned_memory_for_d2h to serialization config (#143342) 2024-12-20 21:01:18 +00:00
storage.py
torch_version.py
types.py
version.py.tpl

Note [TH abstraction violation]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TH/THC provide some hpp headers, which are proper C++ headers rather than
C headers.  These headers serve double duty as *internal implementation
detail* headers, whose contents should largely not be used by external
clients.

Ideally, we would not install these headers at all; instead, you should
use public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
to manipulate these structs.  However, there are a few places
in torch/csrc where we violate this abstraction.  They are marked with
a pointer to this note.  Each of those sites will have to be refactored
when we refactor the guts of THTensor and related structures.