You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[fix] Bugfixes for missing ttnn package, tt-mlir CAPI library resolution, and broken pytests (#208)
- Problem: TTNN package instability and configure-time availability
check - ttnn package in `tt-mlir/third_party/tt-metal` may disappear or
change, and `ttlang_check_ttnn_available()` checked at configure time
when ttnn only available after build.
Fix: Created `cmake/modules/CopyTTNNPythonPackage.cmake` to copy ttnn to
`build/python_packages/ttnn/` during build. Removed
`ttlang_check_ttnn_available()` from `cmake/modules/TTLangUtils.cmake`.
Tests use runtime checks (`REQUIRES: ttnn` directive,
`pytest.importorskip()`).
- Problem: CAPI library resolution issues - `python/CMakeLists.txt`
could find wrong `libTTMLIRPythonCAPI.so` from different tt-mlir install
at configure time, and Python extension could resolve wrong library at
runtime, causing MLIRContext registry mismatches.
Fix: Made configure-time search paths mutually exclusive (only search
`TTMLIR_BUILD_DIR` when defined, else search `TTMLIR_PATH`). Added
`BUILD_RPATH` and `INSTALL_RPATH` properties to constrain runtime
library search to configured tt-mlir directories.
- Problem: Missing pytest infrastructure and broken test files - no
pytest check target or configuration, lit tests incorrectly collected by
pytest, `test_elementwise_ops.py` imported from non-existent
`examples/utils` (deleted in #67), `test_block_allocation.py` used wrong
function name `new_split_work_to_cores` and unsafe ttnn import.
Fix: Added `check-ttlang-pytest` target to `test/CMakeLists.txt`.
Created `test/python/conftest.py` with feature detection, markers,
fixtures, and `collect_ignore` list. Recovered the deleted
`examples/utils.py` that was required in pytests -- now
`test/python/utils.py`. Fixed corresponding imports and function names
in test files, added `# REQUIRES: ttnn` directive, changed to
`pytest.importorskip("ttnn")`.
- Problem: `test/python/simple_add_multitile.py` fails on qb because of
ordering differences.
Fix: Use `CHECK-DAG:` appropriately.
0 commit comments