pytorch/test
Ramin Azarmehr bdd8f518d7 [MPS] Add Python Module Bindings for the MPS backend (#94417)
- This PR is a prerequisite for the upcoming Memory Leak Detection PR.
- Enable global manual seeding via `torch.manual_seed()` + test case
- Add `torch.mps.synchronize()` to wait for MPS stream to finish + test case
- Enable the following python interfaces for MPS:
  `torch.mps.[get_rng_state(), set_rng_state(), synchronize(), manual_seed(), seed()]`
- Added some test cases in test_mps.py
- Added `mps.rst` to document the `torch.mps` module.
- Fixed the failure with `test_public_bindings.py`

Description of new files added:
- `torch/csrc/mps/Module.cpp`: implements `torch._C` module functions for `torch.mps` and `torch.backends.mps`.
- `torch/mps/__init__.py`: implements Python bindings for `torch.mps` module.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94417
Approved by: https://github.com/albanD
2023-02-12 21:22:30 +00:00
..
ao/sparsity [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
autograd
backends/xeon [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
benchmark_utils
bottleneck_test
cpp [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
cpp_api_parity
cpp_extensions Revert "update aten op overload to not use from to avoid compile errors (#89797)" 2023-02-10 11:32:25 +00:00
custom_backend
custom_operator
distributed [FSDP][state_dict] Return tensors instead of FlatParameters to avoid pickling errors (#94637) 2023-02-12 16:04:17 +00:00
distributions [BE] Merge isinstance calls together (#94419) 2023-02-09 00:47:26 +00:00
dynamo [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
edge [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
error_messages
expect port sparse_mm.reduce to pytorch and optimize it on CPU (#83727) 2023-02-10 15:56:40 +00:00
forward_backward_compatibility Revert "update aten op overload to not use from to avoid compile errors (#89797)" 2023-02-10 11:32:25 +00:00
functorch [functorch] Add support on CUDA keys for control flow ops. (#94465) 2023-02-12 06:45:53 +00:00
fx [fx] Fix matching args (#94375) 2023-02-10 17:37:57 +00:00
inductor [inductor] Persistent reductions (#92267) 2023-02-12 17:39:25 +00:00
jit [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
jit_hooks
lazy [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
mobile [BE] Enable more flake8-comprehensions checks (#94601) 2023-02-10 23:40:29 +00:00
nn enable bf16 emb (#94163) 2023-02-12 00:05:09 +00:00
onnx [ONNX] Use onnxruntime to run fx tests (#94638) 2023-02-11 15:32:03 +00:00
onnx_caffe2 [BE] Merge isinstance calls together (#94419) 2023-02-09 00:47:26 +00:00
package [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
profiler [Profiler] Defer recording startup python events (take 2) (#91684) 2023-02-11 18:44:00 +00:00
quantization [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
scripts
test_img
typing
allowlist_for_publicAPI.json temp fix for segment reduce undocumented FC window (#94242) 2023-02-07 18:27:01 +00:00
conftest.py
create_dummy_torchscript_model.py
delete.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
mkl_verbose.py
mkldnn_verbose.py
run_doctests.sh Enable xdoctest runner in CI for real this time (#83816) 2022-12-29 05:32:42 +00:00
run_test.py Run test_serialization serially (for 2xlarge runners) (#94613) 2023-02-11 00:15:10 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py [pruning][core][feature] Add in SaliencyPruner to pruner._experimental (#91814) 2023-01-10 04:04:55 +00:00
test_autocast.py
test_autograd.py add torch.autograd._unsafe_set_version_counter API (#92924) 2023-02-11 21:07:08 +00:00
test_binary_ufuncs.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_bundled_images.py
test_bundled_inputs.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_comparison_utils.py
test_complex.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_cpp_extensions_jit.py Fix test_jit_cuda_archflags on Windows (#93332) 2023-02-02 02:49:27 +00:00
test_cpp_extensions_open_device_registration.py
test_cuda.py Added requested_bytes to CUDA Caching Allocator Stats (#88575) 2023-02-09 21:37:25 +00:00
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py
test_cuda_sanitizer.py
test_cuda_trace.py
test_dataloader.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_datapipe.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_decomp.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_deploy.py
test_determination.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_dispatch.py
test_dlpack.py
test_dynamic_shapes.py Prevent sym_int from showing up in FX graph (#94595) 2023-02-11 01:43:05 +00:00
test_expanded_weights.py [decompositions] GRU decompositon with and without packed sequence (#91466) 2023-02-08 14:16:30 +00:00
test_fake_tensor.py Allow FakeTensorProp to run on graphs traced with some None inputs (#94569) 2023-02-10 20:38:22 +00:00
test_foreach.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_function_schema.py [frontend] Expose real_type getter for torch.Argument (#91938) 2023-01-12 01:26:50 +00:00
test_functional_autograd_benchmark.py
test_functional_optim.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_functionalization.py functionalization: fix x.is_contiguous(channels_last) (#94195) 2023-02-11 21:07:08 +00:00
test_futures.py
test_fx.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_fx_experimental.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_fx_passes.py
test_fx_reinplace_pass.py *_scatter ops should preserve input stride/storage_offset (#91029) 2022-12-22 19:41:53 +00:00
test_hub.py
test_import_stats.py
test_indexing.py
test_itt.py
test_jit.py [BE] Modernize PyTorch even more for 3.8 with pyupgrade (#94520) 2023-02-10 18:02:50 +00:00
test_jit_autocast.py
test_jit_cuda_fuser.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_jit_disabled.py
test_jit_fuser.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_jit_fuser_legacy.py [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
test_jit_fuser_te.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_jit_legacy.py [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
test_jit_llga_fuser.py
test_jit_profiling.py [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
test_jit_simple.py [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
test_jit_string.py
test_jiterator.py
test_kernel_launch_checks.py
test_legacy_vmap.py Remove deprecated torch.symeig (#70988) 2023-01-31 11:59:11 +00:00
test_license.py
test_linalg.py [BE] Add empty tensor check to _compute_linear_combination (#94245) 2023-02-07 11:31:11 +00:00
test_logging.py
test_masked.py Support per-parameter test decoration (#91658) 2023-01-04 21:08:32 +00:00
test_maskedtensor.py
test_matmul_cuda.py [CUDA] Drop CUDA < 11.0 test flags (#92605) 2023-01-24 04:34:06 +00:00
test_meta.py enable bf16 emb (#94163) 2023-02-12 00:05:09 +00:00
test_metal.py
test_mkl_verbose.py
test_mkldnn.py Optimize ConvTransposed2D with mkldnn float32 and bfloat16 on CPU (#92530) 2023-02-06 10:11:25 +00:00
test_mkldnn_fusion.py [Re-open 90266] [inductor] weight prepack for _convolution_transpose_pointwise (#91955) 2023-01-31 13:28:57 +00:00
test_mkldnn_verbose.py
test_mobile_optimizer.py [Reland] Clean Up MobileOptimizerType Rewrite Flags Public API and Documentation (#92081) 2023-01-14 17:06:00 +00:00
test_model_dump.py [BE] Modernize PyTorch even more for 3.8 with pyupgrade (#94520) 2023-02-10 18:02:50 +00:00
test_module_init.py AO migration: replace torch internal callsites (#94170) 2023-02-07 02:32:23 +00:00
test_modules.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_monitor.py
test_mps.py [MPS] Add Python Module Bindings for the MPS backend (#94417) 2023-02-12 21:22:30 +00:00
test_multiprocessing.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_multiprocessing_spawn.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_namedtensor.py
test_namedtuple_return_api.py [BE] Enable more flake8-comprehensions checks (#94601) 2023-02-10 23:40:29 +00:00
test_native_functions.py
test_native_mha.py
test_nestedtensor.py Fix bug in unsqueeze_nested stride calculation (#88688) 2023-02-10 17:00:04 +00:00
test_nn.py fix: check if double to i64 is in well-formed range (#94290) 2023-02-10 22:35:22 +00:00
test_nnapi.py
test_numba_integration.py
test_numpy_interop.py
test_nvfuser_dynamo.py Refactor dynamo training backends (#93409) 2023-02-03 03:07:15 +00:00
test_nvfuser_frontend.py [NVFUSER] refactor nvfuser build (#89621) 2023-01-26 02:50:44 +00:00
test_openmp.py
test_ops.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_ops_fwd_gradients.py
test_ops_gradients.py
test_ops_jit.py
test_optim.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_overrides.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_package.py
test_per_overload_api.py
test_prims.py [NVFUSER] refactor nvfuser build (#89621) 2023-01-26 02:50:44 +00:00
test_proxy_tensor.py [BE] Enable more flake8-comprehensions checks (#94601) 2023-02-10 23:40:29 +00:00
test_pruning_op.py
test_public_bindings.py [jit] Support Awaitable type (#90863) 2023-01-30 17:38:59 +00:00
test_python_dispatch.py [BE]: Apply pyupgrade yield from and unit test alias upgrades (#94309) 2023-02-07 20:08:58 +00:00
test_pytree.py
test_quantization.py [quant][pt2e] Add a test to confirm we can set qconfig according to module_name (#91977) 2023-01-12 21:59:02 +00:00
test_reductions.py [BE] Apply almost all remaining flake8-comprehension checks (#94676) 2023-02-12 01:01:25 +00:00
test_scatter_gather_ops.py optimize gather performance for gnn usage on CPU (#87586) 2023-01-12 00:43:43 +00:00
test_schema_check.py
test_segment_reductions.py Make segment_reduce properly private. (#93166) 2023-02-06 18:32:23 +00:00
test_serialization.py Run test_serialization serially (for 2xlarge runners) (#94613) 2023-02-11 00:15:10 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Added vectorized horizontal flip path for channels last for NcHW (#91806) 2023-01-23 20:15:30 +00:00
test_show_pickle.py
test_sort_and_select.py fix sort crash when the input is expanded scalar (#91752) 2023-01-09 02:02:56 +00:00
test_sparse.py [BE] Enable more flake8-comprehensions checks (#94601) 2023-02-10 23:40:29 +00:00
test_sparse_csr.py port sparse_mm.reduce to pytorch and optimize it on CPU (#83727) 2023-02-10 15:56:40 +00:00
test_spectral_ops.py
test_stateless.py [functorch][nn] Refactor NN stateless APIs by swapping module tensors (#92536) 2023-02-08 17:31:38 +00:00
test_static_runtime.py
test_subclass.py
test_tensor_creation_ops.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_tensorboard.py
test_tensorexpr.py
test_tensorexpr_pybind.py
test_testing.py [ONNX] Skip import test for experimental files (#94552) 2023-02-10 15:58:49 +00:00
test_throughput_benchmark.py
test_torch.py [BE] Modernize PyTorch even more for 3.8 with pyupgrade (#94520) 2023-02-10 18:02:50 +00:00
test_transformers.py [SDPA] Adds basic correctness checks (#94274) 2023-02-09 08:05:26 +00:00
test_type_hints.py
test_type_info.py
test_type_promotion.py
test_typing.py
test_unary_ufuncs.py
test_utils.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_view_ops.py Deprecate .mT,.T,.mH,.H on 0D tensors (#92143) 2023-01-17 16:54:35 +00:00
test_vulkan.py
test_weak.py [BE]: pyupgrade Python to 3.8 - imports and object inheritance only (#94308) 2023-02-07 21:10:56 +00:00
test_xnnpack_integration.py