[lint] Add TRITON_ENABLE_EXTRA_ANALYSIS_PASSES knob with outer-loop pipelining check#1260
Open
sfzhu93 wants to merge 2 commits intofacebookexperimental:mainfrom
Open
[lint] Add TRITON_ENABLE_EXTRA_ANALYSIS_PASSES knob with outer-loop pipelining check#1260sfzhu93 wants to merge 2 commits intofacebookexperimental:mainfrom
sfzhu93 wants to merge 2 commits intofacebookexperimental:mainfrom
Conversation
Contributor
|
@sfzhu93 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100448245. |
Summary: Add a read-only MLIR analysis pass that runs after the software pipeliner and emits remarks explaining why scf.ForOp loops were not pipelined. Checks the 3 most common failure reasons: - num_stages <= 1 (pipelining not requested) - loop distance > 1 (not supported) - outer loop with nested loops (not supported) - no latency assigned to any op in loop Gated by TRITON_ENABLE_PIPELINING_ANALYSIS env var (off by default). Placed in CACHE_NEUTRAL since it is read-only and does not modify IR. Differential Revision: D100448245
cf708c7 to
91ba0cf
Compare
…ng check Add a new opt-in knob TRITON_ENABLE_EXTRA_ANALYSIS_PASSES that gates extra static analysis passes in the compiler pipeline. This establishes the infrastructure for compiler-induced lint — a series of read-only analysis passes that emit MLIR remarks to help diagnose compiler behavior. As a first check, the PipeliningAnalysis pass diagnoses outer loops (containing nested loops) that request pipelining but will be skipped. The pass runs after loop fusion and before the pipeliner, so it sees the IR after nested loops have had a chance to be flattened. More analysis checks will be added in follow-up PRs. Authored with Claude.
91ba0cf to
9636e44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new opt-in knob
TRITON_ENABLE_EXTRA_ANALYSIS_PASSESthat gates extra static analysis passes in the compiler pipeline. This establishes the infrastructure for compiler-induced lint — a series of read-only analysis passes that emit MLIR remarks to help diagnose compiler behavior.What this PR does
TRITON_ENABLE_EXTRA_ANALYSIS_PASSESenv var andknobs.nvidia.enable_extra_analysis_passesknobPipeliningAnalysispass that runs after loop fusion but before the pipelinernum_stages > 1) but will be skipped because they contain nested loopsWhy a separate knob?
These analysis passes are opt-in diagnostic tools, not part of the default compilation pipeline. They emit MLIR remarks (visible when
MLIR_ENABLE_DIAGNOSTICS=remarksis set) to help users and compiler developers understand why certain optimizations were not applied.Follow-up work
More analysis checks will be added under the same knob in follow-up PRs. For example, a complete and sound diagnosis on the loop pipelining, barrier analysis and more static analyses.
Mostly authored with Claude.