-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[Profiler] Add GC Events to Python Stack Tracer #161209
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161209
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 270799a with merge base 97200c9 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
176b156 to
ffa8be9
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
ffa8be9 to
0958fa2
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
0958fa2 to
f263a4f
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
f263a4f to
be278e5
Compare
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
be278e5 to
f3e0ffc
Compare
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
f3e0ffc to
05691e3
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Pull Request resolved: pytorch#161209 Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
05691e3 to
e8b672d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Pull Request resolved: pytorch#161209 Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
e8b672d to
dcb7d62
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Pull Request resolved: pytorch#161209 Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
b9d10a8 to
6d3272e
Compare
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Pull Request resolved: pytorch#161209 Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
6d3272e to
8a75c61
Compare
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
8a75c61 to
fcf2d55
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Pull Request resolved: pytorch#161209 Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
fcf2d55 to
779f562
Compare
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
779f562 to
3980f7e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Future Work: Add more metadata to the GC event Test Plan: Ran trace with GC induced and saw it on trace. https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2Fdevgpu003.rva5.facebook.com%2Frank-0.Aug_21_13_52_27.3127794.pt.trace.json.gz&bucket=gpu_traces Also added a test Rollback Plan: Reviewed By: ngimel Differential Revision: D80491146
3980f7e to
270799a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D80491146 |
|
@pytorchmergebot merge |
Merge startedYour 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 |
Summary: Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL. Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on! Test Plan: Ran trace with GC induced and saw it on trace Also added a test Rollback Plan: Differential Revision: D80491146 Pull Request resolved: pytorch#161209 Approved by: https://github.com/ngimel
Summary:
Adds Python Garbage Collection to Kineto Traces and Profiler FunctionEvents. Create custom cpp callback in profiler_python.cpp. Then define a python function with cpp and register that callback for all python garbage collection. We don't worry about thread safety in this case because we are only doing init/teardown for main thread while holding GIL.
Currently we are hiding this behind experimental config because python tracing tends to be unstable especially when adding any new feature. If this is found to not add too much overhead we can set this to on by default. NOTE: To enable this you need both with_stack=True and the experimental config on!
Test Plan:
Ran trace with GC induced and saw it on trace
Also added a test
Rollback Plan:
Differential Revision: D80491146