-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Completely remove FutureMessage type #50029
Conversation
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit fccd346 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions to the (internal) Dr. CI Users group. This comment has been revised 12 times. |
ghstack-source-id: 07beb5b3c97682ab8218e25ed9947b7a43e13738 Pull Request resolved: #50029
[ghstack-poisoned]
ghstack-source-id: 4ab7002feaf7989018d79b10c55e45455a95de32 Pull Request resolved: #50029
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.
Awesome work! Thanks so much for this undertaking!
And thanks for such a well split stack, it made reviewing it a pleasure!
I left some minor comments sprinkled around, but I'm listing here some broader thoughts that apply to the whole stack. They can all be addressed as follow-up commits.
- Does it make sense to change the
addCallback
method ofivalue::Future
so that it passes a reference to itself as first argument to the callback? This would remove all those times we create, capture and then lock a weak_ptr. This is already what we do in the Python wrapper for ivalue::Future, so it also brings a benefit of API alignment. - There's some mix-up of shared_ptr and intrusive_ptr. I wonder if we should try to consolidate on the latter?
- JitFuture is an alias to ivalue::Future, which I guess was introduced for clarity to better separate it from FutureMessage. Does it make sense now to remove that alias and avoid the extra level of indirection that may hurt readability?
- Futures now are created with type
at::AnyClassType::get()
, although they then only contain Message instances. I know nothing about JIT but is there a way to use a narrower type, both for type safety and readability?
@lw thanks a lot for reviewing!
Yep, this makes sense to me and I can add that. cc @wanchaol please let us know if there are concerns.
Yep, this is on my TODO list
Yep, also added this to my TODOs.
Good point. @wanchaol if we want more explicit IValue type on Message, does it mean we need to make Message an IValue type. Or is there any lighter solutions for custom classes? |
Differential Revision: [D25774915](https://our.internmc.facebook.com/intern/diff/D25774915) [ghstack-poisoned]
Differential Revision: [D25774915](https://our.internmc.facebook.com/intern/diff/D25774915) [ghstack-poisoned]
ghstack-source-id: 67b8cf76dcda356f98fefd1af42d3ece4ac1858c Pull Request resolved: #50029
Micro benchmark results:
|
ci-all tests in #50216 |
Summary: Pull Request resolved: pytorch#50029 Test Plan: buck run mode/opt -c=python.package_style=inplace //caffe2/torch/fb/training_toolkit/examples:ctr_mbl_feed_april_2020 -- local-preset --flow-entitlement pytorch_ftw_gpu --secure-group oncall_pytorch_distributed Before: ``` ... I0107 11:03:10.434000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|total_examples 14000.0 I0107 11:03:10.434000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|window_qps 74.60101318359375 I0107 11:03:10.434000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|lifetime_qps 74.60101318359375 ... I0107 11:05:12.132000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|total_examples 20000.0 I0107 11:05:12.132000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|window_qps 64.0 I0107 11:05:12.132000 3831111 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|lifetime_qps 64.64917755126953 ... ``` After: ``` ... I0107 11:53:03.858000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|total_examples 14000.0 I0107 11:53:03.858000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|window_qps 72.56404876708984 I0107 11:53:03.858000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|lifetime_qps 72.56404876708984 ... I0107 11:54:24.612000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|total_examples 20000.0 I0107 11:54:24.612000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|window_qps 73.07617950439453 I0107 11:54:24.612000 53693 print_publisher.py:23 master ] Publishing batch metrics: qps-qps|lifetime_qps 73.07617950439453 ... ``` Reviewed By: lw Differential Revision: D25774915 Pulled By: mrshenli fbshipit-source-id: 1128c3c2df9d76e36beaf171557da86e82043eb9
Stack from ghstack:
Differential Revision: D25774915