Skip to content

Specialize AOT sizes and strides as int32#155

Merged
voltjia merged 2 commits into
masterfrom
specialize-aot-sizes-and-strides-as-int32
May 12, 2026
Merged

Specialize AOT sizes and strides as int32#155
voltjia merged 2 commits into
masterfrom
specialize-aot-sizes-and-strides-as-int32

Conversation

@voltjia
Copy link
Copy Markdown
Collaborator

@voltjia voltjia commented May 12, 2026

Summary

  • Specialize AOT-generated size and stride parameters as int32 by default.
  • Add an int64 fallback variant when runtime tensor shapes or strides overflow int32.
  • Split the generated size and stride parameter types into separate size_type and stride_type fields.
  • Add a test case for AOT int32 overflow guard generation.

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 215 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 ....                                            [ 13%]
tests/test_clone.py ....                                                 [ 15%]
tests/test_conv2d.py ....                                                [ 17%]
tests/test_data_ptr.py .                                                 [ 18%]
tests/test_debugging.py .                                                [ 18%]
tests/test_dropout.py .                                                  [ 19%]
tests/test_eval.py ........                                              [ 22%]
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%]

======================= 215 passed in 1625.33s (0:27:05) =======================

@voltjia voltjia merged commit 41afcf8 into master May 12, 2026
8 checks passed
@voltjia voltjia deleted the specialize-aot-sizes-and-strides-as-int32 branch May 12, 2026 07:46
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