Skip to content

Reorg examples#136

Merged
ajassani merged 2 commits intomainfrom
fix/examples
May 2, 2025
Merged

Reorg examples#136
ajassani merged 2 commits intomainfrom
fix/examples

Conversation

@ajassani
Copy link
Copy Markdown
Collaborator

@ajassani ajassani commented May 2, 2025

No description provided.

@ajassani ajassani requested a review from Copilot May 2, 2025 14:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reorganizes example workflows by adding a new Jupyter Notebook that demonstrates how to use the TreePerfAnalyzer for fusion opportunity analysis.

  • Adds a new notebook with multiple code cells showcasing helper functions and event analysis
  • Introduces functions to navigate GPU event hierarchies and summarize their information

" print(next_evt['name'])\n",
" summarize_gpu_events_for_host_op(perf_analyzer, next_evt)\n",
" gpu_events = [perf_analyzer.tree.get_UID2event(uid) for uid in next_evt.get('gpu_events')]\n",
" if 'elementwise' in gpu_events[0]['name']:\n",
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

Consider adding a check to ensure that the 'gpu_events' list is not empty before accessing the first element to avoid a potential IndexError.

Suggested change
" if 'elementwise' in gpu_events[0]['name']:\n",
" if not gpu_events:\n",
" print('No GPU events found for the next host op. Skipping...')\n",
" elif 'elementwise' in gpu_events[0]['name']:\n",

Copilot uses AI. Check for mistakes.
"id": "1dbf8b45-81fb-44b7-af6f-f1e10e13a7b4",
"metadata": {},
"outputs": [],
"source": [
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

[nitpick] Clarify in a comment that this file path is a placeholder for demonstration purposes and should be replaced with an actual profile file path for production use.

Suggested change
"source": [
"source": [
"# Note: This is a placeholder file path for demonstration purposes.\n",
"# Replace '/path/to/profile.json' with the actual profile file path in production.\n",

Copilot uses AI. Check for mistakes.
@ajassani ajassani merged commit 8f40079 into main May 2, 2025
@ajassani ajassani deleted the fix/examples branch May 2, 2025 14:04
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.

2 participants