pytorch/test
Jane Xu 515e55e692 Set -DPy_LIMITED_API flag for py_limited_api=True extensions (#145764)
This could be BC breaking, because there was a period of time when we use py_limited_api=True but don't enforce the flag, and now that we will start enforcing the flag, people's custom extensions may fail to build.

This is strictly still better behavior, as it is sketchy to claim CPython agnosticism without the flag, but calling this out as potential people yelling at us. Ways to mitigate this risk + reasons this may not be too big a deal:
- People haven't known about py_limited_api for extensions much due to lack of docs from python so usage is low right now
- My current tutorial is in store to make new users of py_limited_api pass this flag, so it'd be a noop for them.

Test plan:
* Locally i'm confident as I tried rebuilding ao with this change and it reliably failed (cuz importing torch/extension.h is a nono)
* Unit test wise, the normal python_agnostic one I added should work

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145764
Approved by: https://github.com/ezyang, https://github.com/zou3519, https://github.com/albanD
2025-01-28 20:11:05 +00:00
..
ao/sparsity
autograd
backends/xeon
benchmark_utils PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
bottleneck_test
cpp [PGNCCL] Add an API to get the status/error code at the PG level (#144498) 2025-01-24 16:47:32 +00:00
cpp_api_parity
cpp_extensions Set -DPy_LIMITED_API flag for py_limited_api=True extensions (#145764) 2025-01-28 20:11:05 +00:00
custom_backend
custom_operator PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
distributed [SymmetricMemory] fix an issue where rendezvous is performed with wrong device context when torch.cuda.set_device() is not callled (#144886) 2025-01-28 01:43:37 +00:00
distributions use torch.special.xlogy to implement x_log_x (#144220) 2025-01-08 17:41:55 +00:00
dynamo [dynamo] Properly branch on an unspecialized NN module (#145786) 2025-01-28 19:45:17 +00:00
dynamo_expected_failures [dynamo] Properly model torch profiler context objects (#145537) 2025-01-28 00:03:36 +00:00
dynamo_skips Move Dynamo test to skip from expected_failures (#145390) 2025-01-22 19:06:39 +00:00
edge
error_messages
expect Revert "Add generator parameter to rand*_like functions (#136780)" 2025-01-24 19:00:21 +00:00
export [draft_export] fix dense-in-memory check for inferring fakes (#145653) 2025-01-28 02:52:14 +00:00
forward_backward_compatibility
functorch Remove FFT from stride incorrect ops (#145080) 2025-01-27 04:26:04 +00:00
fx [dynamo][builtin-skiplist-cleanup] Remove weakref (#145744) 2025-01-28 07:55:12 +00:00
higher_order_ops PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
inductor Maintain multiple configs (#145103) 2025-01-28 18:32:14 +00:00
inductor_expected_failures [BE] Remove test_ops from FIXME_inductor_dont_reset_dynamo (#145307) 2025-01-27 18:12:39 +00:00
inductor_skips [BE] Remove test_ops from FIXME_inductor_dont_reset_dynamo (#145307) 2025-01-27 18:12:39 +00:00
jit [BE][Ez]: FURB148 - remove useless enumerate calls (#145619) 2025-01-24 23:37:15 +00:00
jit_hooks
lazy
mobile PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
nn Revert "Align CPU behavior with CUDA for ConvTranspose when out_channels=0 (#142859)" 2025-01-26 17:49:05 +00:00
onnx PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
optim
package Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
profiler Save integral tensor data for ET (#144508) 2025-01-25 05:38:10 +00:00
quantization PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
scripts
test_img
torch_np [BE][Ez]: FURB148 - remove useless enumerate calls (#145619) 2025-01-24 23:37:15 +00:00
typing PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
xpu
_test_bazel.py
allowlist_for_publicAPI.json Improve typing in torch/types.py (#145237) 2025-01-28 05:29:12 +00:00
conftest.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
create_dummy_torchscript_model.py
delete.py
hi.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
minioptest_failures_dict.json
mkl_verbose.py
mkldnn_verbose.py
pytest_shard_custom.py
run_doctests.sh
run_test.py add pt2 callbacks for backward pass and prevent duplicate callbacks (#145732) 2025-01-28 03:50:02 +00:00
simulate_nccl_errors.py
slow_tests.json Update slow tests (#145206) 2025-01-27 11:40:39 +00:00
test_accelerator.py Generalize pin memory logic for accelerator when non blocking copy happened (#143783) 2025-01-23 03:43:05 +00:00
test_ao_sparsity.py
test_autocast.py
test_autograd.py Fix allow_mutation_on_saved_tensors for inplace foreach (#145520) 2025-01-25 00:58:03 +00:00
test_autograd_fallback.py
test_autoload.py
test_binary_ufuncs.py Fix lerp weight type promotion (#141117) 2025-01-24 01:18:20 +00:00
test_bundled_images.py
test_bundled_inputs.py
test_ci_sanity_check_fail.py
test_comparison_utils.py
test_compile_benchmark_util.py
test_complex.py
test_content_store.py
test_cpp_api_parity.py
test_cpp_extensions_aot.py
test_cpp_extensions_jit.py [CI][CUDA][Blackwell] sm_\d\d no longer matches sm_100. (#145641) 2025-01-24 23:20:22 +00:00
test_cpp_extensions_mtia_backend.py
test_cpp_extensions_open_device_registration.py Update pin memory related APIs to not pass 'device' argument (#131858) 2025-01-15 17:23:35 +00:00
test_cpp_extensions_stream_and_event.py
test_cuda.py [ROCm] fix test_cublas_workspace_explicit_allocation for gfx12 (#145227) 2025-01-28 16:19:27 +00:00
test_cuda_expandable_segments.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
test_cuda_multigpu.py
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py
test_cuda_sanitizer.py
test_cuda_trace.py
test_custom_ops.py [Custom Ops] Add a new API to allow users to register an autocast for the custom op (#145588) 2025-01-27 19:22:43 +00:00
test_dataloader.py Update pin memory related APIs to not pass 'device' argument (#131858) 2025-01-15 17:23:35 +00:00
test_datapipe.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_decomp.py
test_deploy.py
test_determination.py
test_dispatch.py
test_dlpack.py
test_dynamic_shapes.py Bail on checking internal overlap when dealing with unbacked symints (#145385) 2025-01-23 22:31:31 +00:00
test_expanded_weights.py
test_extension_utils.py Move privateuse1 test out of test_utils and make them serial (#145380) 2025-01-23 00:31:39 +00:00
test_fake_tensor.py Output of nonzero is transposed, fix fake tensor (#144695) 2025-01-26 01:07:22 +00:00
test_file_check.py
test_flop_counter.py Add flop formula for _scaled_mm (#144973) 2025-01-17 09:38:30 +00:00
test_foreach.py
test_function_schema.py
test_functional_autograd_benchmark.py
test_functional_optim.py
test_functionalization.py
test_functionalization_of_rng_ops.py
test_futures.py
test_fx.py Fix for failure in D68425364 (#145304) 2025-01-22 23:33:02 +00:00
test_fx_experimental.py Fix incorrect type comparison (#145449) 2025-01-26 04:40:26 +00:00
test_fx_passes.py
test_fx_reinplace_pass.py
test_hub.py
test_import_stats.py
test_indexing.py
test_itt.py
test_jit.py
test_jit_autocast.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_jit_disabled.py
test_jit_fuser.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py [BE][Ez]: FURB148 - remove useless enumerate calls (#145619) 2025-01-24 23:37:15 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py PEP585 update - test (#145176) 2025-01-22 04:48:28 +00:00
test_jiterator.py
test_kernel_launch_checks.py
test_legacy_vmap.py
test_license.py
test_linalg.py [ARM] Fix bf32 and tf32 precision for tensordot unit test (#141136) 2025-01-24 02:59:45 +00:00
test_logging.py
test_masked.py
test_maskedtensor.py
test_matmul_cuda.py Revert "[CUDA][cuBLAS] Add fp16 accumulate option to cuBLAS/cuBLASLt (#144441)" 2025-01-27 19:38:26 +00:00
test_meta.py [inductor] fix index.Tensor fallback (#144736) 2025-01-16 09:38:29 +00:00
test_metal.py
test_mkl_verbose.py
test_mkldnn.py
test_mkldnn_fusion.py
test_mkldnn_verbose.py
test_mobile_optimizer.py
test_model_exports_to_core_aten.py
test_module_tracker.py
test_modules.py Disable slow gradcheck for nn.Transformer ModuleInfo (#145531) 2025-01-25 00:58:03 +00:00
test_monitor.py
test_mps.py [MPS] cholesky implementation (#145701) 2025-01-27 01:53:03 +00:00
test_multiprocessing.py [dynamo] Re-enable test_fs family for dynamo (#145302) 2025-01-22 17:50:05 +00:00
test_multiprocessing_spawn.py
test_namedtensor.py
test_namedtuple_return_api.py
test_native_functions.py
test_native_mha.py
test_nestedtensor.py Support remaining *_like factory functions for NJT (#144889) 2025-01-27 21:33:51 +00:00
test_nn.py Fix boundary conditions for hardswish backward (#143899) 2025-01-16 20:26:27 +00:00
test_nnapi.py
test_numba_integration.py
test_numpy_interop.py
test_openmp.py
test_ops.py [BE][Ez]: FURB148 - remove useless enumerate calls (#145619) 2025-01-24 23:37:15 +00:00
test_ops_fwd_gradients.py
test_ops_gradients.py
test_ops_jit.py
test_optim.py Fix loading older state_dict into AdamW after refactor (#144972) 2025-01-16 19:50:31 +00:00
test_out_dtype_op.py
test_overrides.py Add support for torch function on dtype arguments (#145085) 2025-01-21 17:44:47 +00:00
test_package.py
test_per_overload_api.py
test_prims.py
test_proxy_tensor.py Remove FFT from stride incorrect ops (#145080) 2025-01-27 04:26:04 +00:00
test_pruning_op.py
test_public_bindings.py Remove public_allowlist from TestPublicBindings.test_correct_module_names and ensure private_allowlist-ed things are actually private (#145620) 2025-01-27 17:30:02 +00:00
test_python_dispatch.py Delete torch._library.register_functional_op (#145110) 2025-01-18 00:58:25 +00:00
test_pytree.py [TreeSpec] Support enum in defaultdict (#144235) 2025-01-07 00:10:46 +00:00
test_quantization.py
test_reductions.py
test_scatter_gather_ops.py
test_schema_check.py
test_segment_reductions.py
test_serialization.py Revert "Remove lexicographical sorting of storage keys in torch.save (#143879)" 2025-01-28 17:40:16 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py
test_show_pickle.py
test_sort_and_select.py [cpu/sorting] Throw an error when trying to sort complex numbers. (#144113) 2025-01-08 05:15:36 +00:00
test_sparse.py
test_sparse_csr.py Use random64 in Fischer-Yates algorithm for large N (#143682) 2025-01-07 03:48:56 +00:00
test_sparse_semi_structured.py
test_spectral_ops.py [BE][Ez]: FURB148 - remove useless enumerate calls (#145619) 2025-01-24 23:37:15 +00:00
test_stateless.py
test_static_runtime.py
test_subclass.py
test_sympy_utils.py
test_tensor_creation_ops.py Let tensor_a.new_tensor() be on tensor_a.device by default (#144958) 2025-01-24 22:12:31 +00:00
test_tensorboard.py
test_tensorexpr.py
test_tensorexpr_pybind.py
test_testing.py [BE] fix ruff rule E226: add missing whitespace around operator in f-strings (#144415) 2025-01-08 21:55:00 +00:00
test_throughput_benchmark.py Fix Throughputbenchmark issue (#144669) 2025-01-26 03:37:20 +00:00
test_torch.py [ROCm] Enable post-merge trunk workflow on MI300 runners; skip and fix MI300 related failed tests (#143673) 2025-01-09 05:18:57 +00:00
test_transformers.py [ATen][CUDA][Transformers] Add Blackwell support to SDPA (#145602) 2025-01-24 22:27:39 +00:00
test_type_hints.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
test_type_info.py
test_type_promotion.py
test_typing.py
test_unary_ufuncs.py
test_utils.py [utils] add try_import method for importing optional modules (#145528) 2025-01-25 00:14:07 +00:00
test_utils_config_module.py Add multi env variable support to configs (#145288) 2025-01-24 10:04:24 +00:00
test_utils_filelock.py
test_view_ops.py
test_vulkan.py
test_weak.py
test_xnnpack_integration.py
test_xpu.py Revert "Fix poision child process issue when call getAccelerator() (#144368)" 2025-01-10 23:36:43 +00:00