Skip to content

Conversation

afroz-oai
Copy link
Contributor

@afroz-oai afroz-oai commented Oct 8, 2025

Update constraints dict to accept callable for split_k and invoke that callable to determine split_k.

Spoke to Philippe Tillet offline, there are cases where we need to decide split_k dynamically based on the shapes of the operands.

Notably, in our case we want batch size invariance, but want to restrict the amount of memory that's otherwise allocated, i.e. [split_k, m, n] allocation for the scratch memory to do the bmk,kn->bmn multiplication, so pass that as an additional constraint max_allowable_mn which drop down to split_k = 1 if m * n > max_allowable_mn.

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 ADDED.
  • 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.)

…t callable to determine split_k.

Update constraints dict to accept callable for split_k and invoke that callable to determine split_k.
@afroz-oai afroz-oai requested a review from ptillet as a code owner October 8, 2025 15:51
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@afroz-oai afroz-oai changed the title Update constraints to accept callable for split_k and invoke it to determine split_k. [WIP] Update constraints to accept callable for split_k and invoke it to determine split_k. Oct 8, 2025
@afroz-oai afroz-oai changed the title [WIP] Update constraints to accept callable for split_k and invoke it to determine split_k. Update constraints to accept callable for split_k and invoke it to determine split_k. Oct 8, 2025
@afroz-oai afroz-oai changed the title Update constraints to accept callable for split_k and invoke it to determine split_k. Update constraints to accept another constraint on split_k. Oct 10, 2025
@afroz-oai afroz-oai changed the title Update constraints to accept another constraint on split_k. Constraint on split_k on m * n Oct 10, 2025
@ptillet ptillet enabled auto-merge (squash) October 10, 2025 22:55
@ptillet ptillet merged commit 4e0d041 into triton-lang:main Oct 11, 2025
8 of 9 checks passed
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.

3 participants