714.cpython_r
SPEC CPU®2026 Benchmark Description

Benchmark Name

714.cpython_r

Benchmark Program General Category

Language Interpreters

Benchmark Authors

Python Community

Python Software Foundation

Benchmark Description

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability. Python is dynamically type-checked and garbage-collected.

CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the Python language. CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecode before interpreting it.

The CPython interpreter in the SPEC CPU benchmark is built with statically linked modules, which bound the interpreter to only handle pure python inputs. Some pieces are not included, particularly _ctypes/libffi.

Input Description

There are two input scripts used for the workloads. Both are pure python.

  1. coreml_pb.py: Exercises deserialization/serialization which imports the protobuf module. The exercised protobuf messages are from CoreML models, which are processed to characterize the layers, nodes, weights in each neural network model.
  2. dna_bench.py: Genomics analysis flow pieced together from "fasta" and "knucleotide" algorithms defined by the Computer Language Benchmarks Game. Both of those original algorithms are I/O heavy - fasta writes lots of text, and knucleotide reads that text output from fasta. In SPEC CPU these two are conjoined through memory buffers, which eliminates communication through disk I/O.

In refrate, the benchmark does the following:

      cpython.exe -I -B coreml_pb.py -i 2 -a -m Resnet50Headless.mlmodel
      cpython.exe -I -B coreml_pb.py -i 5 -a -c -m MobileNetV2.mlmodel
      cpython.exe -I -B dna_bench.py 600000
The -I option is used to isolate Python from the user's environment. The -B option is used to suppress Python from writing bytecode caches, which saves disk I/O and prevents interference with subsequent workloads. The dna_bench.py script only takes a single parameter, which specifies how many sequences the fasta algorithm should generate. The coreml_pb.py script accepts several arguments:

A savvy user can create their own workloads by changing the parameters in the scripts above; for example increasing runtime through raising the iteration counts for coreml_pb.py or the sequence counts for dna_bench.py. Larger CoreML models could also increase memory consumption and runtime. Alternatively, alternative python benchmarks could produce a variety of new behaviors.

Output Description

For coreml_pb.py, the output is a text file containing extracted information from the input ML model involving traversing the graph of layers (the name and the number of occurrences of the different layers, the length of the graph, the layer containing the maximum number of weights, corresponding number of weights and weights close to zero - epsilon weights) as well as the size of the resulting serialized message.

        model type: neuralNetwork
        Nb layers: 174
        Counter({'convolution': 53, 'batchnorm': 53, 'activation': 49, 'add': 16, 'pooling': 2, 'padding': 1})
        Several candidate layers for max number of weights 2359296: res5a_branch2b res5b_branch2b res5c_branch2b

        res5a_branch2b - max number of weights
        res5a_branch2b Number of weights: 2359296
        res5a_branch2b Number of epsilon weights: 16549 - 0.701%
        Serialized Resnet50Headless.mlmodel - size (B): 94367931
          

For dna_bench.py, the output file contains the knucleotide analysis of the combined output sequences which were generated by fasta. The first sections of the file show the percentages of each nucleotide sequence of a single character or {2, 3, 4}-character sequences. The final output is the number of hits for a particular sub-sequence, or how many times it is found in the conglomerate fasta sequence.

        A 27.447
        T 25.927
        G 19.391
        C 18.434

        AA 7.909
        AT 7.126
        TA 7.057
        TT 6.971
        AG 5.363
        ...
        ...
        5093    CTTGAA
        4181    GAGACTCCGT
      
The validation consists in comparing the displayed text a reference result, without any tolerance.

Programming Language

Threading Model

The benchmark is single-threaded.

Known Portability Issues

Pthread stubs are used to avoid dependencies to a threading library. On some systems, these stubs might not be compatible with system libraries. It's possible to de-activate pthread stubs with -UHAVE_PTHREAD_STUBS.

Sources and Licensing

Based on cpython v3.12.0.

cpython is licensed under the Python Software Foundation License: LICENSE-cpython.txt, and we acknowledge the long list of authors: cpython.authors.txt.

fasta.py and knucleotide.py are algorithms from the Computer Language Benchmarks Game: LICENSE-bmgame.txt. These were originally written in Lua by Mike Pall and made available by him without restriction to The Computer Language Benchmarks Game gitlab repository, and distributed under a BSD license. The Lua versions were converted to Python by SPEC, adding dna_bench.py to combine them into a single flow.

References

Copyright © 2026 Standard Performance Evaluation Corporation (SPEC®)