Proto merging principles
Figure 1 shows the merging principles.
- AMCT is short for the Ascend Model Compression Toolkit.
- ATC is short for the Ascend Tensor Compiler.
The .proto files are described as follows:
- custom.proto: custom .proto file.
- amct_custom.proto: AMCT .proto file, including the AMCT custom layers and updated layers of Caffe-master compared with Caffe 1.0.
- caffe.proto: ATC .proto file, including the ATC custom layers and updated layers compared with Caffe 1.0, with layer sequence numbers updated. This file is incorporated into the AMCT package.
The merging workflow and principles are described as follows:
- Prepare the custom.proto file and run the install.py script provided by AMCT. The script merges the custom.proto file with the amct_custom.proto file to generate a temporary custom.proto file.
- If custom.proto and amct_custom.proto have the same operator sequence numbers, an error is reported, prompting the user to change the operator sequence number in custom.proto.
- If custom.proto and amct_custom.proto have the same operator names, an error is reported, prompting the user to change the operator name in custom.proto.
- Merge the generated temporary custom.proto file with caffe.proto in the ATC runfile to generate the final caffe.proto file.
- If custom.proto and caffe.proto have the same operator sequence numbers, an error is reported, prompting the user to change the operator sequence number in custom.proto.
- If custom.proto and caffe.proto have the same operator names, the duplicate operator in custom.proto is retained while the duplicate operator in caffe.proto is removed.
- Find the caffe.proto file in the Caffe project according to the caffe_dir directory specified by the user, and then back up and replace it.
- The layers in amct_custom.proto are numbered starting at 200000.
- The sequence numbers of the ATC custom layers in caffe.proto are within the range [5000, 200000).
- The sequence numbers of the ATC custom layers in custom.proto must be less than 5000, and must avoid conflict with those of the built-in layers in the ATC caffe.proto file.
Parent topic: See Also
