pytorch/test
Jerry Zhang 1b51d29b66 [quant][pt2e] Enable constant folding for quantize ops (#109343)
Summary:
This PR added constant folding for quantize ops so that instead of storing fp32 weight in the
quantized model, we'll get int8/int16 etc. weight

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_fold_quantize

also will verify in executorch later

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D49399210](https://our.internmc.facebook.com/intern/diff/D49399210)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/109343
Approved by: https://github.com/kimishpatel, https://github.com/jgong5
2023-09-27 06:04:45 +00:00
..
ao/sparsity add pruning method: Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration (#95689) 2023-08-02 16:24:42 +00:00
autograd Don't run test/autograd/test_fallback.py in parallel (#106866) 2023-08-10 00:26:23 +00:00
backends/xeon
benchmark_utils [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
bottleneck_test
cpp [aotinductor] Rename aot_runtime to aoti_runtime (#110007) 2023-09-26 00:46:54 +00:00
cpp_api_parity [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
cpp_extensions Fix CPUFallback Mechinasm on TensorList Type (#105209) 2023-08-05 15:38:30 +00:00
custom_backend [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
custom_operator [TORCH_LIBRARY] Add impl_abstract_pystub (#109529) 2023-09-22 04:55:36 +00:00
distributed [dtensor][7/n] remove reduction rule (#109144) 2023-09-26 22:24:50 +00:00
distributions [BE]: enable ruff rules PLR1722 and PLW3301 (#109461) 2023-09-18 02:07:21 +00:00
dynamo Add test for ShapeEnv recording fallback. (#109944) 2023-09-27 00:50:14 +00:00
edge [torchgen] Rename executorch's RuntimeContext to KernelRuntimeContext (#104892) 2023-07-14 21:15:50 +00:00
error_messages [BE] Enable ruff's UP rules and autoformat dynamo / functorch and refs (#105432) 2023-07-19 13:48:44 +00:00
expect [core IR] Add a core decomposition for aten.all (#110093) 2023-09-27 01:31:41 +00:00
export [export] Verifier for exported program (#109519) 2023-09-26 18:47:43 +00:00
forward_backward_compatibility Flash Attention v2 (#105602) 2023-09-13 13:59:05 +00:00
functorch Add masked_select abstract impl (#110103) 2023-09-27 04:07:58 +00:00
fx Back out "Revert D49107540: [pytorch][PR] split by tag" (#109332) 2023-09-16 05:29:16 +00:00
inductor [inductor] support _scaled_dot_product_flash_attention fallback (#110085) 2023-09-27 00:09:56 +00:00
jit Python 3.10 Union operator | support for JIT (#109293) 2023-09-25 15:35:54 +00:00
jit_hooks
lazy Use yaml.SafeLoader instead of legacy yaml.Loader (#100443) 2023-05-02 18:32:36 +00:00
mobile [BE] Enable ruff's UP rules in pyproject.toml (#105437) 2023-07-21 19:14:52 +00:00
nn Ensure fill_ works when value is a view of self (#109835) 2023-09-26 17:12:48 +00:00
onnx Revert "[ONNX] Remove the depreacated function _export (#109763)" 2023-09-25 17:47:21 +00:00
onnx_caffe2 Revert "[ONNX] Remove the depreacated function _export (#109763)" 2023-09-25 17:47:21 +00:00
optim Add capturable ASGD impl (#107857) 2023-09-07 06:30:30 +00:00
package [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
profiler [profiler] Show shapes for lists of tensors in chrome traces #109263 (#109751) 2023-09-26 01:03:54 +00:00
quantization [quant][pt2e] Enable constant folding for quantize ops (#109343) 2023-09-27 06:04:45 +00:00
scripts Fix flake8 lint errors reported by ruff - take 2 (#99798) 2023-04-23 23:09:51 +00:00
test_img
torch_np MAINT: pytorchify torch._numpy tests: core/ and fft/ (#109815) 2023-09-26 11:04:24 +00:00
typing Improve type annotations for jit.script (#108782) 2023-09-13 19:20:25 +00:00
_test_bazel.py [bazel] add build for functorch (#101475) 2023-05-18 20:29:08 +00:00
allowlist_for_publicAPI.json Add _foreach_sign (#106343) 2023-08-01 22:33:34 +00:00
conftest.py Do not collect and skip non-disabled tests when rerunning disabled tests (#102107) 2023-05-27 12:10:36 +00:00
create_dummy_torchscript_model.py
delete.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
minioptest_failures_dict.json Revert D49640259: Revert D49615962: [optests] Test names in failure dicts should be prefixed with test class (#110094) 2023-09-26 21:16:36 +00:00
mkl_verbose.py
mkldnn_verbose.py
run_doctests.sh
run_test.py [BE] Add sharding data by default to metrics (#110035) 2023-09-26 17:06:49 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py add pruning method: Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration (#95689) 2023-08-02 16:24:42 +00:00
test_autocast.py Allow float dtype when Autocast CPU Disabled (#107348) 2023-09-01 00:49:44 +00:00
test_autograd_fallback.py Don't run test/autograd/test_fallback.py in parallel (#106866) 2023-08-10 00:26:23 +00:00
test_autograd.py Setup_context does not contain default values of forward() (#108561) 2023-09-19 16:23:52 +00:00
test_binary_ufuncs.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_bundled_images.py
test_bundled_inputs.py
test_comparison_utils.py
test_compile_benchmark_util.py unify TEST_CUDA (#106685) 2023-08-10 09:01:36 +00:00
test_complex.py Don't fastpath conj copy when conj/neg bit mismatch (#108881) 2023-09-08 20:44:43 +00:00
test_content_store.py Add load_storage (#100519) 2023-05-05 05:25:03 +00:00
test_cpp_api_parity.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_cpp_extensions_aot.py add torch.device to python type (#108116) 2023-09-18 02:20:30 +00:00
test_cpp_extensions_jit.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_cpp_extensions_open_device_registration.py unify TEST_CUDA (#106685) 2023-08-10 09:01:36 +00:00
test_cuda_expandable_segments.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_cuda_multigpu.py Revert "Fix test failure in TestCudaMultiGPU.test_cuda_device_memory_allocated (#105501)" 2023-07-24 14:18:44 +00:00
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py [BE] Use TEST_MULTIGPU from common_cuda.py (#103982) 2023-06-22 00:07:44 +00:00
test_cuda_sanitizer.py unify TEST_CUDA (#106685) 2023-08-10 09:01:36 +00:00
test_cuda_trace.py unify TEST_CUDA (#106685) 2023-08-10 09:01:36 +00:00
test_cuda.py [CUDA][CUDA Graphs] Fix CUDAGraph::reset function (#108896) 2023-09-11 19:49:31 +00:00
test_custom_ops.py Revert D49640259: Revert D49615962: [optests] Test names in failure dicts should be prefixed with test class (#110094) 2023-09-26 21:16:36 +00:00
test_dataloader.py Update ruff to v0.0.286 (#108058) 2023-08-28 22:55:56 +00:00
test_datapipe.py Disable compile for massive data pipe test (#109063) 2023-09-12 00:15:52 +00:00
test_decomp.py [core IR] Add glu as a core decomposition (#110043) 2023-09-27 00:23:05 +00:00
test_deploy.py
test_determination.py
test_dispatch.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_dlpack.py Add DLPack bool support (#108486) 2023-09-08 17:55:33 +00:00
test_dynamic_shapes.py New export API with dynamic shape specifications instead of constraints (#108448) 2023-09-22 06:58:26 +00:00
test_expanded_weights.py tf32 context fixes for various tests (#103137) 2023-06-15 02:33:12 +00:00
test_fake_tensor.py Generate patterns in fp16 and fp32 (#109142) 2023-09-20 06:38:02 +00:00
test_flop_counter.py Flash Attention v2 (#105602) 2023-09-13 13:59:05 +00:00
test_foreach.py [foreach] Fix 0-size handling for real for real (#109402) 2023-09-26 17:38:20 +00:00
test_function_schema.py
test_functional_autograd_benchmark.py
test_functional_optim.py Cudagraphs support for compiled optimizers (#107504) 2023-08-31 20:47:18 +00:00
test_functionalization_of_rng_ops.py [philox_rand] Add decomps (#100206) 2023-04-28 02:20:13 +00:00
test_functionalization.py Make FunctionalTensor subclass to be more like functorch (interaction with ZeroTensor + Conjugate key) (#109023) 2023-09-22 07:09:04 +00:00
test_futures.py [Reland] Update mypy to 1.4.1 (#105227) 2023-07-15 20:30:20 +00:00
test_fx_experimental.py Run translation validation on tracing error. (#106645) 2023-08-14 13:43:34 +00:00
test_fx_passes.py Introduce aggressive merge to CapabilityPartitioner (#100195) 2023-05-05 23:20:17 +00:00
test_fx_reinplace_pass.py
test_fx.py Trace calls with Python Enum values. (#109507) 2023-09-20 22:18:11 +00:00
test_hub.py Default permissions for torch.hub downloads (#82869) 2023-08-24 15:48:24 +00:00
test_import_stats.py
test_indexing.py [Fix Bug] Cannot assign index like x[[1,2], :] = 2 when torch.use_deterministic_algorithms(True) to main (#105833) 2023-08-07 17:00:19 +00:00
test_itt.py
test_jit_autocast.py [BE] Enable C419 rule for any all shortcircuiting (#99890) 2023-04-25 15:02:13 +00:00
test_jit_disabled.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py [jit] Skip NNAPI, test_ivalue, CPU NNC tests in fbcode (#108937) 2023-09-11 22:42:30 +00:00
test_jit_fuser.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jit.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_jiterator.py [ROCm] add skipCUDAIfVersionLessThan to unskip test_jiterator for ROCm (#99197) 2023-04-17 16:05:16 +00:00
test_kernel_launch_checks.py
test_legacy_vmap.py [BE]: Apply ruff PERF fixes to torch (#104917) 2023-07-11 20:45:21 +00:00
test_license.py
test_linalg.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_logging.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_masked.py
test_maskedtensor.py Tighten FakeTensor reentrancy asserts, add debugging (#102091) 2023-05-24 05:37:51 +00:00
test_matmul_cuda.py Add better error messaging to scaled_mm (#108454) 2023-09-07 21:26:47 +00:00
test_meta.py Avoid passing generator to parametrize (#110104) 2023-09-27 02:52:48 +00:00
test_metal.py
test_mkl_verbose.py
test_mkldnn_fusion.py Add channels_last3d support for mkldnn conv and mkldnn deconv (#95271) 2023-08-30 02:53:30 +00:00
test_mkldnn_verbose.py
test_mkldnn.py add fp16 support for native conv and deconv on CPU (#99497) 2023-09-25 01:31:26 +00:00
test_mobile_optimizer.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_model_dump.py
test_model_exports_to_core_aten.py [aten decomp] Update sdpa decom (#108371) 2023-09-03 15:17:08 +00:00
test_module_init.py Reland "Add nn.CircularPad{*}d for consistency + fix no_batch_dim support (#106148)" (#106632) 2023-08-07 20:10:25 +00:00
test_modules.py Add backward check for test_memory_format (#106104) 2023-08-25 18:11:54 +00:00
test_monitor.py
test_mps.py [MPS] Fix nll_loss with default ignore_index (#109574) 2023-09-26 04:13:09 +00:00
test_multiprocessing_spawn.py
test_multiprocessing.py Revert "Revert "Expandable blocks in allocator (#96995)"" (#99275) 2023-04-17 23:46:08 +00:00
test_namedtensor.py [BE] f-stringify torch/ and scripts (#105538) 2023-07-21 19:35:24 +00:00
test_namedtuple_return_api.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_native_functions.py [Dynamo] Fix nested function resume execution (#100426) 2023-05-11 03:10:23 +00:00
test_native_mha.py
test_nestedtensor.py Add NestedTensor python subclass (#108314) 2023-09-11 18:29:20 +00:00
test_nn.py add Half support for BatchNorm on CPU (#102070) 2023-09-19 10:43:33 +00:00
test_nnapi.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_numba_integration.py
test_numpy_interop.py Implement numpy(force=True) (#109636) 2023-09-20 20:06:13 +00:00
test_openmp.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_ops_fwd_gradients.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_ops_gradients.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_ops_jit.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_ops.py [core IR] Add a core decomposition for floor_divide (#110046) 2023-09-26 08:39:21 +00:00
test_optim.py [optim][BE] split test file into logical parts: SWA, LR, optim (#101100) 2023-05-12 16:41:44 +00:00
test_out_dtype_op.py Allow registering decomps for HigherOrderOp; add decomp for out_dtype (#108080) 2023-08-31 03:15:38 +00:00
test_overrides.py Disabled UserWarnings for some public functions in torch.overrides (#109890) 2023-09-23 20:40:04 +00:00
test_package.py
test_per_overload_api.py
test_prims.py fix infinite loop with primtorch and .to(meta) (#109632) 2023-09-22 07:09:04 +00:00
test_proxy_tensor.py Add masked_select abstract impl (#110103) 2023-09-27 04:07:58 +00:00
test_pruning_op.py NumPy support in torch.compile (#106211) 2023-08-11 00:39:32 +00:00
test_public_bindings.py Rename torch._C._TensorBase to TensorBase (#109940) 2023-09-25 19:10:22 +00:00
test_python_dispatch.py Rename torch._C._TensorBase to TensorBase (#109940) 2023-09-25 19:10:22 +00:00
test_pytree.py Trace through pytree API with dynamo. (#108533) 2023-09-20 00:04:56 +00:00
test_quantization.py [quant][pt2e] Enable constant folding for quantize ops (#109343) 2023-09-27 06:04:45 +00:00
test_reductions.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_scatter_gather_ops.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_schema_check.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_segment_reductions.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_serialization.py When byteorder record is missing load as little endian by default (#108343) 2023-09-04 15:20:22 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py
test_show_pickle.py
test_sort_and_select.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_sparse_csr.py Move has_triton to top level triton utils so that dynamo can also access (#109832) 2023-09-22 19:33:41 +00:00
test_sparse_semi_structured.py Minor fixes in semi-structured sparse code (#105595) 2023-09-25 14:06:08 +00:00
test_sparse.py fall back to eager on NotImplementedError (#107863) 2023-09-07 21:22:20 +00:00
test_spectral_ops.py decomposition spectral ops fixes (#108360) 2023-09-09 04:48:09 +00:00
test_stateless.py Throw error if stateless.functional_call called with nn.DataParallel (#107403) 2023-08-18 03:02:04 +00:00
test_static_runtime.py
test_subclass.py Allow storage() to work on python tensor subclasses, but error on future data accesses (#107417) 2023-08-22 15:25:31 +00:00
test_sympy_utils.py Replace sympy.solve with a new simplified one. (#105877) 2023-08-02 17:53:29 +00:00
test_tensor_creation_ops.py Reland: Remove remaining global set_default_dtype calls from tests (#108088) 2023-09-07 03:04:34 +00:00
test_tensorboard.py Add tensorboard to pip requirements (#109349) 2023-09-15 10:39:48 +00:00
test_tensorexpr_pybind.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_tensorexpr.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_testing.py [Inductor CUTLASS backend] Step 1: Inductor config for cuda / cutlass, util functions. (#107802) 2023-09-12 17:44:32 +00:00
test_throughput_benchmark.py
test_torch.py Rename torch._C._TensorBase to TensorBase (#109940) 2023-09-25 19:10:22 +00:00
test_transformers.py Flash Attention v2 (#105602) 2023-09-13 13:59:05 +00:00
test_type_hints.py
test_type_info.py Add finfo properties for float8 dtypes (#109744) 2023-09-21 03:41:48 +00:00
test_type_promotion.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00
test_typing.py
test_unary_ufuncs.py [BE]: Update ruff to 0.285 (#107519) 2023-08-22 23:16:38 +00:00
test_utils.py Add fast traceback utilities (#107358) 2023-08-18 19:05:54 +00:00
test_view_ops.py Implement numpy(force=True) (#109636) 2023-09-20 20:06:13 +00:00
test_vulkan.py
test_weak.py removing some redundant str splits (#106089) 2023-09-01 00:22:58 +00:00
test_xnnpack_integration.py [BE] Enable ruff's UP rules and autoformat test/ (#105434) 2023-07-19 20:36:06 +00:00