Skip to content

[FIX] Let the tile-* CLIs run without pytest installed - #478

Merged
mark14wu merged 2 commits into
mainfrom
fix-cli-pytest-import
Sep 27, 2026
Merged

mark14wu merged 2 commits into
mainfrom
fix-cli-pytest-import

Conversation

@mark14wu

@mark14wu mark14wu commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • tilelens.wrapper imported pytest at module level, but pytest is only in the test extra. After a plain pip install tilelens, tile-sanitizer, tile-profiler, tile-race and their triton-* aliases all failed with ModuleNotFoundError: No module named 'pytest' before running anything. This was already the case for triton-viz 3.0, and it is visible now that tilelens 3.1 is on PyPI.
  • Import pytest only in the branch that forwards to pytest.main, the one place it is used.
  • Bump the version to 3.1.1 so the fix can be released.

Test Plan

  • Added test_wrapper_imports_without_pytest, which imports tilelens.wrapper in a subprocess with pytest blocked. The same check fails on main.
  • Built the 3.1.1 wheel and installed it with torch and numpy but without pytest. tile-sanitizer, tile-profiler, tile-race, triton-sanitizer, triton-profiler, and triton-race-detector all ran a small kernel script.
  • After installing pytest, tile-sanitizer pytest -q test_k.py still runs the test.

After merge: tag the merge commit v3.1.1 and publish a GitHub release, which uploads tilelens 3.1.1 through the existing trusted publisher.

Related Issues

Follow-up to #477.

Breaking Changes

None.

Checklist

  • I added tests to all new functionality I added/bugs I fixed.
  • I verified that a human has reviewed all code in this PR.
  • I ran npm run build:frontend if the PR modified any TypeScript code.
  • I made sure that my code is well documented (comments explaining strange code, docstrings for functions, website modified if new functionality added).

tilelens.wrapper imported pytest at module level, but pytest is only in
the test extra. After a plain `pip install tilelens`, tile-sanitizer,
tile-profiler, tile-race and their triton-* aliases all failed with
ModuleNotFoundError before running anything. pytest is now imported in
the branch that forwards to pytest.main, the only place it is used.

Add a test that imports tilelens.wrapper in a subprocess with pytest
blocked.
@github-actions

Copy link
Copy Markdown

Performance Benchmark

Benchmark main (min) PR (min) Change Samples
gemm 0.106s 0.105s -0.6% 20 / 20
gemm_oob 0.118s 0.118s -0.3% 20 / 20
indirect_load 0.022s 0.022s -0.1% 20 / 20
nested_loop 0.237s 0.236s -0.4% 20 / 20
block_pointer_loop_advance 0.126s 0.126s -0.3% 20 / 20
liger_jsd 0.140s 0.140s -0.1% 20 / 20
flaggems_layernorm 0.396s 0.402s +1.4% 20 / 20
swiglu 0.172s 0.172s +0.4% 20 / 20
cross_entropy 0.991s 0.994s +0.3% 20 / 20
fused_linear_jsd 0.211s 0.212s +0.3% 20 / 20
Total 2.520s 2.527s +0.3% N/A

Iterations: 1 warmup + 20 measured
Samples are shown as main / PR; long pytest benchmarks may use fewer samples.

@mark14wu
mark14wu merged commit 29d190d into main Sep 27, 2026
4 checks passed
@mark14wu
mark14wu deleted the fix-cli-pytest-import branch September 27, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants