Deliverables
- Submit a PR on preventing unlowered
linalg.generic from reaching mlir-translate --mlir-to-llvmir in Triton RISC-V math op lowering.
- Include focused pytest evidence showing that
python/examples/test_core.py::test_math_op[float32-log-x] no longer fails with a missing linalg dialect diagnostic.
Background
The current repository has a math lowering failure where final MLIR translation receives a linalg.generic op:
error: Dialect `linalg' not found for custom op 'linalg.generic'
Representative failure:
/tmp/.../ll.mlir:53:5: error: Dialect `linalg' not found for custom op 'linalg.generic'
This indicates the final translation boundary is receiving IR that has not been fully lowered to dialects accepted by the selected mlir-translate path.
Task Description
- Reproduce from the
triton-riscv repository root:
cd python/examples
pytest -q 'test_core.py::test_math_op[float32-log-x]'
- Capture the final
ll.mlir or equivalent IR and identify the pass sequence that leaves linalg.generic in the translation input.
- Fix the pass pipeline so this math op is lowered before
mlir-translate, or use a translation context that intentionally supports the dialect if that is the correct architecture.
- Run the focused pytest case above and at least one adjacent math op such as
exp, sqrt, or sin.
- In the PR description, include the before/after IR boundary, the pass ordering change if any, and the pytest commands run.
Deliverables
linalg.genericfrom reachingmlir-translate --mlir-to-llvmirin Triton RISC-V math op lowering.python/examples/test_core.py::test_math_op[float32-log-x]no longer fails with a missinglinalgdialect diagnostic.Background
The current repository has a math lowering failure where final MLIR translation receives a
linalg.genericop:Representative failure:
This indicates the final translation boundary is receiving IR that has not been fully lowered to dialects accepted by the selected
mlir-translatepath.Task Description
triton-riscvrepository root:ll.mliror equivalent IR and identify the pass sequence that leaveslinalg.genericin the translation input.mlir-translate, or use a translation context that intentionally supports the dialect if that is the correct architecture.exp,sqrt, orsin.