Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and root cause
Python subclasses of
PyStmtExprMutatorthat delegate to a default visitor receiveNoneinstead of the rewritten expression or statement. The C++ default visitors invoke their dispatch tables but discard the returned nodes.Change
src/tirx/ir/py_functor.cc: returnPrimExprandStmtfrom the default visitors and propagate the dispatch-table results.tests/python/tirx-base/test_tir_python_mutator_defaults.py: cover delegated expression and statement visitors, checking rewritten children, attribute values, and statement bodies.Tests and validation
Both new regression tests fail on unmodified upstream because the result is
None. With this isolated change, the following command passes 7 tests, 0 skipped:PYTHONPATH=$PWD/python python -m pytest -q \ tests/python/tirx-base/test_tir_python_mutator_defaults.py \ tests/python/tirx-base/test_tir_stmt_functor_ir_transform.py \ tests/python/tirx-base/test_tir_stmt_functor_substitute.py pre-commit run --files src/tirx/ir/py_functor.cc \ tests/python/tirx-base/test_tir_python_mutator_defaults.pyValidation environment: Apple M4 Max, macOS/Darwin 24.5.0 arm64, Python 3.12.11. Each branch was rebuilt separately from upstream
907a88c87with:cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DUSE_METAL=ON -DUSE_LLVM=OFF -DUSE_CUDA=OFF -DUSE_Z3=OFF cmake --build build --target tvm tvm_compiler tvm_runtime -j 8git diff --checkpasses. The applicable formatting and other pre-commit hooks pass. The repository-wide ASF-header hook reports 11 existing violations, reproduced on unmodified upstream; none is in the changed files.Related
Independent of BF16 Let/Bind legalization in #70. No duplicate open PR was found.