-
Couldn't load subscription status.
- Fork 701
Enable network sharing in torch_glow #4235
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
5543d29 to
f3a4fc9
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
f3a4fc9 to
2b8a955
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
2b8a955 to
2c59940
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
Summary: HashNode and CompareNode are useful functions for hanlding jit::Node. This is to unblock pytorch/glow#4235. Pull Request resolved: #34045 Reviewed By: houseroad Differential Revision: D20184733 Pulled By: yinghai fbshipit-source-id: 6c829f2f111a490fd2d85017475c1731cd97fb20
2c59940 to
e52b271
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
e52b271 to
05afd0a
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
05afd0a to
c0a50ca
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
c0a50ca to
48ea2d2
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
48ea2d2 to
7a3454c
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
Summary: Pull Request resolved: pytorch#4235 We will compile and cache the glow fused graph only once, shared across all the module/function from different inference threads. We have a global singleton of CachingGraphRunner keyed on the hash of jit::Graph. For each unique jit::Graph, we have one CachingGraphRunner. Then for each shape specifalization of CachingGraphRunner, we have a unique Glow function. Strategy on caching CachingGraphRunner: We will first query by hashing the fused subgraph. If not found, we will query by hashing the node symbol string, which suits the AOT case. Currently, we have to leak the CachingGraphRunner. This is fine for the forseeable future but we probably need more application level (say, predictor) signal to help with this. For example, if the application framework can save an instance of the CachingGraphRunner as a shared_ptr in AOT case and free it when the model is unloaded, we can then use weak_ptr for the graph runner map and hence will make sure everything will release except for an null weak_ptr. Reviewed By: jackm321 Differential Revision: D20174479 fbshipit-source-id: aa0a564700ded2a02c988b2cad535d5a10c6cfb8
7a3454c to
dc5e36d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D20174479 |
|
This pull request has been merged in dadf6f1. |
Summary: HashNode and CompareNode are useful functions for hanlding jit::Node. This is to unblock pytorch/glow#4235. Pull Request resolved: pytorch#34045 Reviewed By: houseroad Differential Revision: D20184733 Pulled By: yinghai fbshipit-source-id: 6c829f2f111a490fd2d85017475c1731cd97fb20
Summary: Pull Request resolved: pytorch#4235 We will compile and cache the glow fused graph only once, shared across all the module/function from different inference threads. We have a global singleton of CachingGraphRunner keyed on the hash of jit::Graph. For each unique jit::Graph, we have one CachingGraphRunner. Then for each shape specifalization of CachingGraphRunner, we have a unique Glow function. Strategy on caching CachingGraphRunner: We will first query by hashing the fused subgraph. If not found, we will query by hashing the node symbol string, which suits the AOT case. Currently, we have to leak the CachingGraphRunner. This is fine for the forseeable future but we probably need more application level (say, predictor) signal to help with this. For example, if the application framework can save an instance of the CachingGraphRunner as a shared_ptr in AOT case and free it when the model is unloaded, we can then use weak_ptr for the graph runner map and hence will make sure everything will release except for an null weak_ptr. Reviewed By: jackm321 Differential Revision: D20174479 fbshipit-source-id: 0c18880fe80c3ad72c9cad3010479fd7a8c2b9d6
Summary:
We will compile and cache the glow fused graph only once, shared across all the module/function from different inference threads. We have a global singleton of CachingGraphRunner keyed on the hash of jit::Graph. For each unique jit::Graph, we have one CachingGraphRunner. Then for each shape specifalization of CachingGraphRunner, we have a unique Glow function.
Strategy on caching CachingGraphRunner:
We will first query by hashing the fused subgraph. If not found, we will query by hashing the node symbol string, which suits the AOT case. Currently, we have to leak the CachingGraphRunner as I don't have a good idea of where the glow op is going to be destroyed and what hook I can add. This is fine for the forseeable future but we probably need more application level (say, predictor) signal to help with this.
Differential Revision: D20174479