Abstract: Convolutional neural network compilers for programmable functional array processors are provided. One such compiler involves a method for fitting a convolutional neural network (CNN) to a CNN processor to be performed by a compiler, the method comprising: receiving a CNN; converting the CNN into a CNN graph; converting the CNN graph into a memory graph comprising graph primitives corresponding to a plurality of components of the CNN processor including a primary memory; performing a memory analysis to determine an amount of memory required in the primary memory for at least one of the graph primitives; identifying a plurality of tokens within the memory graph to form a token graph, each of the plurality of tokens comprising one or more of the graph primitives; and generating, using the plurality of identified tokens, configuration settings for each of the plurality of components of the CNN processor.