Skip to content

Conversation

@chelsea0x3b
Copy link
Contributor

@chelsea0x3b chelsea0x3b commented Sep 24, 2025

Resolves #8273

Previously no error message was raising when a parameter was marked as a constexpr AND listed in the do_not_specialize list. It was just silently treated as a compile time constant, and new specializations would be added.

This PR checks for these cases at compile time. See added test case explanation. Note that it will error on the call to triton.jit NOT the call to execute the kernel.

New contributor declaration

  • I am not making a trivial change, such as fixing a typo in a comment.

  • I have written a PR description following these
    rules.

  • I have run pre-commit run --from-ref origin/main --to-ref HEAD.

  • Select one of the following.

    • I have added tests.
      • /test for lit tests
      • /unittest for C++ tests
      • /python/test for end-to-end tests
    • This PR does not need a test because FILL THIS IN.
  • Select one of the following.

    • I have not added any lit tests.
    • The lit tests I have added follow these best practices,
      including the "tests should be minimal" section. (Usually running Python code
      and using the instructions it generates is not minimal.)

Copy link
Collaborator

@ThomasRaoux ThomasRaoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ThomasRaoux ThomasRaoux merged commit c6683c8 into triton-lang:main Sep 25, 2025
12 of 18 checks passed
Jokeren pushed a commit that referenced this pull request Oct 10, 2025
Resolves #8273 

Previously no error message was raising when a parameter was marked as a
constexpr AND listed in the do_not_specialize list. It was just silently
treated as a compile time constant, and new specializations would be
added.

This PR checks for these cases at compile time. See added test case
explanation. Note that it will error on the call to `triton.jit` NOT the
call to execute the kernel.

# New contributor declaration
- [ ] I am not making a trivial change, such as fixing a typo in a
comment.

- [x] I have written a PR description following these
  [rules](https://cbea.ms/git-commit/#why-not-how).

- [x] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`.

- Select one of the following.
  - [x] I have added tests.
    - `/test` for `lit` tests
    - `/unittest` for C++ tests
    - `/python/test` for end-to-end tests
  - [ ] This PR does not need a test because `FILL THIS IN`.

- Select one of the following.
  - [x] I have not added any `lit` tests.
- [ ] The `lit` tests I have added follow these [best
practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python
code
    and using the instructions it generates is not minimal.)

---------

Co-authored-by: ryan-yide <yide.ran@lambdal.com>
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.

do_not_specialize not preventing new compilations

3 participants