Skip to content

[TEST] Enable test-alignment.mlir checks & remove failing checks #6661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2025

Conversation

davidberard98
Copy link
Contributor

@davidberard98 davidberard98 commented Apr 30, 2025

Unless I'm doing something wrong when running lit test, I don't think test-alignment.mlir was actually checking any of the remarks.

There were two issues:

  1. -verify-diagnostics is not added to the triton-opt run command, so the expected-remark comments were not executing.
  2. expected-remarks was misspelled everywhere in this file, instead written as expeted-remarks.

This PR fixes the typo and adds -verify-diagnostics=only-expected (so that it checks for expected remarks, doesn't require an expected remark for all the remarks that are actually emitted), and it also removes all the failing expected-remarks (replacing them with TODOs). For ease of review, the PR is split into two commits - one which renames expeted-remark -> expected-remark, and one which replaces expected-remark with a TODO for the remarks that were previously failing.

@davidberard98
Copy link
Contributor Author

cc @makslevental who added -verify-diagnostics=only-expected in MLIR

@makslevental
Copy link
Contributor

makslevental commented Apr 30, 2025

Unless I'm doing something wrong when running lit test, I don't think test-alignment.mlir was actually checking any of the remarks.

Definitely wasn't checking before... Currently you have -o /dev/null which I suggest you remove because (testing locally) I see that there are "expected remarks" that are not in fact emitted:

within split at /home/mlevental/dev_projects/triton/test/Analysis/test-alignment.mlir:810 offset :20:6: error: expected remark "contiguity = [1, 1], divisibility = [16, 16], constancy = [1, 1], constant_value = <none>" was not produced
  // expected-remark @below {{contiguity = [1, 1], divisibility = [16, 16], constancy = [1, 1], constant_value = <none>}}
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// -----
module {
  tt.func @int_min_does_not_underflow_in_analysis() -> i64 {
    %c-9223372036854775808_i64 = arith.constant -9223372036854775808 : i64
    tt.return %c-9223372036854775808_i64 : i64
  }
}

@davidberard98
Copy link
Contributor Author

@makslevental These failures don't appear for me when I run locally - e.g. the one at test-alignment.mlir:810 offset :20:6 should be commented out / replaced with the TODO messages by this PR.

regarding -o /dev/null: I'm guessing this was initially added to hide the output, which is the same as the input IR, aside from renamed variables. In my local testing, when things fail, they still fail lit test, and return errors to stderr, even if we have -o /dev/null.

@davidberard98
Copy link
Contributor Author

also cc @Mogball who introduced the verify-diagnostics testing (since I don't have permissions to request reviewers)

@Mogball Mogball merged commit 2384eab into triton-lang:main Apr 30, 2025
8 checks passed
@ThomasRaoux
Copy link
Collaborator

so what's going on with the failing cases? Are those cases we regressed? Those use to all pass before moving to remarks?

@davidberard98
Copy link
Contributor Author

@ThomasRaoux I believe that:

  • Some failing cases are regressions
  • Some failing cases are formatted in ways that don't work with verify-diagnostics, e.g. comments that previously used CHECK-NEXT were directly replaced with expected-remark @below, when they don't actually apply to the next following op

@ThomasRaoux
Copy link
Collaborator

@ThomasRaoux I believe that:

  • Some failing cases are regressions
  • Some failing cases are formatted in ways that don't work with verify-diagnostics, e.g. comments that previously used CHECK-NEXT were directly replaced with expected-remark @below, when they don't actually apply to the next following op

interesting, thanks for the update

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.

4 participants