Visitar URL original
Added utilities to instrument kernel bandwidth numbers by Chillee · Pull Request #95355 · pytorch/pytorch · GitHub
Skip to content

Added utilities to instrument kernel bandwidth numbers - #95355

Closed
Chillee wants to merge 3 commits into
gh/chillee/188/basefrom
gh/chillee/188/head
Closed

Chillee wants to merge 3 commits into
gh/chillee/188/basefrom
gh/chillee/188/head

Conversation

@Chillee

@Chillee Chillee commented Feb 23, 2023 •

Copy link
Copy Markdown
Collaborator

@pytorch-bot

pytorch-bot Bot commented Feb 23, 2023 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/95355

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 71e905d:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@ngimel ngimel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a config option for this?



class DebugAutotuner(CachingAutotuner):
def __init__(self, *args, regex_filter="", **kwargs):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need regex?

@Chillee Chillee Feb 23, 2023 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I also wanted to add a way to filter the triton kernels so not all of them would get run (unimplemented so far).

if isinstance(referrer, dict):
for k, v in referrer.items():
if v is obj:
obj_names.append(k)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol is there not a better way to get kernel name?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we could pass it down in the codegen to the CachedAutotuner object, but this was a less intrusive way of doing the same thing.

Since it's debug/instrumentation code, I didn't feel like it was necessarily worth doing the modification.

Comment thread torch/_inductor/triton_ops/autotune.py Outdated
mutated_arg_names = meta.pop("mutated_arg_names", ())

def decorator(fn):
# Uncomment this to profile bandwidth for each Triton kernel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a config flag?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'll add an env variable.

@albanD
albanD removed their request for review February 23, 2023 17:20


cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

Looks like

<img width="444" alt="image" src="https://user-images.githubusercontent.com/6355099/220815020-c62128d9-9b12-4d8b-ab54-219f92b5d5b0.png">


[ghstack-poisoned]
@Chillee Chillee added the topic: not user facing topic category label Feb 23, 2023
@Chillee

Chillee commented Feb 23, 2023

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 23, 2023
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator



cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

Looks like

![image](https://user-images.githubusercontent.com/6355099/221048077-33aeff50-0951-42c9-89e9-22049db4f94d.png)


[ghstack-poisoned]
Chillee added a commit that referenced this pull request Feb 23, 2023
ghstack-source-id: 26f4fe2
Pull Request resolved: #95355
@Chillee

Chillee commented Feb 24, 2023

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
@facebook-github-bot
facebook-github-bot deleted the gh/chillee/188/head branch June 8, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants