-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Enable ruff-pre-commit for third_party/nvidia
#5587
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,7 +232,7 @@ def make_ttgir(mod, metadata, opt, capability): | |
| # Set up Diagnostic | ||
| if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1": | ||
| srcMgr = llvm.source_mgr() | ||
| diag = ir.source_mgr_diag(srcMgr, mod.context) | ||
| _ = ir.source_mgr_diag(srcMgr, mod.context) | ||
| mod.context.printOpOnDiagnostic(True) | ||
| # TTIR -> TTGIR | ||
| pm = ir.pass_manager(mod.context) | ||
|
|
@@ -286,7 +286,7 @@ def make_llir(src, metadata, options, capability): | |
| # Set up Diagnostic | ||
| if os.environ.get("MLIR_ENABLE_REMARK", "0") == "1": | ||
| srcMgr = llvm.source_mgr() | ||
| diag = ir.source_mgr_diag(srcMgr, mod.context) | ||
| _ = ir.source_mgr_diag(srcMgr, mod.context) | ||
| mod.context.printOpOnDiagnostic(True) | ||
| passes.ttgpuir.add_combine_tensor_select_and_if(pm) | ||
| passes.convert.add_scf_to_cf(pm) | ||
|
|
@@ -306,7 +306,7 @@ def make_llir(src, metadata, options, capability): | |
| llvm.init_targets() | ||
| context = llvm.context() | ||
| if os.environ.get("TRITON_ENABLE_ASAN", "0") == "1": | ||
| raise ASANError( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| raise RuntimeError( | ||
| "Address Sanitizer Error: Address sanitizer is currently only supporteedd on the AMD backend") | ||
| llvm_mod = llvm.to_module(mod, context) | ||
| proc = 'sm_90a' if capability == 90 else f'sm_{capability}' | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failure looks real, probably the lifetime of this variable controls the diagnostics setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rerun CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be fine now :)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this in my PR as well #5581. I guess it doesn't depend on the lifetime of the variable. Previously it calls a constructor for the
SourceMgrDiagnosticHandler, which registers the handler into the MLIRContext.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sfzhu93!
I see you are removing these sections in your PR. My changes, I think, will just introduce a small conflict (if they are merged earlier) that will have to be fixed, but that should be easy.