`lp.assignment_to_subst`: Should it support 1-long axes as a special case?
- Dominant language
- Python
- Stars
- 636
- Forks
- 81
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 7
Description
```python
knl = lp.make_kernel(
'{[i, j]: 0<=i,j<10}',
"""
<> tmp[i, 0] = 2 * i
out[j] = tmp[j, 0]
""")
knl = lp.assignment_to_subst(knl, 'tmp')
```
fails with:
```
File "/home/square/projects/ceesd/loopy/loopy/transform/subst.py", line 431, in assignment_to_subst
raise LoopyError("In defining instruction '%s': "
loopy.diagnostic.LoopyError: In defining instruction 'insn': asignee index '0' is not a plain variable. Perhaps use loopy.affine_map_inames() to perform substitution.
```
Should we support such trivial definitions in `assignment_to_subst` or is it the user's problem to avoid having such definitions in the first place?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reproducer in the issue and inspect loopy/transform/subst.py around assignment_to_subst, especially the error at line 431. Compare the behavior with the suggested affine_map_inames() path and determine whether one-long axes should be supported; done means the expected behavior and corresponding validation are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100