-
Notifications
You must be signed in to change notification settings - Fork 24.2k
[nativert] move recordfunction #153088
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
[nativert] move recordfunction #153088
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153088
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 Cancelled Job, 1 Unrelated FailureAs of commit 0066a93 with merge base 0104ac0 ( CANCELLED JOB - The following job was cancelled. Please retry:
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: D74284301 |
Summary: nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
Summary: nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D74284301 |
Summary: Pull Request resolved: pytorch#153088 nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
Summary: Pull Request resolved: pytorch#153088 nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
Summary: nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
Summary: Pull Request resolved: pytorch#153088 nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
@Skylion007 this diff doesn't touch torch/nativert :) |
@@ -24,4 +26,29 @@ TORCH_API c10::intrusive_ptr<c10::ivalue::Future> _call_end_callbacks_on_fut_new | |||
const c10::intrusive_ptr<PythonRecordFunction>& record, | |||
const c10::intrusive_ptr<c10::ivalue::Future>& fut); | |||
|
|||
/** | |||
* RAII wrapper that behaves similarly to torch.profiler.record_function. |
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.
The profiler API doesn't have such API already?
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.
not that I could find.
/** | ||
* RAII wrapper that behaves similarly to torch.profiler.record_function. | ||
*/ | ||
class RecordFunction { |
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.
Isn't this part of libtorch_python? Would nativert depend on libtorch-only or libtorch_python?
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.
looks like a part of libtorch_core so I think we should be fine.
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.
Ok, let's add a test to make sure all of this behave as expected
class RecordFunction { | ||
public: | ||
RecordFunction() = delete; | ||
RecordFunction(const RecordFunction&) = default; |
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.
These move and copy constructors should be delete
.
Summary: nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
Summary: Pull Request resolved: pytorch#153088 nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Differential Revision: D74284301
This pull request was exported from Phabricator. Differential Revision: D74284301 |
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
Merge failedReason: Approvers from one of the following sets are needed:
|
Merged internally but no valid OSS approval, closing this PR and jedi unlanding D74284301 |
Summary: nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed. This diff moves the our function-recording raii wrapper into record_function_ops Test Plan: CI Reviewed By: zhxchen17 Differential Revision: D74771077
Summary:
nativert RFC: https://github.com/zhxchen17/rfcs/blob/master/RFC-0043-torch-native-runtime.md
To land the runtime into PyTorch core, we will gradually land logical parts of the code into the Github issue and get each piece properly reviewed.
This diff moves the our function-recording raii wrapper into record_function_ops
Test Plan: CI
Differential Revision: D74284301