Cross-Model Portability in Computing
- Cross-model portability is the property enabling models, code, or modules to operate correctly and efficiently across different computational architectures and frameworks.
- It employs performance portability metrics like the harmonic and arithmetic means to quantify how well performance is maintained across heterogeneous systems.
- Applications span GPU-accelerated scientific software, ML transfer learning, and quantum algorithm deployment, minimizing redevelopment efforts while preserving key performance characteristics.
Cross-model portability is the property enabling models, code, or optimized modules to function with high fidelity and efficiency across distinct computational, architectural, or software frameworks. The scope encompasses machine learning model transfer across devices or institutions, compiler optimization safety between memory models, performance-portable GPU programming, quantum algorithm transport across library stacks, and symbolic code-based GPU performance modeling. Cross-model portability ensures that advances made for one context or hardware are efficiently leveraged in alternative execution models with minimal redevelopment while preserving correctness and, increasingly, performance.
1. Formal Definitions and Metrics
Portability primarily refers to the functional correctness of executing an application or model across different platforms without changes to source structure; cross-model portability further mandates preservation of task fidelity or computational semantics when transitioning across models, devices, or frameworks. Performance portability is a quantification of the extent to which high performance is maintained across heterogeneous systems under a unified code- or model-base.
Quantitative metrics for performance portability are harmonized around ratios of achieved performance to a fixed or application-specific baseline, aggregated over target platforms. The two canonical metrics are the harmonic mean (Pennycook metric) and the arithmetic mean (Marowka revision):
$\ppmetric_1(\alpha, \varphi, \mathcal H) = \frac{|\mathcal H|}{ \sum_{i \in \mathcal H} 1 / r_i } \quad;\quad \ppmetric_2(\alpha, \varphi, \mathcal H) = \frac{1}{|\mathcal H|} \sum_{i \in \mathcal H} r_i$
where for application , problem setup , and architecture set (Villalobos et al., 2 Nov 2025, Davis et al., 2024, Marowka, 2024).
A fully robust metric uses a fixed, hardware-anchored baseline (roofline/empirical peak) or a curated repository value per target, ensuring monotonicity, consistency, and comparability over time.
2. Portability in GPU-Accelerated Scientific Software
Compiler directive-based programming models (OpenMP, OpenACC) and C++ abstraction frameworks (Kokkos, RAJA, SYCL) provide varying degrees of source and performance portability across hardware such as NVIDIA, AMD, and Intel GPUs. Directives allow high-level offloading of parallel code to accelerators; abstraction frameworks encapsulate back-end details, dispatching platform-specific kernels.
Reverse-porting techniques, such as translating device-tuned CUDA/HIP kernels into OpenMP target regions, highlight the structural changes required—removing explicit warp intrinsics, expressing reductions via directives, and restructuring barrier semantics. Empirical studies show that with mature compilers (e.g., CCE or AOMP for AMD MI100), directive-based code can reach within 1.3× of HIP-tuned baselines, but on NVIDIA V100, OpenMP trails CUDA by 1.5–2× even with aggressive tuning (thread_limit, register count, LTO) (Thavappiragasam et al., 2022).
Kokkos-based codes dispatched via hierarchical parallel patterns (TeamPolicy, team scratch memory), supplemented by autotuning of (teamSize, vectorLength), demonstrate robust scaling up to 2048 GPUs and can yield harmonically-averaged portability metrics up to 70%, though kernel memory bandwidth remains the dominant bottleneck (Villalobos et al., 2 Nov 2025). SYCL-based interoperability, as implemented in libraries such as oneMKL, achieves cross-vendor near-native performance for numerical kernels, with runtime selection of vendor libraries and minimal glue code (Pascuzzi et al., 2021).
Autotuning JIT frameworks (e.g., Triton) elaborated extensive, architecture-sensitive kernel optimization spaces. Exhaustive kernel configuration search can yield up to 2.3× speedups over vendor libraries and illustrates that naively reusing parameterizations tuned on one vendor (e.g., A100 MI250) leads to severe degradations (up to 14× slowdown), emphasizing that configuration space must be revisited per target architecture (Ringlein et al., 30 Apr 2025).
| Programming Model | Performance Portability (PP) | Platform Coverage |
|---|---|---|
| SYCL | 0.90–0.98 | NVIDIA & AMD GPUs |
| Kokkos/RAJA | 0.80–0.95 | NVIDIA & AMD GPUs |
| OpenMP/OpenACC | 0.50–0.85 | Platform/Compiler-specific |
| CUDA/HIP | 1.0 (native dual-port) | Single vendor |
3. Machine Learning and Domain Transfer
Cross-model portability for learned models addresses whether a neural architecture trained or fine-tuned on one device, dataset, or institutional corpus maintains performance when applied or adapted to another. Direct application of trained classifiers in non-identical domains (e.g., different smart device units or clinical sites) is typically unsuccessful: baseline accuracy often falls below 20%. However, transfer learning approaches—fine-tuning a small subset of parameters (output layer in MLPs; PEFT parameters in LMs)—yield high post-adaptation accuracy, demonstrating that feature extractors capture reusable representations.
For parameter-efficient finetuning (PEFT) modules (adapters, LoRA, prefix-tuning, compacter), portability across pretrained LMs is formalized as the improvement in transferred module accuracy compared to random-initialized or scratch-trained modules. Adapters show the highest cross-model portability (up to 0.93 accuracy vs. 0.78–0.79 for the baselines), especially when source and target share architectural compatibility and task, and after 500–1000 adaptation steps (Sabry et al., 2024).
In electromagnetic side-channel analysis, freezing early MLP layers and retraining only the task head on new device data achieves up to 98% accuracy post-transfer. Domain shift between devices, evidenced by disjoint PCA clusters, is mitigated by adapting only the conditional output mapping, retaining low-level feature representations. For model deployment in digital forensics, the consensus is to always collect a small labeled set on the new device and transfer-train only the output (Navanesana et al., 2023).
Cross-site hospital readmission risk models exhibit analogous dynamics. Born-Again Network (BAN) distillation leverages the output distribution of a teacher network trained at the source site as soft targets for a student model retrained at the destination. This transfer closes much of the performance gap, outperforming direct transfer and closely tracking local baselines in AUROC and AUPRC—with only a single retraining pass, and no shared patient data (Nyemba et al., 2022).
4. Portability Across Programming and Memory Models
Compiler optimization safety and transformation portability between concurrency models is resolved by syntactic constraints on transformation effects. For porting optimizations from Sequential Consistency (SC) to Total Store Order (TSO), the sufficiency criterion is to avoid both introduction and elimination of writes and to rule out a specific "triangular race" write–read inlining pattern. Any transformation satisfying these constraints and proved SC-safe is also TSO-safe, providing a single-policy global guarantee.
In formal terms, portability is retained if the effect neither adds nor removes writes and does not satisfy the TSO-unsafe write–read inlining pattern; the pattern is explicitly defined by a set of program order and event relations among threads and memory locations (Gopalakrishnan et al., 24 Apr 2025). Extension to the Strong Release Acquire (SRA) model is achieved by relaxing TSO constraints further; SRA accepts all SC-safe transformations except those introducing write elimination or creation.
5. Black-Box Performance Modeling and Abstraction Strategies
Symbolic black-box modeling approaches enable the construction and calibration of analytical or empirical performance models, portable across GPU architectures. Given a high-level kernel representation, the number of performance-critical operations (FLOPs, loads, stores, barriers) is automatically extracted, and execution time is modeled by a weighted sum or nonlinear cost function, with device-specific weights learned via microbenchmark calibration (Stevens et al., 2019). The result is a cost-explanatory model, readily transplantable to any target OpenCL device, and with error rates typically 8% for a range of linear algebra and stencil kernels.
In quantum software, empirical evidence shows that highly abstract mathematical formulations (e.g., QUBO for optimization, variational circuit ansatz for RL) function as natural portability substrates. Transitioning between frameworks (Qiskit, Pennylane, TFQ, Ocean) is readily accomplished via concise translation layers per framework, usually requiring only minor API substitutions. Pursuing maximal abstraction ("piling on") via an intermediate representation often adds complexity without measurable reduction in porting effort, given that quantum-specific code rarely exceeds 500 lines (Schönberger et al., 2022).
6. Practical Guidelines and Recommendations
- Favor abstraction frameworks (SYCL, Kokkos, RAJA) for robust source and performance portability in heterogeneous accelerator environments, but profile and autotune critical kernels per target.
- Use transfer learning for ML model portability: freeze feature extraction layers, retrain heads, or distil soft targets; always validate on small, labeled target-domain samples.
- For compiler optimizations, enforce syntactic safeguards (no new writes/eliminations, no triangular write–read inlining) to guarantee memory model portability.
- Adopt fixed, hardware-anchored or curatorial repository baselines for per-platform efficiency metrics, and aggregate via mean (arithmetic or harmonic) to yield robust, monotonic performance-portability measures (Marowka, 2024).
- In quantum and code-centric domains, minimize code complexity and porting effort by expressing algorithms in their canonical mathematical form and employing thin, framework-specific glue.
Cross-model portability is thus achievable in a range of computational domains, but necessitates principled structuring of source and abstraction boundaries, comprehension of domain-specific model shift, adherence to rigorous evaluation metrics, and platform-tuned optimization strategies.