You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PartitionModel function => add another abstract partition interface to support user-specific features( such as partition between same type device )
#10422
PartitionModel function => add another abstract partition interface to support user-specific features( such as partition model between same type device to enable parallelism )
for the following function ,maybe it's good to provide an abstract interface for user to make a specific device partition
int Compilation::PartitionModel(
Context* context,
Model* model,
std::vector<std::pair<
Context::DeviceContext*,
std::tuple<core::Model*, bool, std::vector<int>, std::vector<int>>>>*
models) {
...
for (auto& operation : model->model_.operations) {
if (_flags_[operation_index] && !flags[operation_index]) { <----- here may be provide another abstraction for user specificed partition and all way down into other revelant code (such as user specificed ModelPartitioner)
flags[operation_index] = true;
// Only the operations which are not supported by the previous devices
// are added.
supported_operations[i].second.insert(&operation);
}
operation_index++;
}
// For example we have <model> as follows:
// conv2d_0 conv2d_1
// | |
// batch_norm_0 batch_norm_1
// | |
// relu_0 relu_1
// \ /
// \ /
// leave out ops(such as operator)
// and two devices with support operators listed
// <device_id=0, [conv2d_0,batch_norm_0,relu_0, conv2d_1,batch_norm_1,relu_1]>
// <device_id=1, [conv2d_0,batch_norm_0,relu_0, conv2d_1,batch_norm_1,relu_1]>
// we need to use a interface to partition the model into devices as follows
// <device_id=0, {[conv2d_0,batch_norm_0,relu_0], false, [...], [...]}>>
// <device_id=1, {[conv2d_1,batch_norm_1,relu_1], false, [...], [...]>>
PartitionModel function => add another abstract partition interface to support user-specific features( such as partition model between same type device to enable parallelism )
for the following function ,maybe it's good to provide an abstract interface for user to make a specific device partition
int Compilation::PartitionModel(
Context* context,
Model* model,
std::vector<std::pair<
Context::DeviceContext*,
std::tuple<core::Model*, bool, std::vector<int>, std::vector<int>>>>*
models) {
...
for (auto& operation : model->model_.operations) {
if (_flags_[operation_index] && !flags[operation_index]) { <----- here may be provide another abstraction for user specificed partition and all way down into other revelant code (such as user specificed ModelPartitioner)
flags[operation_index] = true;
// Only the operations which are not supported by the previous devices
// are added.
supported_operations[i].second.insert(&operation);
}
operation_index++;
}
// For example we have <model> as follows:
// conv2d_0 conv2d_1
// | |
// batch_norm_0 batch_norm_1
// | |
// relu_0 relu_1
// \ /
// \ /
// leave out ops(such as operator)
// and two devices with support operators listed
// <device_id=0, [conv2d_0,batch_norm_0,relu_0, conv2d_1,batch_norm_1,relu_1]>
// <device_id=1, [conv2d_0,batch_norm_0,relu_0, conv2d_1,batch_norm_1,relu_1]>
// we need to use a interface to partition the model into devices as follows
// <device_id=0, {[conv2d_0,batch_norm_0,relu_0], false, [...], [...]}>>
// <device_id=1, {[conv2d_1,batch_norm_1,relu_1], false, [...], [...]>>
PartitionModel function => add another abstract partition interface to support user-specific features( such as partition model between same type device to enable parallelism )
for the following function ,maybe it's good to provide an abstract interface for user to make a specific device partition
1)Paddle Lite 版本:3c61295 (https://github.com/PaddlePaddle/Paddle-Lite/blob/3c61295edf66eb5c24e7c98b604c14a1bd4457d7/lite/backends/nnadapter/nnadapter/src/runtime/compilation.cc#L380C1-L386C18)
2)Host 环境:Not Revelant
3)预测后端信息:Not Revelant
The text was updated successfully, but these errors were encountered: