We give parallel algorithms for string diagrams represented as structured cospans of ACSets. Specifically, we give linear (sequential) and logarithmic (parallel) time algorithms for composition, tensor product, construction of diagrams from arbitrary $\Sigma$-terms, and application of functors to diagrams. Our datastructure can represent morphisms of both the free symmetric monoidal category over an arbitrary signature as well as those with a chosen Special Frobenius structure. We show how this additional (hypergraph) structure can be used to map diagrams to diagrams of optics. This leads to a case study in which we define an algorithm for efficiently computing symbolic representations of gradient-based learners based on reverse derivatives. The work we present here is intended to be useful as a general purpose datastructure. Implementation requires only integer arrays and well-known algorithms, and is data-parallel by constuction. We therefore expect it to be applicable to a wide variety of settings, including embedded and parallel hardware and low-level languages.
翻译:我们为表示为ACSets结构化余幅图的字符串图提出了并行算法。具体而言,针对组合运算、张量积运算、由任意$\Sigma-项构造图、以及函子应用于图等操作,分别给出了线性时间(串行)和对数时间(并行)算法。我们的数据结构既能表示任意签名上自由对称幺半范畴中的态射,也能表示带有特定特殊弗罗贝尼乌斯结构的态射。我们展示了如何利用这种附加(超图)结构将图映射为光学图,由此引出案例研究:定义基于反向导数的梯度学习器符号表示的高效算法。本文提出的工作旨在作为通用数据结构,其实现仅需整数数组和经典算法,且通过构造实现数据并行。因此,我们预期该成果可广泛应用于嵌入式系统、并行硬件及低级语言等多种场景。