Bridging Operator Semantic Inconsistencies: A Source-Level Cross-Framework Model Conversion Approach
Open Access
- 19 June 2025
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Software Engineering
- Vol. 2 (FSE) , 2030-2052
Abstract
As deep learning (DL) frameworks become widely used, converting models between frameworks is crucial for ecosystem flexibility. However, interestingly, existing model converters commonly focus on syntactic operator API mapping—transpiling operator names and parameters—which results in API compatibility issues (i.e., incompatible parameters, missing operators). These issues arise from semantic inconsistencies due to differences in operator implementation, causing conversion failure or performance degradation. In this paper, we present the first comprehensive study on operator semantic inconsistencies through API mapping analysis and framework source code inspection, revealing that 47% of sampled operators exhibit inconsistencies across DL frameworks, with source code limited to individual layers and no inter-layer interactions. This suggests that layer-wise source code alignment is feasible. Based on this, we propose ModelX, a source-level cross-framework conversion approach that extends operator API mapping by addressing semantic inconsistencies beyond the API level. Experiments on PyTorch-to-Paddle conversion show that ModelX successfully converts 624 out of 686 sampled operators and outperforms two state-of-the-art converters and three popular large language models. Moreover, ModelX achieves minimal metric gaps (avg. all under 3.4%) across 52 models from vision, text, and audio tasks, indicating strong robustness.Keywords
Funding Information
- National Natural Science Foundation of China (No. 62272473, No.U2441238, No.62202474)
- The science and technology innovation Program of Hunan Province (No.2023RC1001, No.2023RC3012)
This publication has 39 references indexed in Scilit:
- Challenges and practices of deep learning model reengineering: A case study on computer visionEmpirical Software Engineering, 2024
- A Dual Attention Network for Multimodal Remote Sensing Image Matching2023
- Fuzzing Automatic Differentiation in Deep-Learning Libraries2023
- Huawei MindSpore AI Development Framework2022
- An Empirical Study of Challenges in Converting Deep Learning Models2022
- Jittor: a novel deep learning framework with meta-operators and unified graph executionScience China Information Sciences, 2020
- A Directed Acyclic Graph Network Combined With CNN and LSTM for Remaining Useful Life PredictionIEEE Access, 2019
- Exact String Matching Algorithms: Survey, Issues, and Future Research DirectionsIEEE Access, 2019
- ImageNet: A large-scale hierarchical image database2009
- Object Recognition with Features Inspired by Visual Cortex2005