-
Notifications
You must be signed in to change notification settings - Fork 535
bertpass_gpu.cc does not support MXNet 1.8 #1388
Comments
Thanks @leezu. The custom pass in https://github.com/dmlc/gluon-nlp/blob/v0.10.x/scripts/bert/bertpass_gpu.cc uses some custom code that @MoisesHer and I worked on post-1.7.0 release that eventually became the default in 1.8.0. Thanks to this collaboration, in 1.8 all lines 30-248 have been integration into lib_api.h so they can be removed from bertpass_gpu.cc. Plus, we eliminated the extra step of taking the symbol_json string and converting it to a graph object in gluon-nlp/scripts/bert/bertpass_gpu.cc Lines 251 to 262 in 3fbe961
So now the API will be simplified to: https://github.com/apache/incubator-mxnet/blob/cc4b8ec68b6ec9dae73046e9c34ac97439efda83/example/extensions/lib_pass/pass_lib.cc#L34-L35
So little things like changing how you loop over the nodes in the graph from: gluon-nlp/scripts/bert/bertpass_gpu.cc Line 266 in 3fbe961
will need to be changed to: https://github.com/apache/incubator-mxnet/blob/cc4b8ec68b6ec9dae73046e9c34ac97439efda83/example/extensions/lib_subgraph/subgraph_lib.cc#L308-L309
And creating new nodes from: gluon-nlp/scripts/bert/bertpass_gpu.cc Line 280 in 3fbe961
to: https://github.com/apache/incubator-mxnet/blob/cc4b8ec68b6ec9dae73046e9c34ac97439efda83/example/extensions/lib_subgraph/subgraph_lib.cc#L315
Mostly just little things like this. But this should be a lot of change for the better. |
I think it would be ideal to use preprocessor |
thanks for checking this. I will make the modifications as suggested to support both MXNet 1.7 & 1.8 |
Due to API change apache/mxnet#19135
The text was updated successfully, but these errors were encountered: