Skip to content

Fix AOT non-power-of-two innermost sizes#156

Merged
voltjia merged 2 commits into
masterfrom
fix-aot-non-power-of-two
May 16, 2026
Merged

Fix AOT non-power-of-two innermost sizes#156
voltjia merged 2 commits into
masterfrom
fix-aot-non-power-of-two

Conversation

@voltjia
Copy link
Copy Markdown
Collaborator

@voltjia voltjia commented May 16, 2026

Summary

  • Add an AOT regression test for static non-power-of-two innermost sizes.
  • Convert positive integer constants used for innermost indices to the next power of two during code generation.
  • Preserve the original logical size in masks, so generated tl.arange extents are valid for Triton while tensor semantics stay unchanged.

Testing

pytest output:

============================= test session starts ==============================
platform linux -- Python 3.10.16, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/huangjiacheng/ninetoothed
configfile: pyproject.toml
plugins: anyio-4.12.1, xdist-3.8.0, cov-7.0.0, typeguard-4.4.4
collected 216 items

tests/test_add.py .                                                      [  0%]
tests/test_addmm.py ..                                                   [  1%]
tests/test_aot.py ............                                           [  6%]
tests/test_aot_auto_tuning.py ....                                       [  8%]
tests/test_attention.py ........                                         [ 12%]
tests/test_auto_tuner.py ....                                            [ 14%]
tests/test_clone.py ....                                                 [ 16%]
tests/test_conv2d.py ....                                                [ 18%]
tests/test_data_ptr.py .                                                 [ 18%]
tests/test_debugging.py .                                                [ 18%]
tests/test_dropout.py .                                                  [ 19%]
tests/test_eval.py ........                                              [ 23%]
tests/test_expand.py .                                                   [ 23%]
tests/test_generation.py ............................................... [ 45%]
.............................                                            [ 58%]
tests/test_getitem.py ..........                                         [ 63%]
tests/test_ipynb.py .                                                    [ 63%]
tests/test_jagged.py ................                                    [ 71%]
tests/test_matmul.py ..                                                  [ 72%]
tests/test_max_pool2d.py ..                                              [ 73%]
tests/test_naming.py .......                                             [ 76%]
tests/test_pad.py ................................................       [ 98%]
tests/test_pow.py .                                                      [ 99%]
tests/test_softmax.py .                                                  [ 99%]
tests/test_unsqueeze.py .                                                [100%]

======================= 216 passed in 952.02s (0:15:52) ========================

@voltjia voltjia merged commit d9fb0bb into master May 16, 2026
8 checks passed
@voltjia voltjia deleted the fix-aot-non-power-of-two branch May 16, 2026 10:40
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.

1 participant