-
Notifications
You must be signed in to change notification settings - Fork 257
Add profiler and Perfetto UI link with comprehensive tests #1995
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1995
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit 8ef520b with merge base 70fc520 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Pull Request Overview
This PR adds profiler support and a Perfetto UI link to the benchmark utilities along with comprehensive tests to validate the functionality. Key changes include:
- New utility functions for uploading trace files, generating Perfetto UI URLs, and generating both model and memory profiling data.
- Enhancements to the BenchmarkConfig and benchmark runner to support profiler and memory profiling, with corresponding tests.
- Updates to the configuration YAML to enable profiling for selected models.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
benchmarks/microbenchmarks/utils.py | Added functions upload_trace_file, print_perfetto_ui_url, generate_model_profile, and generate_memory_profile; updated BenchmarkConfig to include profiler settings. |
benchmarks/microbenchmarks/test/test_benchmark_profiler.py | Added comprehensive tests for profiler functionality on both CPU and CUDA devices. |
benchmarks/microbenchmarks/test/benchmark_config.yml | Updated YAML to enable profiler and memory profiling for selected models. |
benchmarks/microbenchmarks/benchmark_runner.py | Improved error handling in benchmark execution and CSV/result generation. |
benchmarks/microbenchmarks/benchmark_inference.py | Wrapped profiler and memory profiling execution in try/except blocks and refined model compilation formatting. |
Comments suppressed due to low confidence (1)
benchmarks/microbenchmarks/utils.py:243
- Usage of the private API torch.cuda.memory._record_memory_history may lead to breakage in future PyTorch releases; consider switching to a supported public API if one is available.
torch.cuda.memory._record_memory_history(True, trace_alloc_max_entries=250000, trace_alloc_record_context=True)
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}" |
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.
os.getlogin() may raise an OSError in non-interactive environments; consider using getpass.getuser() for improved reliability.
MANIFOLD_FOLDER, f"{os.getlogin()}_{str(uuid.uuid4())}_{file_name}" | |
MANIFOLD_FOLDER, f"{getpass.getuser()}_{str(uuid.uuid4())}_{file_name}" |
Copilot uses AI. Check for mistakes.
This PR adds profiler support and Perfetto UI link with comprehensive tests.