Skip to content

Conversation

yangshuxin
Copy link
Contributor

@yangshuxin yangshuxin commented Oct 5, 2025

This change fix bugs in range-analysis, and let buffer-ops use the range-analysis result to decide if it's legal to convert memory-op to buffer-ops.

It fixes https://github.com/ROCm/triton-internal/issues/1180 and ROCm#871.

The highlight are following:

  • Range Analysis

    • fix the way to use tl.assume. Previously, it does not consider the control flow relationship between, say tl.assume x > 0 and the location of occurrence of x.
    • correct the value range of make_range(begin, end), previous vr is [begin, end], now is [begin, end-1]. Small change in concept incur huge change the regression test.
    • being able to work for some SCP operations, providing a way to side-step MLIR's frameworks' limitation (it does not understand SCF).
    • add a tech note to the file illustrate how to side-step the dataflow frameworks' limitation.
  • Buffer-ops

  • for large tensor (>2G), remove the ad-hoc, and mistaken range-analysis in the pass. It only relies on the result of the range-analysis pass.
  • previous, buffer-ops pass only check element-index > 0. The right condition is byte-offset in [0, 2G-element-size].
  • Previous there is a similar work here [AMD] Update BufferOps Non-Negative Check to be in Bytes #7908, contributed by @njriasan . My change to this part is similar but fix some bugs in PR7908 (.e.g. lattice could be nullptr), and update large number of testings. That being said, now that @njriasan made the first change, credit for the part belong to him.

@yangshuxin yangshuxin force-pushed the shuxin/revamp_value_range branch from c610cac to 8cf91be Compare October 7, 2025 17:38
@yangshuxin
Copy link
Contributor Author

I set change the status to "ready for review" despite failures on Nvidia platform. My change is only about AMD platform, I guess my change is not the culprit.

@yangshuxin yangshuxin marked this pull request as ready for review October 7, 2025 18:12
@yangshuxin yangshuxin changed the title [AMD][DRAFT] revamp range analysis [AMD] revamp range analysis Oct 7, 2025
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