pytorch/test
Edward Z. Yang ffb3f32693 Add max kwarg to torch._check with alternate size oblivious semantics (#144471)
Fixes https://github.com/pytorch/pytorch/issues/120288 for the static bound case

I had been tying myself in knots in the original issue about the fact that we can't really do symbolic bounds like u0 < s0. But then I realized, "Wait, but the static bounds are easy!" So this makes it so you can also exclude a specific upper bound when doing size oblivious tests, which is enough to solve https://github.com/pytorch/pytorch/issues/123592#issuecomment-2574556708

It's written very dirtily, maybe there's some cleanup. Bikeshed on the public API name also welcome.

Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144471
Approved by: https://github.com/avikchaudhuri
2025-01-14 15:10:57 +00:00
..
ao/sparsity [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
autograd Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
backends/xeon
benchmark_utils Eliminate c10::optional usage in PyTorch (#144346) 2025-01-08 01:14:04 +00:00
bottleneck_test Fix unused Python variables in test/[a-d]* (#134665) 2024-12-13 22:13:12 +00:00
cpp Revert "Fix poision child process issue when call getAccelerator() (#144368)" 2025-01-10 23:36:43 +00:00
cpp_api_parity
cpp_extensions Make Context to be Device-agnostic Step by Step (3/N) (#137578) 2024-12-18 15:12:19 +00:00
custom_backend
custom_operator [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
distributed Tests Generelization for multiple accelerator devices (#139749) 2025-01-14 08:52:46 +00:00
distributions use torch.special.xlogy to implement x_log_x (#144220) 2025-01-08 17:41:55 +00:00
dynamo [dynamo][dicts] Consolidate dict(..) construction (#144342) 2025-01-13 22:24:56 +00:00
dynamo_expected_failures [dynamo] Support user defined dicts (#143548) 2024-12-21 01:46:14 +00:00
dynamo_skips
edge
error_messages
expect [ARM][feat]: Add 4 bit dynamic quantization matmuls & KleidiAI Backend (#134124) 2024-12-20 19:32:03 +00:00
export Add max kwarg to torch._check with alternate size oblivious semantics (#144471) 2025-01-14 15:10:57 +00:00
forward_backward_compatibility [aotd] capture rrelu_with_noise noise mutation in compile (#141867) 2024-12-04 12:18:58 +00:00
functorch [dynamo][dicts] Consolidate dict(..) construction (#144342) 2025-01-13 22:24:56 +00:00
fx [Inductor] [bc-breaking] Node Level provenance tracking (#144277) 2025-01-09 22:06:51 +00:00
higher_order_ops [inductor][invoke_subgraph] Support None/int as input/output of invoke_subgraph (#139373) 2024-12-27 06:46:09 +00:00
inductor [Quant][Inductor][X86] Separate binary post op fusion and lowering for qlinear (#144224) 2025-01-14 06:46:38 +00:00
jit Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
jit_hooks
lazy [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
mobile Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
nn [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
onnx [onnx] Fix bug for exporting torch.cdist into onnx and support 'compute_mode' (#144213) 2025-01-09 20:07:20 +00:00
optim Adding support for differentiable lr, weight_decay, and betas in Adam/AdamW (#143726) 2024-12-30 01:11:57 +00:00
package Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
profiler [Profiler] Hide Kineto Step Tracker Behind Env Var (#144494) 2025-01-10 07:00:56 +00:00
quantization Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
scripts
test_img
torch_np Use random64 in Fischer-Yates algorithm for large N (#143682) 2025-01-07 03:48:56 +00:00
typing added __add__ and __mul__ hints to torch.Size (#144322) 2025-01-08 01:02:11 +00:00
xpu Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
_test_bazel.py
allowlist_for_publicAPI.json Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
conftest.py
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 S390x ci periodic tests (#125401) 2025-01-10 18:21:07 +00:00
simulate_nccl_errors.py
slow_tests.json Update slow tests (#144670) 2025-01-13 12:06:22 +00:00
test_accelerator.py Support with statement on torch.Stream (#140138) 2025-01-10 02:05:19 +00:00
test_ao_sparsity.py
test_autocast.py
test_autograd.py S390x ci periodic tests (#125401) 2025-01-10 18:21:07 +00:00
test_autograd_fallback.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_autoload.py
test_binary_ufuncs.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_bundled_images.py
test_bundled_inputs.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_ci_sanity_check_fail.py
test_comparison_utils.py
test_compile_benchmark_util.py
test_complex.py
test_content_store.py Rename cache limit to recompile limit in configs (#143709) 2024-12-22 10:03:57 +00:00
test_cpp_api_parity.py No actual change, just remove variable contain Tensors from global scope (#143225) 2024-12-17 16:14:25 +00:00
test_cpp_extensions_aot.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cpp_extensions_jit.py
test_cpp_extensions_mtia_backend.py
test_cpp_extensions_open_device_registration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_cpp_extensions_stream_and_event.py
test_cuda.py Revert "[CUDA][cuBLAS] Add fp16 accumulate option to cuBLAS/cuBLASLt (#144441)" 2025-01-14 00:48:28 +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 Add get_stream_from_external API for CUDA backend (#143799) 2024-12-31 11:15:59 +00:00
test_cuda_nvml_based_avail.py
test_cuda_primary_ctx.py
test_cuda_sanitizer.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_cuda_trace.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_custom_ops.py Pass allow_rhs_unbacked to the stride test in metadata test too (#143040) 2024-12-19 09:37:50 +00:00
test_dataloader.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_datapipe.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_decomp.py [Inductor][CPU] disable bernoulli_p decomposition (#143460) 2024-12-19 11:21:35 +00:00
test_deploy.py
test_determination.py
test_dispatch.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_dlpack.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_dynamic_shapes.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_expanded_weights.py No actual change, just remove variable contain Tensors from global scope (#143225) 2024-12-17 16:14:25 +00:00
test_fake_tensor.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_file_check.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_flop_counter.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_foreach.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_function_schema.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_functional_autograd_benchmark.py
test_functional_optim.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_functionalization.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_functionalization_of_rng_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_futures.py
test_fx.py [inductor] Add unbacked symints binding in ShapeProp (#144605) 2025-01-13 21:30:20 +00:00
test_fx_experimental.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_fx_passes.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_fx_reinplace_pass.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_hub.py
test_import_stats.py
test_indexing.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_itt.py
test_jit.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_autocast.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_disabled.py
test_jit_fuser.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_fuser_legacy.py
test_jit_fuser_te.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jiterator.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_kernel_launch_checks.py
test_legacy_vmap.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_license.py
test_linalg.py [CUDA] Bump tolerances in test_svd_lowrank_cuda_float64 (#143049) 2024-12-20 23:25:21 +00:00
test_logging.py
test_masked.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_maskedtensor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_matmul_cuda.py Revert "[CUDA][cuBLAS] Add fp16 accumulate option to cuBLAS/cuBLASLt (#144441)" 2025-01-14 00:48:28 +00:00
test_meta.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_metal.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_mkl_verbose.py
test_mkldnn.py [BE][CI] bump ruff to 0.8.4 (#143753) 2024-12-24 12:24:10 +00:00
test_mkldnn_fusion.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_mkldnn_verbose.py
test_mobile_optimizer.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_model_exports_to_core_aten.py
test_module_tracker.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_modules.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_monitor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_mps.py [MPS][BE] Surface syntax errors shader compilation (#144648) 2025-01-13 02:03:19 +00:00
test_multiprocessing.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_multiprocessing_spawn.py [BE][CI] bump ruff to 0.8.4 (#143753) 2024-12-24 12:24:10 +00:00
test_namedtensor.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_namedtuple_return_api.py
test_native_functions.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_native_mha.py [ROCm] Update to AOTriton 0.8b (#140172) 2024-12-06 21:45:18 +00:00
test_nestedtensor.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_nn.py [CUDA][TF32] Add some missing TF32 decorators to test_nn.py (#144592) 2025-01-11 16:20:59 +00:00
test_nnapi.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_numba_integration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_numpy_interop.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_openmp.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_ops.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_ops_fwd_gradients.py
test_ops_gradients.py
test_ops_jit.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_optim.py fix memleak, detach instead of clone to not drag around graph (#144154) 2025-01-06 17:09:00 +00:00
test_out_dtype_op.py [Codemod][AddExplicitStrictExportArg] caffe2/test (#143688) 2024-12-27 07:58:44 +00:00
test_overrides.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_package.py
test_per_overload_api.py
test_prims.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_proxy_tensor.py detect fake mode in proxy_tensor creation in make_fx (#144168) 2025-01-06 19:02:08 +00:00
test_pruning_op.py
test_public_bindings.py [BE] Enable test_public_bindings on MacOS (#144591) 2025-01-12 00:34:47 +00:00
test_python_dispatch.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_pytree.py [TreeSpec] Support enum in defaultdict (#144235) 2025-01-07 00:10:46 +00:00
test_quantization.py Add support for prototype affine quantization in pt2e flow (#141421) 2024-12-24 04:22:18 +00:00
test_reductions.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_scatter_gather_ops.py
test_schema_check.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_segment_reductions.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_serialization.py Revert "Use absolute path path.resolve() -> path.absolute() (#129409)" 2025-01-04 14:17:20 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
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 [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
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 Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_spectral_ops.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_stateless.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_static_runtime.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_subclass.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_sympy_utils.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_tensor_creation_ops.py S390x ci periodic tests (#125401) 2025-01-10 18:21:07 +00:00
test_tensorboard.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_tensorexpr.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
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
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 [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +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 Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_typing.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_unary_ufuncs.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_utils.py [4/N] Apply py39 ruff and pyupgrade fixes (#143257) 2025-01-04 10:47:51 +00:00
test_utils_config_module.py [AoTI Minifier] UX Improvement (#143330) 2025-01-07 20:04:19 +00:00
test_utils_filelock.py filelock: Make waitcounter variant to use (#139816) 2024-12-12 01:18:34 +00:00
test_view_ops.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_vulkan.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_weak.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_xnnpack_integration.py Fix unused Python variables in test/[e-z]* (#136964) 2024-12-18 23:02:30 +00:00
test_xpu.py Revert "Fix poision child process issue when call getAccelerator() (#144368)" 2025-01-10 23:36:43 +00:00