Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Improving Runtime Performance of Tensor Computations using Rust From Python

Technical Report ·
DOI:https://doi.org/10.2172/2999092· OSTI ID:2999092
 [1];  [2]
  1. Sandia National Laboratories (SNL-NM), Albuquerque, NM (United States); New Jersey Institute of Technology (NJIT), Newark, NJ (United States)
  2. Sandia National Laboratories (SNL-NM), Albuquerque, NM (United States)

In this work, we investigate improving the runtime performance of key computational kernels in the Python Tensor Toolbox (pyttb), a package for analyzing tensor data across a wide variety of applications. Recent runtime performance improvements have been demonstrated using Rust, a compiled language, from Python via extension modules leveraging the Python C API—e.g., web applications, data parsing, data validation, etc. Using this same approach, we study the runtime performance of key tensor kernels of increasing complexity, from simple kernels involving sums of products over data accessed through single and nested loops to more advanced tensor multiplication kernels that are key in low-rank tensor decomposition and tensor regression algorithms. In numerical experiments involving synthetically generated tensor data of various sizes and these tensor kernels, we demonstrate consistent improvements in runtime performance when using Rust from Python over 1) using Python alone, 2) using Python and the Numba just-in-time Python compiler (for loop-based kernels), and 3) using the NumPy Python package for scientific computing (for pyttb kernels).

Research Organization:
Sandia National Laboratories (SNL-NM), Albuquerque, NM (United States)
Sponsoring Organization:
USDOE Laboratory Directed Research and Development (LDRD) Program; USDOE National Nuclear Security Administration (NNSA)
DOE Contract Number:
NA0003525
OSTI ID:
2999092
Report Number(s):
SAND--2025-12493R; 1790536
Country of Publication:
United States
Language:
English

Similar Records

PyTrilinos: Recent Advances in the Python Interface to Trilinos
Journal Article · Sat Dec 31 23:00:00 EST 2011 · Scientific Programming · OSTI ID:1068368

Guide to runquic.py Python Script
Technical Report · Thu Apr 27 00:00:00 EDT 2023 · OSTI ID:1972156

C++ Tensor Toolbox User Manual (V.1.0)
Technical Report · Sat Mar 31 20:00:00 EDT 2012 · OSTI ID:1039397

Related Subjects