pytorch/test
Zhengxu Chen 3ef2dfc1ba [export] Implement cpp deserializer. (#136398)
Differential Revision: D63206258

This diff introduces a mechanism to generate a json-compatible deserializer in cpp using nlohmann json (already being used by AOTI).

Why we need this? Because there will be a lot of cases where people don't want to use Python to load the graph (e.g. cpp runtime), and instead they can use this header to deserialize the JSON graph.

Every time we call update_schema.py to update the schema, the header will be auto generated and included into the source files.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136398
Approved by: https://github.com/angelayi
2024-11-14 16:34:59 +00:00
..
ao/sparsity remove skips due to https://github.com/pytorch/torchdynamo/issues/1991 (#138133) 2024-10-17 17:42:46 +00:00
autograd Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
backends/xeon
benchmark_utils c10::optional -> std::optional in PyTorch (#137333) 2024-10-11 00:16:10 +00:00
bottleneck_test Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
cpp [8/N] Don't skip ASAN on some tests (#140081) 2024-11-09 01:00:13 +00:00
cpp_api_parity Fix failures when default is flipped for weights_only (#127627) 2024-08-16 00:22:43 +00:00
cpp_extensions OpenReg: Fix issue when creating empty tensor (#140496) 2024-11-14 11:10:37 +00:00
custom_backend
custom_operator C10_UNUSED to [[maybe_unused]] (#6357) (#138364) 2024-10-19 13:17:43 +00:00
distributed dynamo: guard on FSDP module parameters (#138819) 2024-11-13 20:46:46 +00:00
distributions Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
dynamo Revert "[logging] Overhaul dynamo_timed and CompilationMetrics logging. (#139849)" 2024-11-13 18:47:51 +00:00
dynamo_expected_failures Revert "[dynamo] Fix constant propagation in builtins and UserClasses (#131354)" 2024-11-01 00:13:20 +00:00
dynamo_skips config: Add env_name_default and env_name_force to Config (#138956) 2024-11-06 21:20:42 +00:00
edge Set RUNPATH so installed tests can find the required shared libraries (#136627) 2024-10-25 09:38:08 +00:00
error_messages
expect Add ScalarList overload to _foreach_lerp (#134482) 2024-11-12 19:03:41 +00:00
export [export] Implement cpp deserializer. (#136398) 2024-11-14 16:34:59 +00:00
forward_backward_compatibility [BC] Add check for core ATen opset schema BC (#137664) 2024-10-18 01:58:33 +00:00
functorch Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
fx Revert "Refactor FxGraphDrawer to use HTML-like labels (#137726)" 2024-11-04 17:44:44 +00:00
higher_order_ops Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
inductor [Inductor UT] Fix duplicate registration of custom ops amount test cases (#140540) 2024-11-14 03:36:20 +00:00
jit remove skips due to https://github.com/pytorch/torchdynamo/issues/1991 (#138133) 2024-10-17 17:42:46 +00:00
jit_hooks [BE][Easy][13/19] enforce style for empty lines in import segments in test/j*/ (#129764) 2024-08-01 12:13:42 +00:00
lazy Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
mobile Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
nn Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
onnx Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
optim Allow SequentialLR to include ChainedScheduler (#133450) 2024-10-18 02:29:38 +00:00
package Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
profiler [profiler][UT] instantiate profiler UTs for devices and enable UTs for xpu profiler (#134316) 2024-11-05 05:46:13 +00:00
quantization [Quant][Onednn] add linear_dynamic_fp16 ops (#140376) 2024-11-14 05:19:18 +00:00
scripts [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
test_img
torch_np Update test_multiarray.py to support numpy 2.0+ (#138461) 2024-10-28 04:30:50 +00:00
typing [BE][Easy][7/19] enforce style for empty lines in import segments in test/[a-c]*/ and test/[q-z]*/ (#129758) 2024-07-31 10:54:03 +00:00
xpu Populate submodules of torch._C to sys.modules recursively (#132216) 2024-08-08 10:20:25 +00:00
_test_bazel.py
allowlist_for_publicAPI.json [BE][Easy] enable PYFMT for torch.fx (#138443) 2024-10-21 19:15:49 +00:00
conftest.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
create_dummy_torchscript_model.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
delete.py
hi.py
HowToWriteTestsUsingFileCheck.md [Docs] Update FileCheck doc (#135199) 2024-09-06 08:18:38 +00:00
linear.py
load_torchscript_model.py Flip default on weights_only (#137602) 2024-11-04 18:30:29 +00:00
minioptest_failures_dict.json
mkl_verbose.py
mkldnn_verbose.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
pytest_shard_custom.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
run_doctests.sh
run_test.py Remove most rockset references (#139922) 2024-11-12 21:17:43 +00:00
simulate_nccl_errors.py
slow_tests.json Update slow tests (#139051) 2024-11-04 11:49:06 +00:00
test_ao_sparsity.py
test_autocast.py [MPS] Update error message for supported autocast type (#139192) 2024-10-30 16:48:29 +00:00
test_autograd_fallback.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_autograd.py [Codemod] skipIfMps->skipIfMPS (#140562) 2024-11-13 19:45:08 +00:00
test_autoload.py
test_binary_ufuncs.py Fix test_binary_ufuncs.py for NumPy 2 (#137937) 2024-10-15 17:04:24 +00:00
test_bundled_images.py Fix lint errors in fbcode (#135614) 2024-09-13 02:04:34 +00:00
test_bundled_inputs.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_ci_sanity_check_fail.py
test_comparison_utils.py
test_compile_benchmark_util.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_complex.py
test_content_store.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py remove skips due to https://github.com/pytorch/torchdynamo/issues/1991 (#138133) 2024-10-17 17:42:46 +00:00
test_cpp_extensions_jit.py Avoid file encoding issues when loading cpp extensions (#138565) 2024-10-28 14:06:34 +00:00
test_cpp_extensions_mtia_backend.py Unify cpp_extension build directory removal (#136059) 2024-10-03 06:22:11 +00:00
test_cpp_extensions_open_device_registration.py Support dlpack for privateuse1 (#135331) 2024-11-13 13:13:14 +00:00
test_cpp_extensions_stream_and_event.py Unify cpp_extension build directory removal (#136059) 2024-10-03 06:22:11 +00:00
test_cuda_expandable_segments.py
test_cuda_multigpu.py Allow torch.cuda.memory.mem_get_info to take a device str argument with an unspecified device index. (#132616) 2024-08-06 13:19:46 +00:00
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py
test_cuda_sanitizer.py [BE]: Add better optional typing (#138426) 2024-10-27 14:19:00 +00:00
test_cuda_trace.py
test_cuda.py Refactors empty_cache to return only MemPool memory to the system (#133602) 2024-10-29 23:58:44 +00:00
test_custom_ops.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_dataloader.py [2/N] Don't skip ASAN on some tests (#138663) 2024-10-28 03:35:57 +00:00
test_datapipe.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_decomp.py [7/N] Don't skip ASAN on some tests (#139675) 2024-11-05 14:01:01 +00:00
test_deploy.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_determination.py
test_dispatch.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_dlpack.py Use DLPack for creating tensors out of custom classes, when available. (#138697) 2024-10-26 01:27:05 +00:00
test_dynamic_shapes.py [dynamo] add SymNode bitwise and/or (#138777) 2024-11-13 18:31:06 +00:00
test_expanded_weights.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_fake_tensor.py Fix split decomp returning self (#140065) 2024-11-13 01:58:02 +00:00
test_file_check.py Fix the output of FileCheck when not run and add unit tests (#135345) 2024-09-11 04:13:24 +00:00
test_flop_counter.py FlopCounterMode: Decompose ops for inference mode (#138508) 2024-11-09 03:13:53 +00:00
test_foreach.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_function_schema.py
test_functional_autograd_benchmark.py
test_functional_optim.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_functionalization_of_rng_ops.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_functionalization.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_futures.py
test_fx_experimental.py [dynamo] add SymNode bitwise and/or (#138777) 2024-11-13 18:31:06 +00:00
test_fx_passes.py [Partitioner] Reuse partition to check whether nodes exist (#135317) 2024-09-21 23:52:02 +00:00
test_fx_reinplace_pass.py Allow SymInt input for torch.fx reinplace pass (#133178) 2024-08-13 20:07:17 +00:00
test_fx.py Revert "Refactor FxGraphDrawer to use HTML-like labels (#137726)" 2024-11-04 17:44:44 +00:00
test_hub.py
test_import_stats.py
test_indexing.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_itt.py
test_jit_autocast.py Using device-agnostic autocast api (#136613) 2024-09-27 07:16:24 +00:00
test_jit_disabled.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_jit_fuser.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py [Dynamo] Replace torch._dynamo.optimize() with torch.compile() [2/N] (#140238) 2024-11-13 05:13:39 +00:00
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jit.py Add support for parsing torch.Generator in JIT (#140489) 2024-11-13 23:06:57 +00:00
test_jiterator.py
test_kernel_launch_checks.py
test_legacy_vmap.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_license.py
test_linalg.py Split int4wo weight packing (#139611) 2024-11-12 10:12:50 +00:00
test_logging.py
test_masked.py
test_maskedtensor.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_matmul_cuda.py [FP8][CUDA] Fix stale expected error message (#136581) 2024-09-26 20:57:38 +00:00
test_meta.py Fix triangular_solve meta function out parameter names. (#140186) 2024-11-12 19:04:34 +00:00
test_metal.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_mkl_verbose.py
test_mkldnn_fusion.py improve mkldnn_linear_pointwise_binary performance for contiguous tensor with non default contiguous strides (#132019) 2024-07-30 05:02:38 +00:00
test_mkldnn_verbose.py
test_mkldnn.py Add oneDNN support for Half LSTM on CPU (#132607) 2024-08-29 03:40:10 +00:00
test_mobile_optimizer.py [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
test_model_dump.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_model_exports_to_core_aten.py Replace capture_pre_autograd_graph with export_for_training in torch tests (#135623) 2024-09-11 19:23:08 +00:00
test_module_tracker.py Move module_tracker to logging for confused hierarchy (#134467) 2024-08-26 19:39:08 +00:00
test_modules.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_monitor.py [pytorch][counters] Pybind for WaitCounter (#132357) 2024-08-02 16:08:10 +00:00
test_mps.py Implement unfold_backward on MPS (#135411) 2024-11-13 23:04:15 +00:00
test_multiprocessing_spawn.py multiprocessing.spawn: allow a grace period when shutdown (#131278) 2024-10-07 12:37:34 +00:00
test_multiprocessing.py Support IPC for Expandable Segments (#130890) 2024-08-05 18:48:13 +00:00
test_namedtensor.py
test_namedtuple_return_api.py
test_native_functions.py
test_native_mha.py [ROCm] Update to AOTriton 0.7b (#134498) 2024-09-11 20:34:01 +00:00
test_nestedtensor.py Revert "Allow NJT by default for weights_only torch.load (#140304)" 2024-11-13 15:24:00 +00:00
test_nn.py [Codemod] skipIfMps->skipIfMPS (#140562) 2024-11-13 19:45:08 +00:00
test_nnapi.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_numba_integration.py
test_numpy_interop.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_openmp.py [1/N] Don't skip ASAN on some tests (#138571) 2024-10-23 02:38:45 +00:00
test_ops_fwd_gradients.py
test_ops_gradients.py
test_ops_jit.py
test_ops.py triangular_solve: fix meta function output argument dtype check. (#140286) 2024-11-14 15:25:14 +00:00
test_optim.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_out_dtype_op.py
test_overrides.py Introduce torch.sym_add, variadic add (#138660) 2024-10-23 17:42:41 +00:00
test_package.py
test_per_overload_api.py
test_prims.py properly register conjugate/neg fallthroughs to prim ops (#132699) 2024-08-06 17:57:04 +00:00
test_proxy_tensor.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_pruning_op.py
test_public_bindings.py Revert "[Dynamo] Disable torch function compilation during guard execution and in compiled bytecode (#137669)" 2024-10-15 23:22:58 +00:00
test_python_dispatch.py Fix wrapper subclass reentrant dispatch + TorchDispatchMode (#136566) 2024-09-26 14:06:51 +00:00
test_pytree.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_quantization.py
test_reductions.py Fix torch.histc not checking min > max on cuda for int8 tensors (#139372) 2024-11-05 08:42:38 +00:00
test_scatter_gather_ops.py
test_schema_check.py
test_segment_reductions.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_serialization.py Flip default on weights_only (#137602) 2024-11-04 18:30:29 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Add size param check of unfold (#139965) 2024-11-09 17:12:53 +00:00
test_show_pickle.py
test_sort_and_select.py Support torch.bool in torch.sort + CUDA (#139409) 2024-11-06 00:02:54 +00:00
test_sparse_csr.py Add out_dtype kw argument to optimize_bsr_dense_addmm (#136626) 2024-10-22 09:52:25 +00:00
test_sparse_semi_structured.py Revert "[sparse] add search for optimal alg_id to torch.compile (#137427)" 2024-10-24 17:27:06 +00:00
test_sparse.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_spectral_ops.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_stateless.py Allow optional positional arguments for torch.func.functional_call (#134643) 2024-09-12 15:22:06 +00:00
test_static_runtime.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_subclass.py Fix failures when default is flipped for weights_only (#127627) 2024-08-16 00:22:43 +00:00
test_sympy_utils.py [dynamo] add SymNode bitwise and/or (#138777) 2024-11-13 18:31:06 +00:00
test_tensor_creation_ops.py fix test_float_to_int_conversion_nonfinite for NumPy 2 (#138131) 2024-11-14 04:19:19 +00:00
test_tensorboard.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_tensorexpr_pybind.py [BE][Easy] enable ruff rule PIE790: unnecessary pass statement (#133200) 2024-08-15 15:50:19 +00:00
test_tensorexpr.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_testing.py More flexible test parametrization with @reparametrize (#138369) 2024-10-29 22:14:38 +00:00
test_throughput_benchmark.py
test_torch.py [Codemod] skipIfMps->skipIfMPS (#140562) 2024-11-13 19:45:08 +00:00
test_transformers.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_type_hints.py
test_type_info.py
test_type_promotion.py Add type checks for Tensor.add_ (#135864) 2024-09-19 03:09:36 +00:00
test_typing.py
test_unary_ufuncs.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_utils_config_module.py Add type annotations to Configs (#139833) 2024-11-07 03:49:09 +00:00
test_utils.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_view_ops.py Replace clone.detach with detach.clone (#140264) 2024-11-13 07:01:02 +00:00
test_vulkan.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_weak.py [BE] Format uncategorized Python files with ruff format (#132576) 2024-08-04 17:13:31 +00:00
test_xnnpack_integration.py Add None return type to init -- tests (#132352) 2024-08-01 15:44:51 +00:00
test_xpu.py [Inductor UT] Skip test_decompose_mem_bound_mm.py for XPU since we have not enabled decompose_mem_bound_mm for XPU. (#140517) 2024-11-14 03:36:20 +00:00