pytorch/test
vfdev-5 b72127cd4b [inductor] Support sym exprs in lowering constant promotion (#116196)
Follow-up to https://github.com/pytorch/pytorch/pull/115920

This PR fixes the error with symbolic expression in aten.div:
```python
import torch
aten = torch.ops.aten

def func(x, a):
    return aten.div(x * 0.5, a, rounding_mode=None)

cfunc = torch.compile(func, dynamic=True, fullgraph=True)
device = "cpu"
x = 124
a = 33
out = cfunc(x, a)
expected = func(x, a)
torch.testing.assert_close(out, expected)
```
Error message:
```
  File "/pytorch/torch/_inductor/graph.py", line 700, in call_function
    out = lowerings[target](*args, **kwargs)
  File "/pytorch/torch/_inductor/lowering.py", line 293, in wrapped
    out = decomp_fn(*args, **kwargs)
  File "/pytorch/torch/_inductor/lowering.py", line 4823, in div_mode
    return div(a, b)
  File "/pytorch/torch/_inductor/lowering.py", line 293, in wrapped
    out = decomp_fn(*args, **kwargs)
  File "/pytorch/torch/_inductor/lowering.py", line 4857, in div
    a, b = promote_constants(
  File "/pytorch/torch/_inductor/lowering.py", line 368, in promote_constants
    ex = next(x for x in inputs if isinstance(x, (TensorBox, ExpandView)))
torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
LoweringException: StopIteration:
  target: aten.div.Tensor_mode
  args[0]: 1.0*s0
  args[1]: s1
  kwargs: {'rounding_mode': None}

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/116196
Approved by: https://github.com/peterbell10
2023-12-20 21:59:51 +00:00
..
ao/sparsity [BE]: Enable RUFF PERF402 and apply fixes (#115505) 2023-12-20 18:01:24 +00:00
autograd Add basic autograd TORCH_LOGS support (#115438) 2023-12-20 15:23:44 +00:00
backends/xeon
benchmark_utils
bottleneck_test
cpp [c10d][libuv] add partial read test for libuv backend and fix an error which only happens when partially reading a buffer (#116141) 2023-12-20 18:37:55 +00:00
cpp_api_parity Add python and C++ support for LPPool3d (#114199) 2023-12-08 18:18:44 +00:00
cpp_extensions
custom_backend
custom_operator
distributed [c10d] Expose check method to Python for store via pybind (#116144) 2023-12-20 17:57:13 +00:00
distributions
dynamo pre_dispatch aot_export (#115188) 2023-12-20 21:36:25 +00:00
edge
error_messages
expect [sparse][semi-structured] add alg_id to _cslt_sparse_mm and _cslt_sparse_mm_search (#115178) 2023-12-11 23:08:51 +00:00
export [export] Update range constraints to runtime_var_to_range (#115427) 2023-12-20 20:00:41 +00:00
forward_backward_compatibility Fix backward for SDPA NT jagged layout (#115576) 2023-12-12 18:35:40 +00:00
functorch pre_dispatch aot_export (#115188) 2023-12-20 21:36:25 +00:00
fx [fx][split][testing] Add testing for #107981 (#108731) 2023-12-18 20:19:18 +00:00
inductor [inductor] Support sym exprs in lowering constant promotion (#116196) 2023-12-20 21:59:51 +00:00
jit
jit_hooks
lazy [BE]: Enable RUF015 codebase wide (#115507) 2023-12-11 15:51:01 +00:00
mobile
nn [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
onnx [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
onnx_caffe2
optim Revert "Adamw refactor (#115983)" 2023-12-19 15:26:44 +00:00
package
profiler Add basic autograd TORCH_LOGS support (#115438) 2023-12-20 15:23:44 +00:00
quantization Revert "[PT2] [Quant] Change the QConv2d Binary post op name from add to sum (#115329)" 2023-12-19 15:52:57 +00:00
scripts
test_img
torch_np [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
typing
_test_bazel.py
allowlist_for_publicAPI.json
conftest.py Reset stepcurrent cache if file succeeds (#115775) 2023-12-19 22:19:57 +00:00
create_dummy_torchscript_model.py
delete.py
HowToWriteTestsUsingFileCheck.md
linear.py
load_torchscript_model.py
minioptest_failures_dict.json
mkl_verbose.py
mkldnn_verbose.py
run_doctests.sh
run_test.py [ez] Remove some args from run_test.py (#115459) 2023-12-11 19:56:37 +00:00
simulate_nccl_errors.py
test_ao_sparsity.py
test_autocast.py Revert "More markDynamoStrictTest (#115870)" 2023-12-19 15:40:57 +00:00
test_autograd.py Activation checkpoint and checkpoint_sequential errors if use_reentrant not passed explicitly (#115868) 2023-12-20 15:23:44 +00:00
test_autograd_fallback.py
test_binary_ufuncs.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_bundled_images.py
test_bundled_inputs.py
test_comparison_utils.py
test_compile_benchmark_util.py
test_complex.py
test_content_store.py
test_cpp_api_parity.py markDynamoStrictTest some test_cpp_extensions.* (#115858) 2023-12-15 01:22:38 +00:00
test_cpp_extensions_aot.py markDynamoStrictTest some test_cpp_extensions.* (#115858) 2023-12-15 01:22:38 +00:00
test_cpp_extensions_jit.py markDynamoStrictTest some test_cpp_extensions.* (#115858) 2023-12-15 01:22:38 +00:00
test_cpp_extensions_open_device_registration.py markDynamoStrictTest some test_cpp_extensions.* (#115858) 2023-12-15 01:22:38 +00:00
test_cuda.py Reland "Serve multistream graph captures from correct pool (#114647)" (#116199) 2023-12-20 21:22:34 +00:00
test_cuda_expandable_segments.py
test_cuda_multigpu.py
test_cuda_nvml_based_avail.py markDynamoStrictTest some more tests (#115857) 2023-12-15 01:22:38 +00:00
test_cuda_primary_ctx.py markDynamoStrictTest some more tests (#115857) 2023-12-15 01:22:38 +00:00
test_cuda_sanitizer.py
test_cuda_trace.py markDynamoStrictTest some more tests (#115857) 2023-12-15 01:22:38 +00:00
test_custom_ops.py fix error message in pytorch (#115349) 2023-12-07 19:27:29 +00:00
test_dataloader.py [BE]: Enable RUFF PERF402 and apply fixes (#115505) 2023-12-20 18:01:24 +00:00
test_datapipe.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_decomp.py unMarkDynamoStrictTest on OpInfo-based tests (#115856) 2023-12-15 01:22:31 +00:00
test_deploy.py
test_determination.py
test_dispatch.py Revert "markDynamoStrictTest more tests (#115871)" 2023-12-19 15:36:27 +00:00
test_dlpack.py
test_dynamic_shapes.py add support for dynamic shapes in round (#115259) 2023-12-19 15:45:50 +00:00
test_expanded_weights.py
test_fake_tensor.py Add support for torch.cond in vmap (#114523) 2023-12-20 19:54:38 +00:00
test_flop_counter.py
test_foreach.py [BE]: Enable RUF015 codebase wide (#115507) 2023-12-11 15:51:01 +00:00
test_function_schema.py
test_functional_autograd_benchmark.py
test_functional_optim.py
test_functionalization.py pre_dispatch aot_export (#115188) 2023-12-20 21:36:25 +00:00
test_functionalization_of_rng_ops.py
test_futures.py
test_fx.py [sigmoid] fix for FX tracing unflattened modules (#115708) 2023-12-13 19:43:46 +00:00
test_fx_experimental.py
test_fx_passes.py
test_fx_reinplace_pass.py
test_hub.py
test_import_stats.py
test_indexing.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_itt.py
test_jit.py [BE]: Enable RUFF PERF402 and apply fixes (#115505) 2023-12-20 18:01:24 +00:00
test_jit_autocast.py
test_jit_disabled.py
test_jit_fuser.py
test_jit_fuser_legacy.py
test_jit_fuser_te.py [BE]: Enable RUFF PERF402 and apply fixes (#115505) 2023-12-20 18:01:24 +00:00
test_jit_legacy.py
test_jit_llga_fuser.py
test_jit_profiling.py
test_jit_simple.py
test_jit_string.py
test_jiterator.py
test_kernel_launch_checks.py
test_legacy_vmap.py
test_license.py
test_linalg.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_logging.py
test_masked.py
test_maskedtensor.py
test_matmul_cuda.py
test_meta.py add Half support for layer_norm on CPU (#99590) 2023-12-20 01:11:15 +00:00
test_metal.py
test_mkl_verbose.py
test_mkldnn.py [BE]: Enable RUFF PERF402 and apply fixes (#115505) 2023-12-20 18:01:24 +00:00
test_mkldnn_fusion.py improve mkldnn_linear_pointwise performance for contiguous tensor with non default contiguous strides (#114939) 2023-12-01 23:30:07 +00:00
test_mkldnn_verbose.py
test_mobile_optimizer.py Revert "markDynamoStrictTest on more tests (#115879)" 2023-12-15 20:00:09 +00:00
test_model_dump.py
test_model_exports_to_core_aten.py
test_module_init.py Revert "markDynamoStrictTest on more tests (#115879)" 2023-12-15 20:00:09 +00:00
test_modules.py Revert "markDynamoStrictTest on more tests (#115879)" 2023-12-15 20:00:09 +00:00
test_monitor.py
test_mps.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_multiprocessing.py Revert "markDynamoStrictTest on more tests (#115879)" 2023-12-15 20:00:09 +00:00
test_multiprocessing_spawn.py Revert "markDynamoStrictTest on more tests (#115879)" 2023-12-15 20:00:09 +00:00
test_namedtensor.py
test_namedtuple_return_api.py
test_native_functions.py
test_native_mha.py Revert "markDynamoStrictTest some more (#115885)" 2023-12-15 19:51:24 +00:00
test_nestedtensor.py Add chunk for jagged layout NT (#115842) 2023-12-20 20:13:20 +00:00
test_nn.py add Half support for layer_norm on CPU (#99590) 2023-12-20 01:11:15 +00:00
test_nnapi.py
test_numba_integration.py
test_numpy_interop.py Fix NULL dereference in binary CPU ops (#115183) 2023-12-06 03:37:47 +00:00
test_openmp.py
test_ops.py [easy] aten ops: support passing all args as kwargs, including self (#114920) 2023-12-16 18:32:58 +00:00
test_ops_fwd_gradients.py unMarkDynamoStrictTest on OpInfo-based tests (#115856) 2023-12-15 01:22:31 +00:00
test_ops_gradients.py unMarkDynamoStrictTest on OpInfo-based tests (#115856) 2023-12-15 01:22:31 +00:00
test_ops_jit.py unMarkDynamoStrictTest on OpInfo-based tests (#115856) 2023-12-15 01:22:31 +00:00
test_optim.py add markDynamoStrictTest to TestOptimRenewed, removing flakiness (#115947) 2023-12-16 01:33:32 +00:00
test_out_dtype_op.py
test_overrides.py
test_package.py
test_per_overload_api.py
test_prims.py Revert "markDynamoStrictTest some more (#115885)" 2023-12-15 19:51:24 +00:00
test_proxy_tensor.py pre_dispatch aot_export (#115188) 2023-12-20 21:36:25 +00:00
test_pruning_op.py
test_public_bindings.py [DeviceMesh] Rename _device_mesh.py to device_mesh.py to prepare for beta (#115099) (#115193) 2023-12-08 08:44:32 +00:00
test_python_dispatch.py
test_pytree.py [pytree] expand tree_map to accept multi-inputs (#115642) 2023-12-14 06:16:42 +00:00
test_quantization.py enable cat for cuda bits types (#115044) 2023-12-06 00:05:18 +00:00
test_reductions.py
test_scatter_gather_ops.py
test_schema_check.py Revert "markDynamoStrictTest some more (#115885)" 2023-12-15 19:51:24 +00:00
test_segment_reductions.py
test_serialization.py Revert "markDynamoStrictTest some more (#115885)" 2023-12-15 19:51:24 +00:00
test_set_default_mobile_cpu_allocator.py
test_shape_ops.py
test_show_pickle.py Revert "markDynamoStrictTest some more (#115885)" 2023-12-15 19:51:24 +00:00
test_sort_and_select.py Actually run Dynamo tests in all Dynamo shards (#115962) 2023-12-19 14:12:53 +00:00
test_sparse.py Add values backward support for sparse CSR, CSC, BSR, and BSC tensors (#115586) 2023-12-14 23:09:13 +00:00
test_sparse_csr.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_sparse_semi_structured.py [sparse][semi-structured] enable fp32 support, separate sparse and dense constraints (#115550) 2023-12-15 02:28:17 +00:00
test_spectral_ops.py
test_stateless.py
test_static_runtime.py
test_subclass.py
test_sympy_utils.py
test_tensor_creation_ops.py
test_tensorboard.py
test_tensorexpr.py
test_tensorexpr_pybind.py
test_testing.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_throughput_benchmark.py
test_torch.py Fix troch.gradient check for spacing arg list length (#115686) 2023-12-13 20:17:20 +00:00
test_transformers.py Revert "Fix allowed dtypes for mem_eff attention (#116026)" 2023-12-20 12:01:34 +00:00
test_type_hints.py
test_type_info.py
test_type_promotion.py [BE]: Apply FURB118 (prev): replaces unnecessary lambdas with operator. (#116027) 2023-12-20 19:35:08 +00:00
test_typing.py
test_unary_ufuncs.py Skip some flaky Dynamo tests (#116165) 2023-12-20 05:05:02 +00:00
test_utils.py Some tiny modification about torch.set/get_default_device (#116014) 2023-12-19 05:08:06 +00:00
test_view_ops.py
test_vulkan.py
test_weak.py [BE]: Enable RUF015 codebase wide (#115507) 2023-12-11 15:51:01 +00:00
test_xnnpack_integration.py