-
Notifications
You must be signed in to change notification settings - Fork 430
Move SASS diff description to a SKILL #9767
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
+50
−48
Merged
Changes from all commits
Commits
Show all changes
4 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| name: sass-diff | ||
| description: Use when asked to check for SASS (or PTX) changes between commits, branches, or a local changeset; guides normalization, comparison, and reporting of CUDA disassembly diffs. | ||
| --- | ||
|
|
||
| # SASS Diffs | ||
|
|
||
| Use this when asked to check for SASS changes between commits, branches or a local changeset. | ||
|
|
||
| ## Goal | ||
|
|
||
| Detect relevant changes in generated CUDA machine code (i.e. SASS) while filtering noise from addresses, symbols, metadata, etc. | ||
| Any non-trivial change must be detected. | ||
|
|
||
| ## Inputs to establish | ||
|
|
||
| * Compilation target under test | ||
| * The CUDA SM architectures to compile for. Try to detect this from the code and offer the user a list of suggestions. | ||
| The user must confirm or provide this list. | ||
|
bernhardmgruber marked this conversation as resolved.
|
||
| * Baseline source (e.g. the previous commit/branch or the current commit without the changes in the working copy). | ||
| * Comparison source (e.g. the current commit/branch or the current commit with the changes in the working copy). | ||
| * Whether a SASS (default) or PTX diff is requested. | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| ## Disassembly listing generation | ||
|
|
||
| * Compile both, the baseline and comparison source, with the same compiler flags and options. | ||
| When not specified otherwise, lookup the options from `compile_commands.json` | ||
| or the current build system (i.e. CMake files). | ||
| Make sure the CUDA SM architectures (`CMAKE_CUDA_ARCHITECTURES`) are set to the user-provided or approved list. | ||
| * Dump the disassembly from the binaries produced in the previous set using `cuobjdump -sass` or `cuobjdump -ptx`. | ||
|
|
||
| ## Comparison rules (what matters) | ||
|
|
||
| Ignore as trivial: | ||
|
|
||
| * Register renaming with identical instruction sequence and operands. | ||
| * Pure label renumbering or reordering of identical basic blocks. | ||
| * Formatting-only differences or reordered symbol tables. | ||
| * Changes to symbol names (global function names) | ||
|
|
||
| ## Reporting | ||
|
|
||
| * If any non-trivial change was detected, report the top 5 regions where a non-trivial change was detected, | ||
| including the name of the kernel they appeared in. | ||
| * Provide a short summary of the diff type, | ||
| including opcode changes, memory access size/cache policy changes, control-flow changes, register-count changes, | ||
| spills/local memory, shared memory, and occupancy-relevant resource deltas. | ||
| * Explicitly state if only noise was detected. | ||
| * If you are not sure if the differences are impactful, show it and ask the user for guidance. | ||
| * Keep the disassembly dumps available and tell the user where they can find them. | ||
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
Oops, something went wrong.
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.
I would note that the bot should also check the
compile_commands.jsonto get a definitive answer for this. The architectures will be listed explicitly in the compiler flags.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.
No it shouldn't.
compile_commands.jsonis what the user compiles for but not necessarily what SM architectures you want to SASS diff. For example, I develop with onlySM120inCMAKE_CUDA_ARCHITECTURES, but every time I SASS-diff I lookup in the tuning headers what SM arches could be impacted by the change and then ask to diff for those.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 think I understand now, reworded a bit.