Skip to content
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

Memory profiler for cuda #1996

Draft
wants to merge 1 commit into
base: profiler_combined_new
Choose a base branch
from

Conversation

jainapurva
Copy link
Contributor

No description provided.

@jainapurva jainapurva requested a review from Copilot April 1, 2025 20:25
Copy link

pytorch-bot bot commented Apr 1, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures

As of commit 2c62286 with merge base 70fc520 (image):

NEW FAILURES - The following jobs have failed:

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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 1, 2025
@jainapurva jainapurva changed the base branch from main to profiler_combined_new April 1, 2025 20:25
Copy link

@Copilot 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 introduces memory profiling support for CUDA in the microbenchmarks, integrating both model profiling and memory profiling into the benchmarking workflow. Key changes include the addition of utility functions for uploading trace files and generating URLs for Perfetto UI, modifications in the benchmark configuration to enable profiling, and updates to the benchmark runner to execute the new profiling functionalities.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
benchmarks/microbenchmarks/utils.py Added functions to upload trace files, generate model and memory profiles, and generate Perfetto URLs.
benchmarks/microbenchmarks/test/benchmark_config.yml Enabled profiler and memory profile flags for one benchmark configuration.
benchmarks/microbenchmarks/benchmark_runner.py Updated error handling and conditional CSV generation based on collected results.
benchmarks/microbenchmarks/benchmark_inference.py Integrated calls to the newly added profiling functions with proper error logging.

DEFAULT_TTL_SEC = 28 * 24 * 60 * 60
file_name = os.path.basename(local_path)
manifold_path = os.path.join(
MANIFOLD_FOLDER, f"{os.getlogin()}_{str(uuid.uuid4())}_{file_name}"
Copy link
Preview

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

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

Using os.getlogin() can raise an OSError in non-interactive or service environments; consider using getpass.getuser() for improved robustness.

Suggested change
MANIFOLD_FOLDER, f"{os.getlogin()}_{str(uuid.uuid4())}_{file_name}"
MANIFOLD_FOLDER, f"{getpass.getuser()}_{str(uuid.uuid4())}_{file_name}"

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants