Colin Peppler
3c8b90542c
support unbacked softmax / logsoftmax (#162216)
### DDE
```
GuardOnDataDependentSymNode: Could not guard on data-dependent expression Eq(3*u0, 0) (unhinted: Eq(3*u0, 0)). (Size-like symbols: u0)
Caused by: (_decomp/decompositions.py:1185 in _softmax)
```
```
torch._dynamo.exc.UserError: Could not guard on data-dependent expression Eq(u0, 0) (unhinted: Eq(u0, 0)). (Size-like symbols: u0)
Caused by: logsoft = torch.nn.functional.log_softmax(nz, dim=0) # test/inductor/test_unbacked_symints.py:573 in fn (_decomp/decompositions.py:1212 in _log_softmax)
```
```
GuardOnDataDependentSymNode: Could not guard on data-dependent expression Ne(u0, 0) (unhinted: Ne(u0, 0)). (Size-like symbols: u0)
Caused by: (_refs/__init__.py:2218 in _reduction)
```
### Cannot convert symbols to int
```
File "torch/_inductor/lowering.py", line 7160, in prepare_softmax_online
and V.graph.sizevars.size_hint(rnumel) >= config.unroll_reductions_threshold
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "orch/_inductor/sizevars.py", line 591, in size_hint
return int(out)
^^^^^^^^
File "sympy/core/expr.py", line 342, in __int__
raise TypeError("Cannot convert symbols to int")
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/162216
Approved by: https://github.com/laithsakka, https://github.com/eellison
2025-09-18 15:43:20 +00:00
..
2025-09-18 06:40:07 +00:00
2025-08-08 03:14:59 +00:00
2025-09-18 15:43:20 +00:00
2025-06-22 15:52:27 +00:00
2025-09-18 14:32:36 +00:00
2025-09-18 00:43:32 +00:00
2025-09-16 17:42:19 +00:00
2025-09-17 09:32:38 +00:00
2025-09-18 15:43:20 +00:00
2025-07-12 05:47:06 +00:00
2025-09-13 19:57:23 +00:00
2025-08-13 06:28:23 +00:00
2025-07-16 08:11:53 +00:00
2025-09-11 18:51:25 +00:00
2025-09-16 00:49:05 +00:00
2025-09-18 15:43:20 +00:00
2025-07-12 05:47:06 +00:00
2025-09-18 04:46:26 +00:00
2025-08-08 17:41:22 +00:00
2025-09-04 08:27:56 +00:00
2025-09-16 17:42:19 +00:00
2025-09-02 16:10:30 +00:00
2025-08-26 20:03:59 +00:00
2025-09-07 23:37:31 +00:00
2025-08-21 00:22:43 +00:00
2025-09-18 06:40:07 +00:00
2025-09-18 13:53:48 +00:00
2025-09-18 09:20:37 +00:00
2025-07-09 11:02:22 +00:00
2025-09-17 17:01:48 +00:00
2025-06-17 08:18:47 +00:00
2025-07-08 15:39:56 +00:00
2025-09-18 00:56:22 +00:00
2025-09-16 00:23:48 +00:00
2025-07-16 20:01:34 +00:00
2025-06-19 23:26:42 +00:00
2025-09-02 16:53:55 +00:00
2025-09-08 22:59:13 +00:00
2025-07-02 22:55:29 +00:00
2025-09-16 17:01:06 +00:00
2025-08-28 01:15:58 +00:00
2025-09-17 08:12:32 +00:00
2025-09-16 00:13:56 +00:00
2025-09-16 20:45:38 +00:00
2025-08-28 01:15:58 +00:00
2025-09-17 09:32:38 +00:00
2025-09-17 18:17:26 +00:00
2025-08-07 00:09:56 +00:00
2025-08-31 16:21:49 +00:00
2025-08-07 00:09:56 +00:00
2025-08-07 00:09:56 +00:00
2025-08-07 00:09:56 +00:00
2025-08-07 00:09:56 +00:00
2025-09-18 13:53:48 +00:00
2025-09-18 12:08:13 +00:00
2025-09-16 18:00:22 +00:00
2025-09-18 14:22:03 +00:00
2025-04-27 09:56:42 +00:00
2025-07-08 00:11:52 +00:00
2025-06-10 16:13:38 +00:00
2025-05-21 01:03:26 +00:00
2025-09-04 21:57:27 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 18:22:14 +00:00
2025-07-09 11:02:22 +00:00
2025-07-09 11:02:22 +00:00
2025-09-17 15:48:54 +00:00
2025-08-29 23:10:58 +00:00
2025-06-14 03:37:38 +00:00
2025-05-21 01:03:26 +00:00
2025-06-05 14:30:49 +00:00
2025-07-25 04:36:55 +00:00
2025-08-01 15:05:41 +00:00
2025-09-11 18:51:25 +00:00
2025-09-09 18:04:12 +00:00
2025-09-15 23:00:39 +00:00
2025-07-09 11:02:22 +00:00
2025-04-27 09:56:42 +00:00
2025-09-01 19:57:19 +00:00
2025-09-12 10:54:42 +00:00
2025-07-09 11:02:22 +00:00
2025-08-16 00:54:32 +00:00
2025-08-06 07:36:37 +00:00
2025-08-14 18:15:49 +00:00
2025-08-19 10:25:47 +00:00
2025-08-31 22:31:39 +00:00
2025-09-05 18:43:41 +00:00
2025-04-23 16:59:29 +00:00
2025-08-12 20:52:25 +00:00
2025-06-14 18:18:43 +00:00