Papers › Benchmarking the Linear Algebra Awareness of TensorFlow and PyTorch

Benchmarking the Linear Algebra Awareness of TensorFlow and PyTorch

20 Feb 2022arXiv:2202.09888archive 2025-07-28

Aravind Sankaran, Navid Akbari Alashti, Christos Psarras, Paolo Bientinesi

Linear algebra operations, which are ubiquitous in machine learning, form major performance bottlenecks. The High-Performance Computing community invests significant effort in the development of architecture-specific optimized kernels, such as those provided by the BLAS and LAPACK libraries, to speed up linear algebra operations. However, end users are progressively less likely to go through the error prone and time-consuming process of directly using said kernels; instead, frameworks such as TensorFlow (TF) and PyTorch (PyT), which facilitate the development of machine learning applications, are becoming more and more popular. Although such frameworks link to BLAS and LAPACK, it is not clear whether or not they make use of linear algebra knowledge to speed up computations. For this reason, in this paper we develop benchmarks to investigate the linear algebra optimization capabilities of TF and PyT. Our analyses reveal that a number of linear algebra optimizations are still missing; for instance, reducing the number of scalar operations by applying the distributive law, and automatically identifying the optimal parenthesization of a matrix chain. In this work, we focus on linear algebra computations in TF and PyT; we both expose opportunities for performance enhancement to the benefit of the developers of the frameworks and provide end users with guidelines on how to achieve performance gains.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2202.09888")

Code

Syntology Ran 0 of 19 code samples harvested from 2 repositories linked to this paper; 19 have no recorded run.

By repository: official repository: 18 samples from 1 repository, 0 ran; community (archive-listed): 1 sample from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

as641651/linearalgebra-awareness-benchmark officialmentioned in papertfMIT report
chrispsa/lamp_benchmark mentioned on GitHubpytorchBSD-3-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 0 ran; 0 honoured the contract we drafted; 19 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

19unverified

Licence: 0 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

format_cutoff_results_md as641651/linearalgebra-awareness-benchmark/laab_python/prepare_report.py official repository unverified MIT (permissive) · 22a6a516d56403ba · report
format_floats_recursive as641651/linearalgebra-awareness-benchmark/laab_python/prepare_report.py official repository unverified MIT (permissive) · 126ee0390b236079 · report
linalg_matmul as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_blocked.py official repository unverified MIT (permissive) · c5b298b754b9fb33 · report
operator as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_blocked.py official repository unverified MIT (permissive) · 227aac16367e955a · report
ref_negative as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_distributivity1.py official repository unverified MIT (permissive) · 16e19eafa21d1903 · report
ref_negative as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_distributivity2.py official repository unverified MIT (permissive) · 2d2a55983a86dae7 · report
ref_negative as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_transpose.py official repository unverified MIT (permissive) · 5d516c141faae762 · report
ref_negative as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cm_partial_op_prod.py official repository unverified MIT (permissive) · 953e2ef4ffaf77b2 · report
ref_negative as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cm_partial_op_sum.py official repository unverified MIT (permissive) · 11d2511028f02081 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_blocked.py official repository unverified MIT (permissive) · 36b39fcbf80f56e4 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_distributivity1.py official repository unverified MIT (permissive) · 1529084dacf58e68 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_distributivity2.py official repository unverified MIT (permissive) · c73ed459f46b94af · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/am_transpose.py official repository unverified MIT (permissive) · 54d5a84e0d761703 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cm_loops.py official repository unverified MIT (permissive) · 40c15acbfeef17da · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cm_partial_op_prod.py official repository unverified MIT (permissive) · d792bafba67d2899 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cm_partial_op_sum.py official repository unverified MIT (permissive) · 191ebcca1eb39dd6 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cse_addition.py official repository unverified MIT (permissive) · ef0d2ee2886a35a8 · report
ref_positive as641651/linearalgebra-awareness-benchmark/laab_python/src/PyTorch/v2-cpu/cse_matmul_no_paranthesis.py official repository unverified MIT (permissive) · bf7659c80bf0ef0b · report
benchmark chrispsa/lamp_benchmark/python/numpy/benchmarker.py community (archive-listed) unverified BSD-3-Clause (permissive) · 5f6adb6e03177270 · report

Tasks

Benchmarking

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SPEED

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections