pytorch/test
Elias Ellison 211bac53ef [JIT] Add optimize_for_inference API (#58193)
Summary:
Freezing exists as a pass which partially evaluates your model and applies generic optimizations which should speed it up. Optimize for inference is a counterpart to these optimizations which runs build & server specific optimizations.  The interaction with existing `optimize_frozen_module` is not great, I guess we could just deprecate the API entirely? it was never officially released but just existed to document the `optimize_numerics` keyword.

Eventually, I would like to add a way of adding example inputs but I didnt add that here because they are not being used at all yet. I also have not yet included a way to blacklist individual optimizations, and would like to wait until we move this to Beta and have a little more clarity on how everything will fit together. I also think blacklisting will be an uncommon use case for the current optimizations.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/58193

Reviewed By: bertmaher, navahgar

Differential Revision: D28443714

Pulled By: eellison

fbshipit-source-id: b032355bb2585720a6d2f00c89d0d9a7ef60e649
2021-05-15 15:50:14 -07:00
..
backward_compatibility Revert D28379394: Update internal code for torch.linalg.solve 2021-05-13 19:49:41 -07:00
benchmark_utils Add lint for unqualified noqa (#56272) 2021-04-19 13:16:18 -07:00
bottleneck_test
cpp [JIT] Add optimize_for_inference API (#58193) 2021-05-15 15:50:14 -07:00
cpp_api_parity Remove tmp folder when run unit test (#57800) 2021-05-09 20:07:14 -07:00
cpp_extensions Fix UB in library.h (#57962) 2021-05-11 16:04:02 -07:00
custom_backend [PyTorch] Lite interpreter with a backend delegate (#54462) 2021-04-06 00:55:26 -07:00
custom_operator AutoDispatchBelowAutograd takes no arguments. (#56424) 2021-04-21 14:44:12 -07:00
distributed [tsm] add support for jetter to Role (base_image) for mast launches (#58252) 2021-05-14 17:39:18 -07:00
distributions Deprecate torch.cholesky (#57725) 2021-05-10 22:44:25 -07:00
error_messages
expect Enable backward/forward compatibility for TS runtime (#57498) 2021-05-07 15:41:45 -07:00
fx Maintain submodule references during subgraph rewriting (#55463) 2021-04-30 16:46:44 -07:00
jit [JIT] Add optimize_for_inference API (#58193) 2021-05-15 15:50:14 -07:00
jit_hooks Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
mobile [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
onnx Back out "[ONNX] Process const folding progressively when converts to ONNX (#54569)" 2021-05-14 13:45:49 -07:00
optim
package [torch.package/TorchScript] flag to gate allowance of TS serializaiton in torch.package (#57678) 2021-05-14 08:21:46 -07:00
quantization fx quant: refactor observer insertion 2021-05-15 09:51:33 -07:00
scripts Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
test_img
typing Deprecate QR (#57745) 2021-05-10 22:56:37 -07:00
HowToWriteTestsUsingFileCheck.md
linear.py
run_test.py Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
simulate_nccl_errors.py
test_ao_sparse.py [sparsity] Moving the sparsity python files to OSS (#56617) 2021-04-22 14:07:31 -07:00
test_autograd.py Revert "Revert D28387764: Codegen inplace forward AD formula from out of place one if needed" (#58231) 2021-05-13 13:18:16 -07:00
test_binary_ufuncs.py Port heaviside to structured kernel (#57933) 2021-05-13 10:48:11 -07:00
test_bundled_images.py [easy] Rename fb::jpeg_decode_to_NCHW to fb::image_decode_to_NCHW (#55857) 2021-04-15 13:44:13 -07:00
test_bundled_inputs.py Add lint for unqualified type: ignore (#56290) 2021-04-21 08:07:23 -07:00
test_complex.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py Fix ordered_dict.h for CUDA on Windows (#55275) 2021-04-07 23:43:35 -07:00
test_cpp_extensions_jit.py Add minidump collection via breakpad (#55647) 2021-04-16 13:05:01 -07:00
test_cuda.py [CUDA graphs] Sync after replay (#57556) 2021-05-11 09:38:47 -07:00
test_cuda_primary_ctx.py
test_dataloader.py [DataLoader] Add generate_state for NumPy seeding (#56797) 2021-04-27 08:14:02 -07:00
test_datapipe.py [DataLoader] Add context manager for runtime type validation (#55936) 2021-05-12 11:59:16 -07:00
test_determination.py
test_dispatch.py Add lint for unqualified noqa (#56272) 2021-04-19 13:16:18 -07:00
test_expecttest.py
test_foreach.py
test_function_schema.py Add stricter check for function schemas with varargs (#56509) 2021-04-20 20:04:38 -07:00
test_functional_autograd_benchmark.py
test_futures.py Add lint for unqualified type: ignore (#56290) 2021-04-21 08:07:23 -07:00
test_fx.py [FX][WIP] Proxyable classes (#56737) 2021-05-14 14:07:04 -07:00
test_fx_experimental.py [fx_glow]Add Support for importing quantized linear in FXIRImporter (#57483) 2021-05-14 18:48:31 -07:00
test_import_time.py Add a test to measure import torch time (#56041) 2021-04-15 00:53:30 -07:00
test_indexing.py Migrate thrust->cub for index put (#55693) 2021-04-27 12:27:09 -07:00
test_jit.py torch.jit.ignore as a context manager (#55172) 2021-05-14 01:53:50 -07:00
test_jit_cuda_fuser.py Gelu Backward, Contribution from Kevin Stephano (#58249) 2021-05-13 19:39:39 -07:00
test_jit_disabled.py
test_jit_fuser.py Enforce PEP263 for PyTorch python codebase (#55346) 2021-04-06 18:31:38 -07:00
test_jit_fuser_legacy.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
test_jit_fuser_te.py [nnc] Fix output restriding of size-1 dimensions (#58256) 2021-05-14 00:09:12 -07:00
test_jit_legacy.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
test_jit_profiling.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
test_jit_simple.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
test_jit_string.py
test_kernel_launch_checks.py T90561249: Enforce kernel launch checks (#58178) 2021-05-13 10:41:20 -07:00
test_license.py
test_linalg.py Revert D28379394: Update internal code for torch.linalg.solve 2021-05-13 19:49:41 -07:00
test_logging.py
test_metal.py Remove legacy constructor calls from pytorch codebase. (#54142) 2021-04-11 15:45:17 -07:00
test_mkldnn.py [BE] Improve has_bf16_support (#57408) 2021-05-03 09:11:04 -07:00
test_mobile_optimizer.py [RFC] Add method torch.jit._clone_module_with_class (#56152) 2021-05-13 22:31:05 -07:00
test_model_dump.py model_dump tool for model inspection (#56868) 2021-04-28 07:33:10 -07:00
test_module_init.py Support factory kwargs in torch.nn modules (#54508) 2021-04-22 16:16:53 -07:00
test_multiprocessing.py Fix mp serialization for integer nn.Parameter on CUDA (#56529) 2021-04-22 16:21:04 -07:00
test_multiprocessing_spawn.py
test_namedtensor.py
test_namedtuple_return_api.py Add torch.linalg.inv_ex without checking for errors by default (#58039) 2021-05-13 09:42:15 -07:00
test_native_functions.py
test_nn.py Revert D25399466: add channels last support for AvgPool2d on CPU 2021-05-14 12:45:29 -07:00
test_nnapi.py NNAPI: flex size support for upsample_nearest2d op (#57563) 2021-05-05 13:54:43 -07:00
test_numba_integration.py
test_numpy_interop.py Add lint for unqualified type: ignore (#56290) 2021-04-21 08:07:23 -07:00
test_op_aliases.py [OpInfo] Add opinfo for transpose and its aliases (#56122) 2021-04-25 21:58:16 -07:00
test_openmp.py
test_ops.py Revert D28412496: Revert "Revert D28387767: Add forward AD test for op info" 2021-05-14 08:26:03 -07:00
test_optim.py Remove legacy constructor calls from pytorch codebase. (#54142) 2021-04-11 15:45:17 -07:00
test_overrides.py Revert "Revert D28387764: Codegen inplace forward AD formula from out of place one if needed" (#58231) 2021-05-13 13:18:16 -07:00
test_package.py
test_profiler.py Update Kineto submodule (#58179) 2021-05-13 04:03:04 -07:00
test_pruning_op.py
test_public_bindings.py
test_pytree.py [FX] Adds PyTree support to FX through concrete_args (#55888) 2021-05-07 04:48:35 -07:00
test_quantization.py Add lint for unqualified noqa (#56272) 2021-04-19 13:16:18 -07:00
test_reductions.py std/var: Return real results for complex input (#58066) 2021-05-12 03:26:55 -07:00
test_segment_reductions.py [torch][segment_reduce] Add support for initial value (#56923) 2021-04-30 18:01:31 -07:00
test_serialization.py
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Fix tensor device in test_kthvalue_overlap (#56869) 2021-05-01 12:01:09 -07:00
test_show_pickle.py
test_sort_and_select.py Fix incorrect inplace sort in topk (#58314) (#58318) 2021-05-14 17:15:24 -07:00
test_sparse.py New: sparse complex: add linear algebra, addmm (#57129) 2021-05-07 05:37:48 -07:00
test_sparse_csr.py Modernize test-suite in sparse tensor CSR (#56392) 2021-04-27 15:22:17 -07:00
test_spectral_ops.py Remove distutils (#57040) 2021-04-29 12:10:11 -07:00
test_static_runtime.py [Static Runtime] Temporarily disable fusion tests (#55342) 2021-04-05 20:54:02 -07:00
test_tensor_creation_ops.py Fix legacy tensor constructor/new matching incorrect signature with d… (#58108) 2021-05-13 08:11:08 -07:00
test_tensorboard.py Add lint for unqualified noqa (#56272) 2021-04-19 13:16:18 -07:00
test_tensorexpr.py [TensorExpr] Re-enable skipped tests, they seem to be working now. (#58206) 2021-05-13 09:18:09 -07:00
test_tensorexpr_pybind.py Fix lint in test_tensorexpr_pybind (#57869) 2021-05-07 15:58:21 -07:00
test_testing.py Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
test_throughput_benchmark.py
test_torch.py cfloat and cdouble functions (#58137) 2021-05-13 21:13:37 -07:00
test_type_hints.py Add lint for unqualified type: ignore (#56290) 2021-04-21 08:07:23 -07:00
test_type_info.py
test_type_promotion.py New: Initial support for sparse complex tensors constructors for CPU/CUDA (#57125) 2021-05-07 05:36:41 -07:00
test_typing.py Port NumPy typing testing style to PyTorch (#54234) 2021-04-15 01:25:16 -07:00
test_unary_ufuncs.py Enable geometric ops, exp2, expm1, rsqrt & erfc for BFloat16 on CUDA (#57913) 2021-05-11 09:43:05 -07:00
test_utils.py Add lint for unqualified type: ignore (#56290) 2021-04-21 08:07:23 -07:00
test_view_ops.py Adding hsplit,vsplit and dsplit methods (#53536) 2021-04-26 09:39:09 -07:00
test_vmap.py
test_vulkan.py Remove legacy constructor calls from pytorch codebase. (#54142) 2021-04-11 15:45:17 -07:00
test_xnnpack_integration.py Remove legacy constructor calls from pytorch codebase. (#54142) 2021-04-11 15:45:17 -07:00