Data-Based, Ranking-Guided, and Stochastic Approximate Logic Optimization of Logic Gate Networks
Data-based and stochastic optimization techniques for logic circuits address the inefficiencies of conventional methods by using reference patterns and acceptance criteria to simplify machine-learning inference circuits, reducing costs and improving performance.
Patent Information
- Application Number
- US19/568587
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Priority Date
- 2025-12-19
- Filing Date
- 2026-03-16
- Publication Date
- 2026-11-26
AI Technical Summary
Conventional logic synthesis methods focus on exact transformations that preserve circuit behavior for every possible input, which is overly restrictive for data-driven machine-learning inference circuits, leading to unnecessary gates, wires, and high inference costs in compute, power, and latency.
Data-based, ranking-guided, and stochastic approximate logic optimization techniques that utilize reference input patterns and acceptance criteria to reduce circuit cost while preserving task-relevant performance, allowing for structural simplification and error correction.
The optimized logic circuits achieve lower aggregate training and validation losses with reduced structural complexity, improving performance and feasibility in resource-constrained environments.
Smart Images

Figure US20260377492A1-D00000_ABST
Abstract
Description
RELATED APPLICATIONS
[0001] This application claims priority to and benefit under 35 U.S.C. § 119 to U.S. Provisional Patent Application No. 63 / 772,342, filed on Mar. 14, 2025, titled “Data-based and Stochastic Logic Simplification of Logic Gate Networks” (DFL0600); U.S. Provisional Patent Application No. 63 / 944,417, filed on Dec. 18, 2025, titled “Approximate Logic Synthesis For Neural Logic Networks” (DFL0601); U.S. Provisional Patent Application No. 63 / 944,435, filed on December 19, 2025, titled “Pattern-Guided Approximate Logic Optimization of Logic Gate Networks” (DFL0602); and U.S. Provisional Patent Application No. 64 / 007,375, filed on Mar. 16, 2026, titled “Data-Based, Ranking-Guided, and Stochastic Approximate Logic Optimization of Logic Gate Networks” (DFL0603), each of which is hereby incorporated by reference in its entirety.
[0002] This application also claims priority to and benefit under 35 U.S.C. § 119 to U.S. Provisional Patent Application No. 63 / 772,329, filed on Mar. 14, 2025, titled “Extended Differentiable Logic Gate Networks” (DFL0100); U.S. Provisional Patent Application No. 64 / 002,139, filed on Mar. 10, 2026, titled “Logic Gate Network Systems, Methods, and Devices” (DFL0101); U.S. Provisional Patent Application No. 63 / 772,334, filed on Mar. 14, 2025, titled “Method for Construction and Synthesis of Efficient Feature Extractors” (DFL0300); U.S. Provisional Patent Application No. 64 / 006,864, filed on March 16, 2026, titled “Systems and Methods for Construction and Implementation of Efficient Feature Extractors” (DFL0301); U.S. Provisional Patent Application No. 63 / 772,339, filed on Mar. 14, 2025, titled “Efficiency Improvements for Training Differentiable Logic Gate Networks” (DFL0400); U.S. Provisional Patent Application No. 63 / 901,796, filed on Oct. 19, 2025, titled “Digital Neural Inference Integrated Circuit with Predominantly Latent Parameterization Circuitry” (DFL0900); and U.S. Provisional Patent Application No. 63 / 927,929, filed on Nov. 30, 2025, titled “Training Apparatus with Integrated Circuits for Training Logic Gate Networks” (DFL1000), each of which is hereby incorporated by reference in its entirety.
[0003] Various embodiments of this application also relate to, can be further understood in the context of, and / or can be combined with embodiments described in U.S. Provisional Patent Application No. 64 / 002,139 filed on Mar. 10, 2026, titled “Logic Gate Network Systems, Methods, and Devices” (DFL0101); U.S. Patent Application No. 19 / 562,751 filed on Mar. 10, 2026, titled “residual initialization for training node networks” (DFL0110); U.S. Patent Application No. 19 / 301,717, filed on Aug. 15, 2025, titled “Logic Gate Networks Generated Using Differentiable Logic Gate Models” (DFL0800); and U.S. Patent Application No. 19 / 392,098, filed on Nov. 17, 2025, titled “Digital Neural Inference Integrated Circuits with Predominantly Latent Parameterization Circuitry” (DFL0920), each of which is hereby incorporated by reference in its entirety.TECHNICAL FIELD
[0004] This application relates to artificial intelligence, machine learning, logic gate networks, and logic synthesis. More particularly, this application relates to simplifying and approximating logic circuits, and the subsequent synthesis and implementation in field-programmable gate arrays or fixed-silicon application-specific integrated circuits.BRIEF DESCRIPTION OF THE DRAWINGS
[0005] FIG. 1 illustrates an example logic circuit optimization system, according to one embodiment.
[0006] FIG. 2 illustrates an example convolutional logic gate network architecture, according to one embodiment.
[0007] FIG. 3 illustrates an example of a trained logic gate network for performing inference tasks, according to various embodiments.
[0008] FIG. 4 illustrates an example ranking-guided approximate logic optimization method for a logic circuit, according to one embodiment.
[0009] FIG. 5 illustrates example candidate topology change examples and acceptance variants for logic circuit optimization, according to one embodiment.
[0010] FIG. 6 illustrates an example data-based stochastic logic simplification method for a logic circuit, according to one embodiment.
[0011] FIG. 7 illustrates an example sub-logic-gate-network don’t-care simplification method for a logic circuit, according to one embodiment.
[0012] FIGS. 8A-B illustrate example plots showing, respectively, area and AIG size, and train and test accuracies, as a function of dropped reference input patterns, according to one embodiment.
[0013] FIG. 9A illustrates an example plot showing test error as a function of AIG size for different evaluation criteria, according to one embodiment.
[0014] FIG. 9B illustrates an example plot showing test error as a function of AIG size for different criteria, including data-augmentation variants, in a larger model, according to one embodiment.
[0015] FIGS. 10A-C illustrate example plots showing the area, train and test errors, and constant and matching signals, as a function of AIG size, according to one embodiment.DETAILED DESCRIPTION
[0016] Machine-learning models are increasingly deployed in inference settings where compute, power, latency, determinism, and verifiability matter as much as raw accuracy. Conventional deep neural networks typically rely on real-valued weights, matrix multiplications, and other dense numeric operations that can impose substantial inference costs in terms of computational cost, memory traffic, power consumption, and end-to-end latency. In some applications, including embedded, industrial, control, data center, mobile, real-time, and other time-constrained environments, these costs may limit model complexity, achievable performance, and / or deployment feasibility.
[0017] Approaches for reducing inference cost include low-precision arithmetic, compression, and implementation of inference functions as logic circuits. However, even when an inference model is represented as a logic gate network, or discretized into a fixed logic circuit after training, the resulting circuit may still contain unnecessary gates, wires, routing burden, depth, power consumption, and / or latency relative to what is needed to obtain acceptable task performance on representative inputs. Moreover, conventional logic synthesis often focuses on exact transformations that preserve circuit behavior for every possible input pattern, which may be overly restrictive for data-driven circuits, including circuits used for machine-learning inference, where quality is measured on representative data rather than exhaustive equivalence over all inputs.
[0018] Accordingly, there remains a need for data-based logic-circuit optimization techniques, including approximate optimization techniques, that can reduce circuit cost while completely preserving, substantially preserving, and / or improving task-relevant performance on representative inputs. In various embodiments, the disclosed techniques optimize a logic circuit using reference input patterns and one or more acceptance criteria tied to quality and / or circuit-cost objectives.
[0019] In some embodiments, an original or initially trained logic circuit is not perfect on a training data set, validation data set, and / or other reference data set, and may exhibit one or more classification errors, non-zero loss, and / or non-zero output deviations before approximate optimization begins. During optimization, a candidate topology change may correct or otherwise resolve one or more preexisting errors in the original or current circuit. In some instances, the candidate topology change may alternatively, or additionally, introduce one or more new errors under different reference input patterns. Accordingly, acceptance of a candidate topology change may be based on an aggregate criterion, such as average loss, total score, validation loss, training loss, accuracy, or another task-relevant metric across a set of reference input patterns, rather than requiring preservation of every individual output value for every reference input pattern. In some embodiments, the resulting optimized logic circuit attains a lower aggregate training loss and / or a lower aggregate validation loss than the original logic circuit, despite structural simplification and despite altering outputs for at least some reference input patterns
[0020] Logic circuits may be viewed as networks of nodes or gates that compute Boolean and / or multi-bit functions. Logic circuits can be represented, for example, as logical expressions, netlists, graph descriptions, hardware-description-language representations, lookup tables, or other circuit descriptions. In some embodiments, a logic circuit subjected to the disclosed optimization and / or simplification processes described herein may have been generated or trained to perform a machine-learning inference task. For example, the logic circuit may have been trained to perform, by way of example and without limitation, classification, control, ranking, sequence processing, generative processing, foundation model processing, regression, or reinforcement-learning policy inference. In some embodiments, the logic circuit is a logic gate network produced by discretizing a differentiable logic model. In other embodiments, the logic circuit is obtained from logic synthesis, heuristic construction, search, distillation, or another design process. In various embodiments, the disclosed optimization and simplification methods may also be used for logic synthesis tasks, including exact or approximate synthesis, simplification, restructuring, and / or optimization of a logic circuit corresponding to exactly executing a prespecified function or approximating a predefined function.
[0021] In various embodiments, the logic circuit comprises combinational logic, sequential logic, or both. By way of example and without limitation, the logic circuit may include logic gates, inverters, multiplexers, lookup tables, adders, counters, flip-flops, latches, registers, delay elements, shift registers, SRAM cells, and / or other state-holding circuit elements. The disclosed optimization techniques may be applied to combinational, sequential, and / or mixed combinational / sequential portions of such logic circuits. In sequential embodiments, a reference input pattern may include one or more input values together with an initial, current, prior, or reset state of the logic circuit, and may, in some embodiments, comprise a temporal sequence of inputs and / or states.
[0022] In some embodiments, the logic circuit subjected to the disclosed optimization is obtained by first training a differentiable logic gate network using a stochastic, mini-batch-based, gradient-based training procedure on data for a machine-learning inference task. For example, batches or mini-batches of training examples may be processed through differentiable relaxations of candidate logic operators, and one or more differentiable parameters may be updated using backpropagation with a gradient-based optimizer, such as stochastic gradient descent, Adam, RMSProp, or another mini-batch optimizer.
[0023] In some embodiments, the training objective and / or training loss is supervised, distillation-based, self-supervised, unsupervised, and / or hybrid. In various embodiments, the training objective may include, by way of example and without limitation, reconstruction objectives, masked-prediction objectives, contrastive objectives, consistency objectives, clustering-based objectives, auto-encoding objectives, likelihood-based objectives, and / or other self-supervised or unsupervised objectives. In some embodiments, the training objective and / or training loss do not rely on externally provided ground-truth labels and instead use targets, constraints, or relationships derived from the input patterns themselves. After training, the differentiable logic gate network may be discretized, hardened, or otherwise converted into a fixed logic circuit or logic gate network that is then subjected to the approximate optimization techniques described herein.
[0024] In some embodiments, after one or more of the approximate optimization iterations described herein, the computing system generates, instantiates, or otherwise obtains a differentiable circuit representation corresponding to the current logic circuit or to a selected portion thereof. In such embodiments, the computing system may continue optimization in the differentiable domain. For example, a fixed logic gate network that has been modified according to one or more accepted candidate topology changes may be represented as a differentiable logic gate network in which one or more currently selected operators, connections, constants, and / or other structural choices are used to initialize corresponding differentiable parameters. In some embodiments, the initialized corresponding differentiable parameters may be initialized such that a currently selected discrete choice is assigned the highest initial score or probability, while one or more alternative choices remain available for gradient-based adjustment. The computing system may then perform one or more additional training iterations on the basis of the same reference input patterns, a different set of reference input patterns, and / or an augmented or newly sampled set of reference input patterns. The additional training iterations may include, for example, forward propagation through differentiable relaxations, backpropagation, and gradient-based updates using a gradient-based optimizer. Moreover, the additional training iterations may include one or more task losses, distillation losses, regularization objectives, score-based objectives, and / or other training objectives. In various embodiments, after differentiable optimization, the resulting circuit representation may again be discretized, hardened, or otherwise converted into a fixed logic circuit or logic gate network, after which one or more additional approximate optimization iterations, logic-synthesis operations, and / or implementation operations may be performed.
[0025] In some embodiments, a computing system receives a description of a logic circuit and a set of reference input patterns representative of intended circuit usage. The reference input patterns may comprise, for example, training data, validation data, held-out data, unlabeled examples, user-provided examples, simulated observations, teacher-labeled examples, and / or inputs sampled from a deployment distribution. In some embodiments, the reference input patterns are created from, expanded by, and / or sampled using a deterministic or stochastic data-generating process, including, by way of example and without limitation, data augmentation, simulation, procedural generation, generation by a teacher model, replay of logged observations, and / or sampling from an empirical or modeled deployment distribution. In some embodiments, the reference input patterns are associated with supervisory information, including ground-truth labels, teacher-model outputs, logits, probabilities, class scores, value estimates, and / or other target output values. The computing system may evaluate candidate topology changes using all of the reference input patterns or at least a portion of the reference input patterns, including subsets, mini-batches, or staged subsets used for screening and later verification.
[0026] In some embodiments, the set of reference input patterns, or one or more subsets thereof used for ranking, evaluation, screening, verification, and / or don’t-care determination, is determined to include important and / or representative patterns. For example, the computing system may identify, score, sample, rank, weight, retain, and / or drop reference input patterns using statistical analysis of available data and / or circuit behavior, including frequency analysis, class-balance analysis, coverage analysis, diversity analysis, clustering, outlier analysis, error analysis, and / or other statistical criteria. In some embodiments, the computing system determines a care set, evaluation subset, and / or retained subset of reference input patterns using machine-learning care set determination methods and / or other care set determination methods, including by sampling, ranking, weighting, pruning, and / or otherwise selecting patterns expected to preserve task-relevant behavior of the logic circuit. Different subsets of important and / or representative reference input patterns may be used for different purposes, including initial ranking, candidate screening, later verification, loss evaluation, and / or defining observed and unobserved patterns for don’t-care-based simplification.
[0027] In various embodiments, a candidate topology change may include a modification to the logic circuit description at the gate, connection, or subcircuit level. By way of example and without limitation, a finite set of candidate topology changes may include any number of candidate topology changes, including, without limitation, removing a gate or connection, disabling a gate or connection, rewiring a connection, adding a gate or connection, replacing a selected gate with a simpler operator, merging two internal signals, replacing an internal signal with a constant value, collapsing or bypassing a node, and / or simplifying a selected sub-logic gate network. In some embodiments, the simpler operator is selected from a set that includes a constant-TRUE operator, a constant-FALSE operator, a direct-connection operator that forwards an input signal, and an inverter operator that inverts an input signal. In some embodiments, multiple candidate topology changes are proposed and jointly evaluated as a combination.
[0028] In some embodiments, candidate topology changes may be selected and / or prioritized using a ranking-guided workflow. For example, the computing system may maintain, in memory, a ranking of candidate topology changes based on one or more evaluation scores computed from at least a portion of the reference input patterns. In some embodiments, the ranking is represented as a list, an array, an unordered set, and / or another data structure in which candidate topology changes are associated with respective evaluation scores and, optionally, metadata, such that candidate-selection order may be determined from the associated scores without requiring a fully sorted representation. The ranking may be initialized by traversing all or a subset of gates, nodes, edges, connections, or other circuit elements and retaining a predetermined number of candidate topology changes having preferred evaluation scores. In some embodiments, candidate topology changes are evaluated asynchronously across multiple processor cores, threads, devices, and / or compute nodes to populate or update the ranking. A candidate topology change selected from the ranking may then be re-evaluated using a larger subset of the reference input patterns, a different subset of the reference input patterns, or all the reference input patterns before the change is incorporated into the description of the logic circuit.
[0029] In some embodiments, candidate topology changes may be selected using a stochastic workflow, which may be used instead of, or in combination with, ranking-guided selection. For example, the computing system may select a target gate, node, circuit element, or connection using a stochastic selection process, optionally excluding trivial functions, and may propose replacement of the selected element with a simpler operator or another modified topology. In some embodiments, the computing system stores a backup of the current function, gate choice, connection state, and / or circuit state before evaluation and restores the prior state if the candidate topology change fails to satisfy an acceptance criterion. In some embodiments, an acceptance threshold is static. In other embodiments, the acceptance threshold is dynamically adjusted during optimization, for example by adjusting a delta parameter when no candidate topology change, or fewer than a threshold number of candidate topology changes, satisfy the acceptance criterion.
[0030] In various embodiments, evaluation of a candidate topology change produces one or more evaluation scores indicative of quality, cost, or both. Quality may be evaluated using, for example, a loss function, an accuracy measure, a divergence measure, a margin-based measure, a score-change measure, unchanged output scores, and / or another task-relevant metric computed from circuit outputs produced for at least a portion of the reference input patterns. Non-limiting examples include cross-entropy loss, Kullback-Leibler (KL) divergence, mean-squared error, L1 loss, validation accuracy, training accuracy, and / or error rate. In some embodiments, the loss function used to evaluate candidate topology changes does not rely on externally provided ground-truth labels and may comprise a self-supervised loss, an unsupervised loss, or another non-label-based objective computed from the reference input patterns. For example, the loss function may comprise, by way of example and without limitation, a reconstruction loss, a masked-prediction loss, a contrastive loss, a consistency loss, a clustering-based loss, an autoencoding loss, and / or a likelihood-based loss.
[0031] In some embodiments, outputs of the logic circuit are aggregated through group-sum operations, popcount operations, bit counters, adders, and / or other arithmetic stages to produce per-class scores. In various embodiments, evaluation may be based on score changes (or other metrics) after such aggregation, rather than merely counting raw bit changes. In some embodiments, the computing system applies one or more offset terms and / or one or more scaling parameters when evaluating candidate topology changes, including embodiments in which offset terms are applied on a per-output basis prior to aggregation, on a per-class or other per-score basis after aggregation, or both, and embodiments in which temperature scaling comprises a single global scaling factor or multiple scaling factors defined on a per-output, per-class, grouped-output, or other output-associated basis.
[0032] In some embodiments, the logic circuit produces grouped outputs that are combined through one or more arithmetic stages, including group sum operations, popcount operations, counters, adders, accumulators, and / or similar aggregation logic, to obtain per-class scores or other grouped output scores. A candidate topology change may be evaluated by determining a net change in a per-class score after such aggregation. For example, multiple bit-level output changes within the same class may partially or fully cancel one another in the arithmetic stage, and the computing system may determine a resulting net score change for each class and accumulate such net score changes across multiple reference input patterns to obtain a score, loss, margin, or other evaluation quantity used in an acceptance criterion. In some embodiments, one or more real-valued per-class offset terms and / or one or more temperature-scaling parameters are selected, calibrated, or updated during optimization to improve an evaluation score computed from the aggregated outputs. Such offset terms and / or temperature-scaling parameters may be used as evaluation parameters for screening or accepting candidate topology changes and need not be realized as logic gates within the optimized logic circuit itself. However, in some embodiments, corresponding post-processing may be implemented outside the logic circuit.
[0033] As described herein, in some embodiments, the logic circuit produces grouped outputs that are combined by one or more arithmetic stages. In such embodiments, the scope of optimization may include the learned or learnable logic that produces the grouped outputs, the arithmetic stages that aggregate the grouped outputs, or both. For example, group sum operations, popcount operations, counters, adders, accumulators, comparators, and / or other aggregation logic may be excluded from approximate synthesis, in some embodiments. In other embodiments, group sum operations, popcount operations, counters, adders, accumulators, comparators, and / or other aggregation logic may be included in approximate synthesis together with the learned logic or optimized separately from the learned logic. In some embodiments, structured arithmetic stages are kept fixed. In other embodiments, such stages are explicitly optimized, converted into ordinary logic before optimization, and / or handled in a separate representation during optimization. In some embodiments, optimization is performed in stages. For example, optimization may include, by way of example, a first stage that optimizes primarily the learned logic, a second stage that optimizes a combined region including learned logic and aggregation logic, and a third stage that optimizes all or part of the aggregation logic after earlier stages have modified the signals presented thereto.
[0034] In some embodiments, candidate topology changes are generated and / or screened using statistics collected by processing the reference input patterns through the logic circuit. For example, the computing system may record internal activation values and identify an internal signal that is constant for at least a threshold fraction of the reference input patterns. For example, the computing system may identify a pair of internal signals that match for at least a threshold fraction of the reference input patterns. Moreover, the computing system may identify a gate or connection whose placement, routing, area, power, or latency cost, or a proxy thereof, exceeds a threshold. In some embodiments, candidate topology changes targeting higher-cost elements are prioritized and / or evaluated under a different acceptance criterion, including a less strict one, than those targeting lower-cost elements.
[0035] In some embodiments, the same or related statistics used to prioritize candidate topology changes may also be used to determine a subset of nodes, gates, circuit elements, and / or connections that remain fully or partially reconfigurable in the implemented logic circuit. In various embodiments, another subset remains fixed, for later fine-tuning, calibration, adaptation, and / or post-deployment optimization. For example, the subset may be selected based on one or more criticality scores, sensitivity measures, robust statistics, confidence scores, statistical tests, and / or other measures of expected effect, uncertainty, disagreement, stability, or importance. These and other possible measures of expected effect, uncertainty, disagreement, stability, or importance may be, for example, computed from outputs, internal signals, losses, margins, and / or other evaluation quantities obtained using one or more sets of reference input patterns. In some embodiments, multiple distinct data sets and / or reference input pattern sets may be considered. For example, the system may consider one or more sets of training data, one or more sets of validation data, one or more sets of calibration data, one or more sets of deployment data, one or more sets of domain shift data, one or more sets of task data, one or more sets of user data, and / or one or more sets of robustness data. The computing system may aggregate, compare, and / or jointly optimize statistics computed for respective circuit elements across multiple distinct data sets.
[0036] In some embodiments, a circuit element is selected to remain reconfigurable when it is estimated to have a high effect on one or more quality metrics. For example, a circuit element may remain reconfigurable in embodiments in which the estimated effect disagrees across different data sets, tasks, operating conditions, and / or evaluation criteria. In such embodiments, different settings of the circuit element may be beneficial in different contexts. In various embodiments, such disagreement may be identified using one or more robust statistics, confidence scores, significance tests, effect-size measures, cross-dataset variance measures, and / or other measures of context dependence. In various embodiments, full or partial reconfigurability may include allowing a circuit element to choose among all candidate settings or only a restricted subset thereof. In some embodiments, the subset of circuit elements that remains reconfigurable may be selected or refined after an initial synthesis, mapping, and / or place-and-route process.
[0037] In some embodiments, the selection of the subset of circuit elements that remains fully or partially reconfigurable may itself be optimized. For example, the computing system may begin with a fully fixed circuit and identify one or more circuit elements to be made reconfigurable or may begin with a larger set of reconfigurable circuit elements and reduce the set. The computing system may iteratively increase or decrease the size of the reconfigurable set to obtain a desired trade-off between implementation cost and later fine-tuning flexibility. In various embodiments, making a circuit element reconfigurable frequently incurs additional implementation cost relative to a fixed implementation. Accordingly, the disclosed methods may be used not only to select settings for reconfigurable circuit elements, but also to determine which circuit elements remain reconfigurable (e.g., in a post-manufactured ASIC), how many remain reconfigurable, and / or which subset of candidate settings is retained for a given reconfigurable circuit element. In some embodiments, these decisions are based on one or more of the same or related statistics described herein, including criticality scores, sensitivity measures, robust statistics, confidence scores, statistical tests, cross-dataset disagreement measures, and / or other measures of expected effect, uncertainty, disagreement, stability, or importance.
[0038] In some embodiments, the computing system selects a portion of the logic circuit, records input patterns observed at the selected portion across the reference input patterns, designates unobserved input patterns as don’t-cares, and invokes a logic synthesis tool to simplify the selected portion using the don’t-cares. In some embodiments, the selected portion is chosen based at least in part on identified don’t-care opportunities associated with internal signals or combinations of related internal signals, and the recorded input patterns for the selected portion correspond to values on partition-boundary signals rather than necessarily to primary inputs of the overall logic circuit.
[0039] In some embodiments, when two internal signals match or substantially match across at least a threshold fraction of the reference input patterns, the computing system proposes merging the signals only when one signal can replace the other, subject to one or more structural or implementation-feasibility constraints, including routing feasibility, placement feasibility, fan-out constraints, timing constraints, and / or other physical-design considerations. In some embodiments, the threshold fraction used to identify constant or matching signals is at least 90%, 95%, 99%, 99.9%, or another selected threshold. In some embodiments, accepted optimization iterations reduce the number of logic gates, nodes, AIG elements, LUTs, or other circuit elements by at least 10%, 25%, 50%, 70%, 75%, 80%, or another selected amount relative to a pre-optimization circuit description.
[0040] In various embodiments, the acceptance criterion may be threshold-based, baseline-based, loss-based, score-based, and / or based on a plurality of criteria. For example, the acceptance criterion may require unchanged outputs, unchanged output scores, bounded degradation, non-increasing average loss, improvement in a quality metric, improvement in a cost metric, or a combination thereof. After a plurality of optimization iterations, the computing system may output a modified description of the logic circuit that incorporates accepted topology changes. In various embodiments, the modified description comprises a logical expression, a netlist, a gate-level description, a hardware-description-language representation, configuration data for programming a programmable logic device, and / or another fixed circuit representation. The optimized circuit may then be synthesized, technology-mapped, place-and-routed, programmed into an FPGA, and / or fabricated or manufactured as an ASIC. The disclosed data-based, ranking-guided, stochastic, and don’t-care-based optimization techniques may be implemented independently or in any combination.
[0041] In various embodiments, any combination of the data-based, ranking-guided, stochastic, and / or other approximate logic optimization methods described herein may be additionally used for fine-tuning post-synthesis and / or post-manufacturing. For example, any combination of the described optimization methods may be used for fine-tuning after synthesis, after place-and-route, and / or after fabrication of a circuit in which a subset of circuit elements remains reconfigurable. In such embodiments, evaluation of a candidate topology change may be performed using outputs produced by the implemented circuitry itself for one or more sets of reference input patterns. In such embodiments, repeated full software simulation of the logic circuit may not be necessary for each candidate change. Accordingly, the reconfigurable circuit elements may be reconfigured on the fly, including between presentations of input patterns, and / or between groups of input patterns. In some embodiments, reconfigurable circuit elements may be reconfigured during operation, subject to one or more timing, synchronization, or state-consistency constraints. Such reconfiguration may, for example, occur while the circuit is fine-tuned using greedy search, ranking-guided search, stochastic search, bit-flip hypothesis testing, gradient-free optimization, other search or adaptation procedures, and / or another fine-tuning method. The methods disclosed herein may therefore be used as post-fabrication fine-tuning methods for a manufactured circuit having a partially reconfigurable logic-gate network or other partially reconfigurable logic circuitry.
[0042] In some embodiments, evaluation of a candidate topology change or candidate reconfiguration during such fine-tuning may be performed using outputs produced by the implemented circuitry itself for one or more sets of reference input patterns. In such embodiments, repeated full software simulation of the logic circuit may not be required for each candidate change. Accordingly, reconfigurable circuit elements may be reconfigured on the fly, including between presentations of individual reference input patterns, between groups of reference input patterns, between tasks, and / or between operating contexts. In some embodiments, a candidate fine-tuning change comprises changing a current setting of a reconfigurable circuit element, changing a subset of settings available to the reconfigurable circuit element, and / or changing whether a circuit element is fixed, partially reconfigurable, or fully reconfigurable. In some embodiments, fine-tuning on a physical device may be followed by additional synthesis, remapping, calibration, and / or another refinement step. In still other embodiments, reconfigurable circuit elements of a manufactured ASIC may be fine-tuned using any combination of the embodiments described herein, and the results of the fine-tuning may be used as the basis for manufacturing another ASIC with fewer reconfigurable circuit elements.
[0043] As used herein, the terms “logic gate network,”“logic gate neural network,” and “differentiable logic gate network” generally refer to a computational model comprising a plurality of interconnected nodes, units, or gates arranged in one or more layers and / or other topologies, including trees, directed acyclic graphs, or recurrent topologies. Each node may be configured to compute an output from one or more inputs using at least one logic gate operator. A “logic gate operator” is not limited to a strict Boolean operator such as AND, OR, XOR, NAND, or NOR, and may include constants, pass-through or direct-connection operators, inverter operators, and / or multi-input operators. In some embodiments, during training, one or more logic gate operators are implemented using differentiable and / or continuous relaxations such that node outputs are real-valued and gradients can be computed with respect to trainable parameters. “Differentiable parameters” may include logits, scores, weights, probabilities, temperatures, and / or other parameters usable to select and / or blend among candidate operators. “Discretizing,”“hardening,” or “generating a fixed logic gate network” includes any technique for selecting one or more discrete operators per node, such that the resulting network can be represented as a logic expression, netlist, circuit description, hardware description language representation, or other fixed representation.
[0044] The systems and methods described herein may be implemented in a wide variety of computing environments and are not limited to any particular hardware, software, or network architecture. A “computing system” may include one or more processors (e.g., CPUs, GPUs, microcontrollers, DSPs), accelerators (e.g., NPUs, TPUs), and / or programmable or custom logic (e.g., FPGAs, ASICs), and may further include one or more memories, buses, interconnects, storage devices, and communication interfaces. Any “module,”“engine,”“unit,”“component,” or “block” described herein may be implemented in hardware, software, firmware, or any combination thereof, and may be integrated into a single device or distributed across multiple devices (e.g., across a client device and one or more servers). For example, training operations may be executed in a cloud computing environment, and inference operations may be executed on an edge device, embedded controller, FPGA, and / or ASIC. Further, “memory” and “computer-readable medium” include one or more non-transitory storage media (e.g., RAM, ROM, flash, SSD, HDD, optical media) that store instructions and / or data, including trained parameters, operator selections, connection-index arrays, circuit descriptions, and / or other representations of trained or fixed networks.
[0045] The figures and the corresponding detailed description are intended to be illustrative and non-limiting. Functional blocks shown in the figures may represent hardware components, software components, data structures, and / or combinations thereof; and boundaries between blocks are exemplary and may be rearranged, subdivided, combined, or omitted in various implementations. Any flowcharts, sequences, or steps described herein (including training iterations and forward / backward passes) are examples and may be performed in different orders, repeated, performed concurrently, and / or performed with additional or fewer steps, unless expressly stated otherwise. As used herein, the terms “comprising,”“including,” and “having” are open-ended and do not exclude additional elements; “or” is inclusive unless the context clearly indicates otherwise; “based on” means “based at least in part on;” and terms such as “first,”“second,” and the like are used merely as labels and do not imply a required order or ranking. Ranges and numerical examples are illustrative, and terms such as “about” and “approximately” encompass variations consistent with the disclosed purpose and the tolerances of a given implementation.
[0046] Many existing computing systems, methods, and devices may be used in combination with the systems and methods described herein. Some of the infrastructure that can be used with embodiments disclosed herein is already available, such as general-purpose computers, computer programming tools and techniques, digital storage media, and communication links. A computing device or controller may include a processor, such as a microprocessor, a microcontroller, or logic circuitry. Various technologies, systems, architectures, and applications are relevant to the presently described embodiments. Examples of such technologies, systems, architectures, and applications include, but are not limited to, certain aspects of deep neural networks, image recognition, recommender systems, medical diagnosis, language processing, machine learning inference tasks, character recognition, voice detection, multi-modal machine learning models, generative AI, image processing, encoding, decoding, encryption, and the like.
[0047] A processor and other processing components may include and / or utilize a special-purpose processing device, such as application-specific integrated circuits (ASIC), programmable array logic (PAL), programmable logic array (PLA), programmable logic device (PLD), field programmable gate array (FPGA), or other customizable and / or programmable device. A computing device may include a machine-readable storage device, such as non-volatile memory, static RAM, dynamic RAM, ROM, CD-ROM, disk, tape, magnetic media, optical media, flash memory, or other machine-readable storage medium. Various aspects of certain embodiments may be implemented using hardware, software, firmware, or a combination thereof.
[0048] The components of the disclosed embodiments, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Furthermore, the features, structures, and operations associated with one embodiment may be applicable to or combined with the features, structures, or operations described in conjunction with another embodiment. In many instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of this disclosure.
[0049] In various embodiments, the fixed logic gate network is stored as a circuit description (e.g., a netlist or other logical expression or sub-expression) and / or synthesized into hardware for deployment, including programmable logic (e.g., FPGA) and / or a fabricated integrated circuit (e.g., ASIC), to provide efficient inference and / or low-latency control. In some embodiments, after discretization, the system performs logic synthesis and / or simplification operations (e.g., constant propagation, elimination of redundant nodes, removal of unconnected logic), thereby improving area, power, and / or latency.
[0050] In some embodiments, after discretization and / or during logic synthesis, the system performs one or more logic‑optimization transformations that reduce the size and / or depth of the discretized node network, including, without limitation, constant propagation, dead‑logic elimination, elimination of unconnected logic, algebraic rewriting, common‑subexpression elimination, wire removal, and inverter collapsing. For example, a node discretized to a pass‑through (e.g., wire or inverter) function may be removed by rewiring its fan-out to the selected input signal. Cascaded inverters may be collapsed (e.g., two inversions eliminated), and inverters may be pushed forward / backward through adjacent logic where permitted by Boolean identities, thereby removing redundant inversions. In certain embodiments, these synthesis transformations cause a structural collapse of portions of the discretized node network (e.g., because residual initialization produces many nodes that discretize to pass‑through and / or inversion functions). The synthesis transformations reduce the number of discrete operators and / or gates in the resulting hardware representation by more than 50%, by more than 75%, or by another threshold reduction relative to a pre‑synthesis discretized representation, depending on the architecture, the degree of residual initialization, and the applied synthesis rules.
[0051] FIG. 1 illustrates an example logic circuit optimization system 100 according to one embodiment. In the illustrated embodiment, the logic circuit optimization system 100 includes one or more processors 130, a memory 140, a communications interface 115, and one or more optimization modules 170, which are communicatively coupled via one or more interconnects 120. In various embodiments, the logic circuit optimization system 100 is configured to receive a description of a logic circuit, receive a set of reference input patterns, generate and / or select candidate topology changes to the logic circuit, evaluate candidate topology changes using at least a portion of the reference input patterns, determine whether one or more acceptance criteria are satisfied, update the description of the logic circuit responsive to accepted candidate topology changes, and output a modified description of the logic circuit.
[0052] In various embodiments, not all modules 170 are used in every configuration. Unused modules of a specific embodiment may be omitted. For example, some embodiments for ranking-guided optimization may use the candidate topology change ranking module 178 and omit the candidate selection module 174. Similarly, embodiments for stochastic selection that use the candidate selection module 174 may not include the candidate topology change ranking module 178. In some embodiments, multiple approaches are combined, including ranking-guided selection, stochastic selection, sequential traversal, data-based candidate prioritization, threshold-based acceptance, loss-based acceptance, score-based acceptance, and don’t-care-based simplification of selected sub-logic gate networks.
[0053] In some embodiments, the processor 130 includes one or more general-purpose processors (e.g., CPUs), one or more parallel processors (e.g., GPUs), and / or one or more accelerators (e.g., NPUs and / or TPUs). In some embodiments, the processor 130 may be embodied as programmable or custom ASIC hardware usable to implement and / or implicitly configured to implement the optimization modules 170. In some other embodiments, the processor 130 may be embodied as FPGA hardware usable to implement and / or implicitly configured to implement the optimization modules 170. The optimization modules 170 are representative functional blocks and may be implemented in hardware, software, firmware, or any combination thereof. In some embodiments, one or more of the optimization modules 170 are implemented as instructions stored in the memory 140 and executed by one or more processors 130. Alternatively, one or more of the optimization modules 170 may be implemented using dedicated circuitry, accelerators, programmable logic, and / or custom logic. The boundaries between the optimization modules 170 are illustrative and non-limiting. In various embodiments, operations described as being performed by a particular module may be performed by a different module, combined with another module, subdivided into sub-modules, and / or distributed across multiple devices without departing from the scope of the present disclosure.
[0054] The logic circuit description module 171 is configured to receive, store, generate, access, and / or manage one or more descriptions of a logic circuit. In various embodiments, a circuit description managed by the logic circuit description module 171 includes one or more of a logical expression, a netlist, a gate-level netlist, a hardware description language (HDL) representation, a Boolean network, a LUT network, a binary decision diagram, a truth table representation, and / or another intermediate representation. In some embodiments, the logic circuit corresponds to a fixed logic gate network generated after training and discretization of a differentiable logic gate network for a machine-learning inference task. In some embodiments, the logic circuit corresponds to only a part of a fixed logic gate network generated after training and discretization of a differentiable logic gate network for a machine-learning inference task.
[0055] The reference input pattern module 172 is configured to receive, store, access, and / or manage one or more sets of reference input patterns used to guide optimization of the logic circuit. In various embodiments, the reference input patterns include training-set patterns, validation-set patterns, etc. In some embodiments, the reference input pattern module 172 further stores labels, target output values, baseline outputs, and / or other evaluation data associated with the reference input patterns. In some embodiments, the reference input pattern module 172 further comprises a data-generating process, thereby not explicitly storing the reference input pattern but instead generating it. An example of this may comprise data augmentations or a teacher model that generates training data. In some embodiments, the data-generating process is deterministic, such that a selected set of reference input patterns can be reproduced. In other embodiments, the data-generating process is stochastic, such that different optimization iterations may use different sampled reference input patterns.
[0056] It is appreciated that mentions of a set of reference input patterns implicitly include that they may be represented through a data-generating process, and may, for example, be generated- on the- fly. In some embodiments, the reference input pattern module 172 selects a first subset of reference input patterns for an initial evaluation and / or ranking operation, and selects a second, larger, different, and / or overlapping subset of reference input patterns for a later verification operation (e.g., a second verification operation). In some embodiments, the reference input pattern module 172 records observed input patterns to a selected sub-logic gate network across the reference input patterns for use in defining don’t-cares.
[0057] The candidate topology change module 173 is configured to generate, define, propose, and / or identify candidate topology changes to the logic circuit. In various embodiments, a candidate topology change includes at least one of removing, disabling, rewiring, replacing, and / or otherwise modifying a circuit element or connection. As used herein, the term “circuit element” encompasses “connections,” and yet the phrase “circuit element or connection” is used throughout the description as a reminder that a “circuit element” may include or be embodied as a “connection,” such as a wire or inverter, and does not imply mutual exclusivity.
[0058] In some embodiments, the candidate topology change module 173 proposes replacing a selected gate or node with a simpler operator. For example, the candidate topology change module 173 may select a gate or node to be replaced with a constant TRUE operator, a constant FALSE operator, a direct-connection operator, and / or an inverter operator. In some embodiments, the candidate topology change module 173 identifies an internal activation signal that is constant or nearly constant across the reference input patterns and proposes replacing the corresponding signal and / or logic with a constant value. In some embodiments, the candidate topology change module 173 identifies a pair of matching internal signals and proposes merging the corresponding logic. In some embodiments, the candidate topology change module 173 prioritizes a gate or connection based on one or more implementation costs, including placement cost, routing cost, latency cost, area cost, gate-count cost, cell-count cost, delay, power, energy, interconnect cost, and / or weighted combinations thereof. In some embodiments, the candidate topology change module 173 proposes a plurality of candidate topology changes together as a set. In some embodiments, the candidate topology change module 173 stores a backup of the current gate choice, connection state, and / or circuit state prior to evaluating a proposed candidate topology change.
[0059] In various embodiments, the candidate selection module 174 may be configured to select one or more candidate topology changes for evaluation. In some embodiments, the candidate selection module 174 may select a candidate topology change from a ranking maintained by the candidate topology change ranking module 178. In some embodiments, the candidate selection module 174 performs stochastic selection, including random and / or probability-distribution-based selection of a circuit element, connection, gate, node, and / or candidate topology change. In some embodiments, the candidate selection module 174 performs sequential selection, including traversal-based selection over gates, nodes, edges, circuit elements, and / or connections. In some embodiments, the candidate selection module 174 selects from among non-trivial gates or other candidate elements for possible replacement with simpler operators. In some embodiments, the candidate selection module 174 uses selection priorities derived from activation statistics, implementation costs, prior evaluations, asynchronous evaluations, and / or ranking information.
[0060] In various embodiments, the evaluation module 175 may be configured to evaluate the logic circuit with one or more candidate topology changes applied. In various embodiments, the evaluation module 175 evaluates a candidate topology change using at least a portion of the reference input patterns to determine at least one evaluation score. In some embodiments, the at least one evaluation score comprises a quality metric, a cost metric, and / or both. In some embodiments, the quality metric is based on outputs produced for at least a portion of the reference input patterns and includes one or more of: output equality, unchanged output scores, accuracy, error rate, output deviation, loss, margin, and / or another score. In some embodiments, the loss is based on labels and / or teacher outputs and includes, by way of example, cross-entropy, softmax cross-entropy, Kullback-Leibler divergence, mean squared error, mean absolute error, L1 error, Lp error, peak signal to noise ratio (PSNR), structural similarity index measure (SSIM), and / or other loss functions, and mixtures thereof. In some embodiments, the loss is a machine-learning loss function, including differentiable and non-differentiable loss functions. In some embodiments, the loss is a statistical confidence measure of a statistical test, for example, a p-value of a significance test or a transformation thereof.
[0061] In some embodiments, the evaluation module 175 determines one or more class scores and / or other grouped output scores using one or more group sum operations, popcount operations, counters, adders, and / or other aggregation operations. In some embodiments, the evaluation module 175 applies one or more output offset terms and / or one or more temperature-scaling parameters prior to computing a score used in an acceptance criterion. In some embodiments, the evaluation module 175 performs an initial evaluation using a first subset of the reference input patterns and a later verification using a larger subset, a different subset, or all the reference input patterns. In some embodiments, evaluation using a set of reference input patterns comprises using cached partial results. For example, in some embodiments, it suffices to evaluate only the transitive fan-out cone of a subset of nodes. In some embodiments, the evaluation module 175 applies one or more output-associated adjustment parameters when determining a score or loss used in an acceptance criterion, including offset terms and / or scaling parameters applied to individual outputs of the logic circuit before aggregation, to aggregated output scores after aggregation, or to both. It is appreciated that any evaluation is encompassed here, whether a full evaluation, a partial evaluation, retrieving recently evaluated scores from the cache, or evaluating efficiency-enhancing strategies.
[0062] In some embodiments, the evaluation module 175 and / or the circuit description update module 177 apply the disclosed optimization methods to different portions of a logic circuit at different times. For example, the evaluation module 175 may evaluate candidate topology changes while treating group-sum or accumulator circuitry as fixed. Alternatively, it may evaluate candidate topology changes that include arithmetic aggregation stages together with upstream logic. In still other embodiments, the evaluation module 175 may evaluate candidate topology changes directed primarily to the aggregation stages themselves. In some embodiments, later-stage optimization of adders, popcount circuits, counters, accumulators, comparators, and / or other aggregation circuitry is informed by earlier simplification of upstream logic. The later stage optimization may include earlier stages that created constant, matching, duplicated, and / or otherwise redundant grouped outputs.
[0063] In various embodiments, the acceptance criterion module 176 is configured to determine whether an acceptance criterion is satisfied for a candidate topology change. In some embodiments, the acceptance criterion module 176 compares one or more evaluation scores determined by the evaluation module 175 to one or more thresholds, baselines, and / or other criteria. In some embodiments, the acceptance criterion requires that a quality metric satisfy a predefined threshold, cost metric improvement, not-worse metric, relative quality compared to a number of other candidate topology changes, satisfy a statistical test, and / or other criteria. In some embodiments, the acceptance criterion module 176 evaluates a plurality of acceptance criteria and accepts a candidate topology change when at least a selected number of the criteria are satisfied. In some embodiments, the acceptance criterion module 176 uses a static acceptance threshold. In some embodiments, the acceptance criterion module 176 uses a dynamic acceptance threshold and / or a delta parameter that is adjusted during optimization to explore trade-offs between functional quality and circuit cost. In some embodiments, the acceptance criterion module 176 uses a dynamic acceptance criterion that considers a topology change in the context of or in comparison to other candidate topology changes. For example, the acceptance criterion may be to accept at least a small fraction of considered candidate topology changes, including accepting the best out of a number of considered candidate topology changes when, otherwise, across the number of considered candidate topology changes, no topology change would be accepted.
[0064] In various embodiments, the circuit description update module 177 may be configured to update the description of the logic circuit in response to accepted candidate topology changes. In some embodiments, when the acceptance criterion module 176 indicates that a candidate topology change is acceptable, the circuit description update module 177 incorporates the candidate topology change into the description of the logic circuit. In some embodiments, when a candidate topology change is not accepted, the circuit description update module 177 discards the candidate topology change and / or restores a previous (backed up) or default gate choice or circuit state. In some embodiments, the circuit description update module 177 outputs a modified, simplified, and / or optimized description of the logic circuit, in any of the various formats described herein and / or other formats known to those of skill in the art. In some embodiments, the circuit description update module 177 selects a sub-logic gate network, causes input patterns to be used to define don’t-cares for the selected sub-logic gate network, invokes a logic synthesis tool to simplify the selected sub-logic gate network using the don’t-cares, evaluates the simplified selected sub-logic gate network, and incorporates the simplified selected sub-logic gate network into the description of the logic circuit.
[0065] In various embodiments, the candidate topology change ranking module 178 may be configured to maintain a ranking of a plurality of candidate topology changes. In some embodiments, the candidate topology change ranking module 178 initializes the ranking by traversing all or a subset of circuit elements, nodes, edges, and / or connections of the logic circuit. The topology change ranking module 178 may evaluate corresponding candidate topology changes, and then store candidate topology changes with the “best” or highest evaluation scores. In some embodiments, the candidate topology change ranking module 178 is implemented by, or communicates with, a coordinator system that receives asynchronously generated evaluation results from a plurality of worker systems and updates the ranking and / or selects candidate topology changes for acceptance, rejection, and / or reevaluation.
[0066] FIG. 2 illustrates an example logic circuit architecture 200 according to one embodiment. In the illustrated embodiment, the architecture 200 is configured to perform an inference task using logic-gate-based computation. In some embodiments, the architecture 200 is configured for a classification task, such as image classification, object recognition, pattern recognition, signal classification, or another inference task in which outputs of a logic circuit are used to determine one or more class scores, labels, actions, or other output values. In various embodiments, the architecture 200 corresponds to a logic circuit that may be received, stored, evaluated, modified, simplified, and / or output by the logic circuit optimization system 100 described herein. In some embodiments, the architecture 200 corresponds to a fixed logic gate network produced after training and discretization of a differentiable logic gate network. In other embodiments, the architecture 200 is specified directly as a logic circuit without requiring differentiable training. Additional details, alternative embodiments, alternative representations, and additional understanding of the architecture 200 can be found in the applications identified herein as “related applications,” which were previously incorporated by reference.
[0067] The presently described systems and methods, in any combination, can be used to optimize the connectivity of one or more layers and / or logic gate operators within one or more layers of the architecture 200. In other embodiments, connectivity itself may be modified during optimization. In various embodiments, the architecture 200 may include six or more layers, e.g., 10, 20, 30, or 50 layers, some or all of which may comprise logic gates, logic nodes, logic trees, and / or other gate-level structures.
[0068] The example architecture 200 is included in this disclosure as a useful context for understanding the application of the systems and methods described herein for optimization, as it provides an example of a logic circuit whose topology may be modified while preserving acceptable inference quality. For example, candidate topology changes may be generated for one or more logic gates, nodes, connections, signals, subtrees, pooling structures, output-grouping structures, and / or other portions of the architecture 200. In some embodiments, candidate topology changes include removing, disabling, rewiring, or replacing one or more circuit elements or connections within one or more convolutional blocks, one or more pooling blocks, one or more Rand layers, and / or a group-sum stage. In some embodiments, a selected portion of the architecture 200 is treated as a sub-logic gate network for purposes of don’t-care-based simplification, including by recording observed input patterns to the selected portion across reference input patterns, designating unobserved input patterns as don’t-cares, invoking a logic synthesis tool to simplify the selected portion, and / or evaluating the resulting simplified portion before incorporating it into the architecture 200. In some embodiments, the observed and unobserved input patterns for the selected portion correspond to boundary-signal values of a selected partition, such that the relevant input patterns may be defined by internal signals of the architecture 200 rather than only by the primary inputs of the architecture 200. In some embodiments, don’t-care opportunities are identified first, including opportunities associated with internal signals and / or combinations of values of related internal signals, and a partition of the architecture 200 is then selected based at least in part on the identified don’t-care opportunities, the selected partition including one or more circuit elements associated with those opportunities. In some embodiments, output-side arithmetic circuitry (e.g., the group-sum stage of the architecture 200) may be treated as part of the logic circuit subjected to optimization. In other embodiments, output-side arithmetic circuitry may be excluded from at least some optimization passes.
[0069] As described herein, in some embodiments, only a first subset of the reference input patterns is used to generate an initial evaluation score and / or ranking of candidate topology changes, and a second, larger, different, and / or overlapping subset of the reference input patterns is used to verify one or more selected candidate topology changes. In some embodiments, the evaluation score is based on one or more outputs of the architecture 200, including one or more class scores produced by the group-sum stage. In some embodiments, the evaluation score includes a quality metric, a cost metric, and / or both. In some embodiments, the quality metric is based on output equality, unchanged output scores, classification accuracy, classification loss, output deviation, error rate, robust statistic, and / or another score computed using outputs of the architecture 200.
[0070] FIG. 3 illustrates an example randomly connected logic gate network architecture 301 according to one embodiment. In the illustrated embodiment, the architecture 301 is configured to perform an inference task using logic-gate-based computation. In some embodiments, the architecture 301 is configured for a classification task, such as image classification, object recognition, pattern recognition, signal classification, or another inference task in which outputs of a logic circuit are used to determine one or more class scores, labels, actions, or other output values. In the illustrated embodiment, an input representation 311 provides input values to a plurality of interconnected logic gate nodes of the architecture 301, which produce outputs 332. In some embodiments, each node of the architecture 301 is represented as a selectable logic gate chosen from an available set of logic gate choices 340. In the illustrated embodiment, the outputs 332 may be aggregated via group sum operation, which may be implemented through adders or popcounters. In the illustrated embodiments, this produces two unscaled scores, 0+0=0 for “polar bear” and 1+1=2 for “giant panda”, which may then further be scaled, for example, through a temperature parameter and an offset. To provide an example, the output offsets may be 0.5 for “polar bear” output and 0.6 for “giant panda” output, and the temperature may be 1.6 for “polar bear” output and 1.4 for “giant panda” output, which may result in corresponding scores of 0 / 1.6-0.5 = 0.5 for “polar bear” and 2 / 1.4-0.6=0.8 for “giant panda”, which may result in the model classifying the image as “giant panda”.
[0071] In various embodiments, the architecture 301 corresponds to a logic circuit that may be received, stored, evaluated, modified, simplified, and / or output by the logic circuit optimization system 100 described herein. In some embodiments, the architecture 301 corresponds to a fixed logic gate network produced after training and discretization of a differentiable logic gate network. In other embodiments, the architecture 301 is specified directly as a logic circuit without requiring differentiable training. Additional details, alternative embodiments, alternative representations, and additional understanding of the architecture 301 can be found in the applications identified herein as “related applications,” which were previously incorporated by reference.
[0072] The example architecture 301 is included to provide useful context for understanding the application of the systems and methods described herein for optimization, as it illustrates a simple logic circuit whose topology may be modified while preserving acceptable inference quality.
[0073] FIG. 4 illustrates an example ranking-guided approximate logic optimization method 400 according to one embodiment. In various embodiments, the method 400 is performed by the logic circuit optimization system 100, including one or more of the logic circuit description module 171, the reference input pattern module 172, the candidate topology change module 173, the candidate selection module 174, the evaluation module 175, the acceptance criterion module 176, the circuit description update module 177, and / or the candidate topology change ranking module 178. In some embodiments, the method 400 is used to simplify, optimize, and / or otherwise modify a logic circuit while maintaining acceptable functional quality with respect to one or more reference input patterns.
[0074] In the illustrated embodiment, the method 400 begins at an initialization step 401. In some embodiments, the initialization step 401 includes receiving and / or accessing a description of a logic circuit, receiving and / or accessing one or more sets of reference input patterns, initializing one or more acceptance thresholds or other acceptance-criterion parameters, initializing one or more candidate-topology-change records, initializing one or more considered flags, and / or initializing one or more best-candidate or ranking data structures. In some embodiments, the logic circuit comprises a combinational logic circuit, a sequential logic circuit, a fixed logic gate network derived from a differentiable logic gate network, and / or another gate-level circuit representation. In some embodiments, the received logic circuit corresponds to a prespecified logic function in a logic synthesis flow, including an exact-function flow or an approximate-function flow, rather than to a machine-learning inference task.
[0075] The method 400 is illustrated as including the particular states or steps 401, 403, 405, 407, 409, 411, 413, 415, 417, 421, 423, 425, 427, and 429, as described in detail below. However, the illustrated sequence is non-limiting. In various embodiments, one or more steps may be omitted, combined, subdivided, reordered, repeated, and / or executed in parallel. For example, the considered-state determination of the step 405 may be omitted in embodiments that do not use considered flags. The threshold adjustment step 411 and / or the delta update step 427 may be omitted in embodiments that use static acceptance criteria. The best candidate update step 415 may correspond to updating multiple ranked candidates rather than only a single best candidate, and the best-candidate application step 425 may be replaced with another ranking-based or stochastic selection operation. Accordingly, the method 400 is illustrative of one example process by which a logic circuit may be iteratively simplified and optimized using candidate topology changes while maintaining acceptable behavior relative to one or more reference input patterns.
[0076] In the illustrated, non-limiting example, the method 400 proceeds to a candidate-iteration step 403, labeled “For each candidate topology change.” In some embodiments, the candidate-iteration step 403 corresponds to traversing all or a subset of circuit elements, nodes, gates, edges, connections, signals, subtrees, subcircuits, and / or selected sub-logic gate networks to identify and / or consider candidate topology changes. In various embodiments, a candidate topology change may include removing, disabling, rewiring, replacing, and / or otherwise modifying a circuit element or connection. For example, in some embodiments, candidate topology changes include replacing a selected gate with a constant TRUE operator, a constant FALSE operator, a direct-connection operator, an inverter operator, and / or another simpler operator. In some embodiments, candidate topology changes include replacing an internal activation signal with a constant value, merging a pair of matching internal signals, and / or prioritizing a gate or connection based on one or more implementation costs (optionally, a weighted cost evaluation as described herein).
[0077] At a decision step 405, the method 400 determines whether a current candidate topology change has already been considered. In some embodiments, the “considered” step is represented by one or more flags, markers, or metadata associated with the candidate topology change. In some embodiments, such metadata is maintained in the candidate topology change ranking module 178 and indicates whether a candidate topology change has been considered, evaluated, selected, accepted, rejected, deferred, and / or otherwise processed. If the candidate topology change has already been considered, the method 400 may return to the candidate-iteration step 403 to proceed to a next candidate topology change. If the candidate topology change has not already been considered, the method 400 may proceed to a decision step 407.
[0078] At the decision step 407, the method 400 determines whether the candidate topology change satisfies an acceptance criterion. In some embodiments, the acceptance criterion is evaluated using at least a portion of the reference input patterns. In some embodiments, the acceptance criterion is based on one or more evaluation scores determined by the evaluation module 175, including one or more quality metrics, one or more cost metrics, a history of accepted and rejected changes, a history of one or more metrics for other accepted and / or rejected changes, and / or combinations thereof. In some embodiments, the quality metric is based on outputs of the logic circuit and may include output equality, unchanged output scores, classification accuracy, output deviation, error rate, loss, average loss, robust statistic, statistical test result, a confidence measure, and / or another score. In some embodiments, the cost metric includes one or more measures of circuit complexity and / or implementation cost, including area, gate count, cell count, depth, latency, routing cost, placement cost, power, energy, and / or delay, or a proxy thereof. In some embodiments, determining whether the candidate topology change satisfies the acceptance criterion includes comparing the one or more evaluation scores to one or more predefined thresholds, baseline values, dynamically adjusted thresholds, and / or combinations of multiple criteria. In some embodiments, evaluating the candidate topology change may include determining (i) a quality metric based on outputs produced for at least a portion of the reference input patterns and (ii) at least one of: (a) a cost metric of the logic circuit and (b) a confidence level that the candidate topology change will reduce gate count.
[0079] If the candidate topology change satisfies the acceptance criterion at the decision step 407, the method 400 proceeds to an update step 409. At the update step 409, the method 400 updates the logic circuit, resets the best candidate, and clears one or more considered flags. In some embodiments, updating the logic circuit includes incorporating the accepted candidate topology change into a description of the logic circuit, such as a gate-level netlist, HDL representation, and / or another circuit description. In some embodiments, resetting the best candidate includes resetting one or more records corresponding to a previously stored current best candidate or best-ranked candidate. In some embodiments, clearing one or more considered flags causes candidate topology changes to be reconsidered in light of the updated logic circuit.
[0080] In some embodiments, the update step 409 is followed by an optional threshold-adjustment step 411. At the threshold-adjustment step 411, the method 400 adjusts an acceptance threshold. In some embodiments, the acceptance threshold is adjusted to relax or tighten the acceptance criterion in response to one or more previously accepted candidate topology changes, rejected candidate topology changes, measured losses, measured errors, and / or target tradeoffs between quality and circuit cost. In some embodiments, the threshold-adjustment step 411 is omitted. In some embodiments, the threshold-adjustment step 411 is performed before, after, and / or concurrently with the operations of the update step 409.
[0081] If the candidate topology change does not satisfy the acceptance criterion at the decision step 407, the method 400 proceeds to a decision step 413. At the decision step 413, the method 400 determines whether the current candidate topology change is better than the current best candidate. In some embodiments, “better” refers to having a more desirable evaluation score, such as lower loss, lower output deviation, lower cost at a comparable quality level, greater cost reduction while remaining within a quality constraint, and / or another preferred tradeoff. In some embodiments, the current best candidate corresponds to the highest-ranked candidate topology change retained from among multiple evaluated candidate topology changes. In some embodiments, the illustrated current best candidate is one simplified example of a ranking, such as a ranking of size one, while other embodiments may maintain a plurality of ranked candidate topology changes.
[0082] If the current candidate topology change is better than the current best candidate at the decision step 413, the method 400 proceeds to the update step 415, where the current best candidate is updated. In some embodiments, updating the current best candidate includes replacing a previously stored best candidate with the currently evaluated candidate topology change and storing one or more associated scores, thresholds, flags, or other metadata. In some embodiments, the update step 415 corresponds to updating one or more entries of a candidate topology change ranking maintained by the candidate topology change ranking module 178. If the current candidate topology change is not better than the current best candidate at the decision step 413, the method 400 may bypass the update step 415 and proceed directly to a marking step 417.
[0083] At the marking step 417, the method 400 marks the current candidate topology change as considered. In some embodiments, marking the current candidate topology change as considered includes setting one or more considered flags, visited flags, ranking flags, and / or other metadata values. In some embodiments, the marking step 417 is performed after the update step 415 when a new “current best candidate” has been identified. In some embodiments, the marking step 417 is also performed when the current candidate topology change is not selected as the current best candidate. In various embodiments, the marking step 417 reduces repeated evaluation of the same candidate topology change during a given iteration or pass over the circuit.
[0084] The method 400 may then proceed to a decision step 421, at which it is determined whether all candidate topology changes have been considered. In some embodiments, the decision step 421 corresponds to determining whether all candidate topology changes generated for a current pass, batch, subset, or traversal of the logic circuit have been processed. If not all or a threshold number of candidate topology changes have been considered, the method 400 may return to the candidate-iteration step 403 to continue traversing and considering candidate topology changes. If all or a sufficient number (e.g., a percentage) of candidate topology changes have been considered, the method 400 may proceed to a termination decision step 423.
[0085] At the termination decision step 423, the method 400 determines whether a termination criterion has been satisfied. In some embodiments, the termination criterion includes one or more of exhaustion of acceptable candidate topology changes, exhaustion of a candidate set, attainment of a desired circuit size, attainment of a desired area, attainment of a desired latency, attainment of a desired loss level, attainment of a desired error level, attainment of a desired score, expiration of a time limit, expiration of an iteration limit, convergence of scores, convergence of circuit structure, and / or another stopping condition. If the termination criterion is satisfied at the decision step 423, the method 400 may proceed to an end step 429.
[0086] If the termination criterion is not satisfied at the decision step 423, the method 400 may proceed to a best-candidate-application step 425. At the best candidate application step 425, the method 400 adjusts an acceptance threshold, applies the best candidate topology change, and clears one or more considered flags. In some embodiments, applying the best candidate topology change includes incorporating the currently stored best candidate topology change into the logic circuit, even if the stored topology change did not satisfy a stricter acceptance threshold that would have caused immediate acceptance at the decision step 407. In some embodiments, the best candidate application step 425 corresponds to an embodiment in which a threshold is progressively relaxed, and the best available candidate topology change is applied to continue simplifying the logic circuit. In some embodiments, clearing the considered flags at the step 425 allows the candidate topology changes to be reevaluated relative to the newly updated logic circuit.
[0087] In some embodiments, the best-candidate-application step 425 is preceded by an optional delta-update step 427. At the delta-update step 427, the method 400 updates a delta parameter. In some embodiments, the delta parameter controls the extent to which an acceptance threshold is relaxed or tightened. In some embodiments, the delta parameter is increased, decreased, reset, and / or otherwise adjusted based on one or more evaluation outcomes, one or more quality metrics, one or more cost metrics, one or more prior acceptance decisions, and / or one or more target tradeoffs between approximation quality and circuit simplification. In some embodiments, the delta-update step 427 is omitted. In some embodiments, the delta-update step 427 is performed before, after, and / or as part of the best-candidate-application step 425.
[0088] After the best candidate-application step 425, the method 400 may return to the candidate iteration step 403 and continue iteratively evaluating additional candidate topology changes for the updated logic circuit. In this manner, the method 400 may repeatedly identify, compare, rank, apply, and / or otherwise incorporate candidate topology changes until the termination criterion is satisfied at the decision step 423, after which the method 400 reaches the end step 429. In some embodiments, when the method 400 reaches the end step 429, a modified description of the logic circuit is output, stored, transmitted, synthesized, verified, and / or otherwise prepared for downstream deployment. In some embodiments, after reaching the end step 429, the current logic circuit is additionally or alternatively used to instantiate a differentiable circuit representation. For example, the system may instantiate a differentiable logic gate network for further gradient-based optimization, after which the circuit may be discretized again, and optionally, subjected to one or more additional approximate optimization iterations.
[0089] In some embodiments, the acceptance determination at the decision step 407 and / or the best-candidate comparison at the decision step 413 is based on evaluation using only a first subset of the reference input patterns. A selected current best candidate topology change is later verified using a second, larger, different, and / or overlapping subset of the reference input patterns before being incorporated into the logic circuit at the step 409 and / or the step 425. In some embodiments, evaluation is performed asynchronously and / or in parallel for multiple candidate topology changes. In some embodiments, the method 400 stores only a current best candidate topology change, as illustrated by the steps 413 and 415. In other embodiments, the method 400 stores and updates a plurality of ranked candidate topology changes, and the illustrated current best candidate corresponds to the highest-ranked entry among the plurality of ranked candidate topology changes. In some embodiments, after incorporation of a candidate topology change into the description of the logic circuit, one or more remaining candidate topology changes remain in the ranking with evaluation scores determined for a prior version of the logic circuit, such evaluation scores thereby being outdated relative to the updated logic circuit until re-evaluation.
[0090] In some embodiments, only candidate topology changes that reduce the number of gates, the number of connections, or both are considered during a given optimization phase, pass, or iteration. In some embodiments, candidate topology changes are evaluated in a distributed and / or asynchronous manner by a plurality of workflow systems, processor cores, threads, devices, and / or compute nodes. A coordinator system, which may also be referred to as a master system, may receive evaluation results from the worker or workflow systems, maintain one or more current-best candidate topology changes and / or a ranking of candidate topology changes, determine whether a candidate topology change is to be accepted, and communicate, broadcast, and / or otherwise distribute an accepted candidate topology change and / or an updated description of the logic circuit to the worker systems.
[0091] In some embodiments, when no candidate topology change is accepted after a threshold number of candidate topology changes has been evaluated, the coordinator system may relax an acceptance criterion and / or select for reevaluation one or more previously rejected candidate topology changes, such as one or more highest-ranked rejected candidate topology changes from a recent evaluation window. In some embodiments, evaluation results from a prior version of the logic circuit are used to identify candidate topology changes for reevaluation. In such embodiments, acceptance may be based on evaluation scores from a current version of the logic circuit. Accordingly, among candidate topology changes having evaluation scores generated for the current version of the logic circuit, the best candidate topology change may be accepted even when no candidate topology change would have satisfied a stricter acceptance criterion. The foregoing candidate restrictions, distributed evaluation arrangements, reevaluation procedures, and relaxed-acceptance procedures may be used individually or in any combination, and / or in combination with other embodiments described herein.
[0092] FIG. 5 illustrates example candidate topology change examples and acceptance variants 510 according to various embodiments. In various embodiments, the examples and variants 510 are used by the logic circuit optimization system 100, including one or more of the candidate topology change module 173, the candidate selection module 174, the evaluation module 175, the acceptance criterion module 176, and / or the candidate topology change ranking module 178, to generate, prioritize, evaluate, accept, reject, and / or rank candidate topology changes for a logic circuit. In some embodiments, the examples and variants 510 support ranking-guided optimization, stochastic simplification, sequential traversal embodiments, and / or combinations thereof. In various embodiments, one or more of the illustrated examples and variants 510 may be used alone or in combination with one or more others. Specific embodiments may include or omit any combination of the illustrated topology change examples and acceptance variants 510.
[0093] In the illustrated embodiment, the examples and variants 510 include a first group of candidate-topology-change examples 520, 522, 524, and 526. In some embodiments, these examples correspond to representative ways in which candidate topology changes may be generated and / or prioritized. In some embodiments, the examples 520, 522, 524, and 526 are non-limiting, and additional candidate-topology-change types may also be used. In various embodiments, candidate topology changes generated according to one or more of the examples 520, 522, 524, and 526 may be inserted into, removed from, reordered within, and / or otherwise managed using a candidate topology change ranking 550.
[0094] A first example 520 is labeled “Remove, disable, or rewire circuit element or connection.” In some embodiments, the example 520 includes removing one or more gates, nodes, logic elements, edges, wires, and / or other circuit connections from a logic circuit. In some embodiments, the example 520 includes disabling one or more circuit elements or connections without fully deleting them from an intermediate representation. In some embodiments, the example 520 includes rewiring one or more circuit elements or connections, including reconnecting an input, reconnecting an output, bypassing a node, replacing one signal with another, and / or otherwise modifying circuit connectivity. In some embodiments, the example 520 includes replacing a selected gate or circuit element with a simpler operator. In various embodiments, the simpler operator may include a constant TRUE operator, a constant FALSE operator, a direct-connection operator that forwards a selected signal, an inverter operator that inverts a selected signal, and / or another simpler operator.
[0095] A second example 522 is labeled “Replace internal activation signal with constant value.” In some embodiments, the example 522 includes processing reference input patterns through the logic circuit to record activation values at one or more internal signals of the logic circuit. In some embodiments, an internal activation signal is identified as constant or nearly constant across the reference input patterns, such as for all evaluated patterns or for at least a threshold fraction thereof. A third example 524 is labeled “Merge pair of matching internal signals.” In some embodiments, the example 524 includes processing the reference input patterns through the logic circuit to identify two internal signals that produce matching values for all, substantially all, or at least a threshold fraction of the reference input patterns. In some embodiments, when such matching internal signals are identified, one signal of the pair may be replaced with the other, one corresponding gate may be removed or disabled, and / or other logic may be simplified to reduce duplicate or substantially duplicate internal behavior.
[0096] A fourth example 526 is labeled “Prioritize gate or connection based on placement, routing, or latency cost.” In some embodiments, the example 526 includes identifying one or more gates, nodes, wires, interconnects, or other circuit elements that have relatively high implementation costs. In some embodiments, the implementation cost includes one or more of placement cost, routing cost, congestion cost, interconnect cost, timing cost, delay, latency, area, power, and / or another implementation cost. In some embodiments, one or more candidate topology changes associated with such gates or connections are given elevated priority for evaluation, insertion into the ranking 550, and / or selection for simplification. In some embodiments, candidate topology changes associated with the example 526 are evaluated using a less strict acceptance criterion than is applied to other candidate topology changes.
[0097] In the illustrated embodiment, the examples and variants 510 further include a second group of evaluation and acceptance variants 530, 532, 534, and 536. In some embodiments, the variants 530, 532, 534, and 536 correspond to representative ways in which a candidate topology change may be evaluated and / or accepted. In various embodiments, one or more of the variants 530, 532, 534, and 536 may be used in connection with any combination of one or more of the candidate-topology-change examples 520, 522, 524, and 526. In some embodiments, the ranking 550 is populated, updated, and / or traversed using evaluation results derived from one or more of the variants 530, 532, 534, and 536.
[0098] An evaluation variant 530 is labeled “Determine at least one evaluation score using at least a portion of the reference input patterns.” In some embodiments, the variant 530 includes evaluating a logic circuit with a candidate topology change applied using at least a subset of the available reference input patterns. In some embodiments, the at least one evaluation score includes one or more quality metrics, one or more cost metrics, and / or both. In some embodiments, the quality metric includes output equality, unchanged output scores, classification accuracy, classification loss, error rate, output deviation, margin, rank, or another score. In some embodiments, the cost metric includes area, gate count, cell count, routing complexity, delay, latency, power, energy, and / or another implementation-related metric. In some embodiments, a first subset of the reference input patterns is used to populate the ranking 550. A second, larger, different, and / or overlapping subset may be used later to verify a selected candidate topology change.
[0099] An evaluation variant 532 is labeled “Apply per-class offset term and / or temperature scaling prior to computing a score used in the acceptance criterion.” In some embodiments, the variant 532 is used when outputs of the logic circuit are aggregated into one or more output scores, such as per-class scores. In some embodiments, one or more offset terms are applied on a per-output basis prior to aggregation, on a per-score basis after aggregation, or both. Thus, in some embodiments, the offset terms comprise per-class offset terms, while in other embodiments, the offset terms comprise per-output offset terms associated with respective outputs of the logic circuit. In some embodiments, one or more temperature-scaling parameters are applied to outputs and / or output scores prior to computing the score or loss used in the acceptance criterion. In some embodiments, temperature scaling comprises a single global scaling factor. In other embodiments, temperature scaling comprises multiple scaling factors, including per-output, per-class, grouped-output, or a combination thereof. In some embodiments, the offset terms and / or temperature-scaling parameters are selected, calibrated, reselected, and / or updated during iterative optimization, including in response to the incorporation of one or more accepted candidate topology changes.
[0100] An acceptance variant 534 is labeled “Acceptance criterion based on predefined threshold.” In some embodiments, the variant 534 accepts a candidate topology change when at least one evaluation score meets a predefined threshold. In some embodiments, the predefined threshold is static. In some embodiments, the predefined threshold is dynamic and may be adjusted during optimization, for example, by relaxing or tightening an acceptance criterion to explore trade-offs between functional quality and implementation cost. In some embodiments, the acceptance criterion requires that a quality metric satisfy an acceptance threshold and that a cost metric improve. In some embodiments, the threshold applies to output deviation, loss increase, score change, error increase, and / or another measure of acceptable degradation or non-degradation. In some embodiments, the threshold is determined in relation to metrics of other considered topology changes.
[0101] A second acceptance variant 536 is labeled “Acceptance criterion based on unchanged output scores, average loss, or plurality of criteria.” In some embodiments, the variant 536 accepts a candidate topology change when the output scores produced by the logic circuit remain unchanged across all evaluated reference input patterns. In some embodiments, the variant 536 includes accepting a candidate topology change when output scores remain unchanged for at least a threshold fraction of the evaluated reference input patterns. In some embodiments, the variant 536 accepts a candidate topology change when the average loss over the evaluated reference input patterns decreases or remains the same. In some embodiments, the variant 536 evaluates a plurality of acceptance criteria and accepts the candidate topology change when at least K of the plurality of criteria are satisfied, where K may be less than the total number of criteria. In some embodiments, the plurality of criteria may be weighted unequally.
[0102] In some embodiments, the candidate topology change ranking 550 stores a plurality of candidate topology changes, associated evaluation scores, associated metadata, and / or other information usable to select candidate topology changes for further evaluation and possible incorporation into the logic circuit. In some embodiments, the ranking 550 is represented as a list, an array, an unordered set, and / or another collection of candidate topology changes with associated scores. In some embodiments, the ranking 550 is populated using candidate topology changes generated according to one or more of the examples 520, 522, 524, and 526 and scored according to one or more of the variants 530, 532, 534, and 536. In some embodiments, the ranking 550 stores a predetermined number of the highest-scoring candidate topology changes. In some embodiments, the ranking 550 stores only the current best candidate topology change. In other embodiments, the ranking 550 stores multiple ranked candidate topology changes and metadata indicating whether a candidate has been considered, verified, accepted, rejected, or deferred. In some embodiments, the ranking 550 is updated based on the results of evaluating one or more candidate topology changes, including after acceptance or rejection of a selected candidate topology change. In some embodiments, the ranking 550 is populated and / or updated asynchronously and / or in parallel across multiple processor cores or threads.
[0103] In various embodiments, the examples and variants 510 are used in a ranking-guided optimization process, in a stochastic simplification process, and / or in a hybrid process combining both. For example, in some embodiments, a candidate topology change generated according to one of the examples 520, 522, 524, or 526 is inserted into the ranking 550 and later selected based on its ranking position for verification and possible application. In some embodiments, a candidate topology change is first selected stochastically, evaluated against one or more of the variants 530, 532, 534, and 536, and then inserted into or compared against entries in the ranking 550. In some embodiments, multiple candidate topology changes are proposed, and a combination of the multiple candidate topology changes may be accepted when collectively satisfying an acceptance criterion. Accordingly, the examples and variants 510 are illustrative of representative candidate-generation, evaluation, acceptance, and ranking approaches usable to simplify and optimize a logic circuit while maintaining acceptable behavior relative to reference input patterns.
[0104] FIG. 6 illustrates an example data-based stochastic logic simplification method 600 according to one embodiment. In various embodiments, the method 600 is performed by the logic circuit optimization system 100. In some embodiments, the method 600 iteratively simplifies a logic circuit by selecting circuit elements or connections using a stochastic selection process. The process may include proposing candidate topology changes, evaluating the candidate topology changes against reference input patterns, and incorporating accepted candidate topology changes into a description of the logic circuit. Although the method 600 is illustrated as including the particular steps 605, 610, 615, 620, 625, 630, 635, 640, and 645, the illustrated sequence is non-limiting. In various embodiments, one or more steps may be omitted, combined, subdivided, reordered, repeated, and / or executed in parallel.
[0105] At a receive step 605, the method 600 receives a description of a logic circuit and reference input patterns. In some embodiments, the logic circuit comprises a combinational logic circuit, a sequential logic circuit, a fixed logic gate network produced after training and discretization of, for example, a differentiable logic gate network, and / or another gate-level circuit representation. At a selection step 610, the method 600 selects a circuit element or connection using a selection process, such as a stochastic or a non-stochastic selection process. In some embodiments, the selection process is stochastic and comprises random selection, pseudo-random selection, probability-distribution-based selection, weighted random selection, and / or another non-deterministic or partially stochastic selection process.
[0106] In some embodiments, the selected circuit element or connection is selected from among gates, nodes, edges, wires, fan-in connections, fan-out connections, internal signals, and / or other portions of the logic circuit. In some embodiments, the selection step 610 selects a target circuit element that does not implement a trivial function. In some embodiments, the selection process is biased toward circuit elements or connections that have relatively high placement, routing, congestion, interconnect, latency, timing, area, and / or other implementation-related costs. In some embodiments, the selection step 610 is combined with a sequential traversal order and / or a ranking-guided process such that stochastic proposals may be generated for later insertion into a ranking.
[0107] At a proposal step 615, a candidate topology change for the selected circuit element or connection is proposed. In various embodiments, the candidate topology change comprises removing, disabling, rewiring, replacing, and / or otherwise modifying a selected gate, node, wire, connection, signal, or other circuit element. In some embodiments, the proposal step 615 proposes replacing a selected gate with a simpler operator. In some embodiments, the simpler operator is selected from a set comprising at least two of: a constant-TRUE operator, a constant-FALSE operator, a direct-connection operator that forwards a selected signal, and an inverter operator that inverts a selected signal. In some embodiments, the proposal step 615 includes a proposal to replace an internal activation signal with a constant value. In some embodiments, the proposal step 615 proposes merging two matching internal signals. In some embodiments, prior to proposing the candidate topology change at the proposal step 615, the method 600 stores a backup of the current function, gate choice, connection state, and / or circuit state corresponding to the selected circuit element or connection. In some embodiments, the selection step and proposal step are combined into a single step.
[0108] In some embodiments, the selection and / or proposal steps are based on an analysis of signal activity. For example, a signal that primarily has a certain activation may, in some embodiments, have a higher likelihood of resulting in good scores when replaced with a respective constant. In some embodiments, an additional analysis step identifies the sensitivity of the circuit to topology changes. For example, it may comprise for each circuit element in a subset of circuit elements, stochastically or randomly replacing them with constants TRUE and FALSE at a certain ratio and with a certain probability during propagation. For example, the effect of replacing a circuit element with a random bit generator may be indicative of the overall sensitivity of the architecture to changes to the respective circuit element. In some embodiments, following a traversal or partial traversal of circuit elements to identify, for example, those circuit elements for which an evaluation score has a low sensitivity can enable a more effective pre-selection for those circuit elements to subsequently consider throughout a number of optimization iterations. In some embodiments, metrics of sensitivity to changes may provide an informed pre-selection of candidates across optimization steps.
[0109] In some embodiments, circuit elements are enhanced by one or more criticality scores wherein a low criticality score may indicate that a failure of the respective circuit element has a minor effect on evaluation scores and wherein a high criticality score may indicate that a failure of the respective circuit element may have a major and / or negative effect on evaluation scores. In some embodiments, the criticality score may be based on a sensitivity analysis of the architecture to a variety of optionally randomized changes to a respective circuit element. For example, a consistent failure may be simulated (e.g., a fabrication defect, runtime independent, missing connection, etc.), or a randomized failure may be simulated (e.g., a connection or gate that sometimes, runtime dependent, does not meet timing or switch on time or reaches a required voltage). Based on criticality scores, redundancy may be integrated into the circuitry, either during the synthesis, during mapping, during place-and-route, or during another process. In some embodiments, integration of redundancy is contingent on local routing, for example, if an area is congested, a redundancy circuit element may be skipped. In some embodiments, circuit elements with a low criticality score may be physically implemented through physical circuit elements that have a higher risk of failure while improving other figures of merit, and circuit elements with a high criticality score may be physically implemented through physical circuit elements that have a lower risk of failure, potentially at the cost of other figures of merit.
[0110] In some embodiments, criticality scores may be used for biasing a selection of topology changes. In some embodiments, after an optimization, there may still be a significant number of circuit elements with a very low criticality score, wherein none of the respective circuit elements is critical for performance, but wherein a failure of each of them induces a graceful degradation, thereby favoring their inclusion in some embodiments. In some embodiments, a criticality score may be associated with a number of circuit elements for use during place-and-route. For example, a circuit may have 5% of its circuit elements with an indicated non-criticality and an allowance that 1% of these indicated non-criticality circuit elements may be omitted with high probability not degrading the logic circuit beyond a desired evaluation score threshold. In this example, after an initial place-and-route process that is not completed and with congestions or timing failure, the place-and-route tool may select up to 1% of the 5% of the circuit elements to be omitted in order to resolve congestions and / or meet timing. In various embodiments, this can improve a variety of figures of merit of a chip design, including achieving reduced area targets.
[0111] At an evaluation step 620, the method 600 evaluates the logic circuit with the candidate topology change using at least a portion of the reference input patterns. In some embodiments, the evaluation step 620 determines a quality metric for the candidate topology change. In some embodiments, the quality metric comprises one or more of: output equality, unchanged output scores, classification accuracy, output deviation, error rate, loss, average loss, confidence score, and / or another score determined using outputs of the logic circuit for at least a portion of the reference input patterns. In some embodiments, the evaluation step 620 further determines a cost metric, as described herein. In some embodiments, the evaluation step 620 uses a first subset of the reference input patterns during one pass, and a second, larger, different, and / or overlapping subset during another pass.
[0112] At a decision step 625, the method 600 determines whether an acceptance criterion is satisfied. In some embodiments, the acceptance criterion is satisfied when the quality metric is at least as good as a baseline quality metric for the logic circuit without the candidate topology change, or is not worse than the baseline quality metric by more than a predefined threshold. In some embodiments, the acceptance criterion is satisfied when the output scores produced by the logic circuit for all evaluated reference input patterns remain unchanged under the candidate topology change. In some embodiments, the acceptance criterion is satisfied when output scores are unchanged for at least a threshold fraction of the evaluated reference input patterns, such as at least R% of the evaluated reference input patterns, where R may be greater than 99%. In some embodiments, the acceptance criterion is satisfied when downstream signals are unchanged for at least a threshold fraction of the evaluated reference input patterns, such as at least R% of the evaluated reference input patterns, where R may be greater than 99%. In some embodiments, the acceptance criterion is based on a loss computed from the logic circuit’s outputs and labels corresponding to the reference input patterns, and is satisfied when the average loss over the evaluated reference input patterns does not increase. In some embodiments, the decision step 625 evaluates a plurality of acceptance criteria and treats the acceptance criterion as satisfied when at least K of the plurality of acceptance criteria are satisfied. In some embodiments, different candidate topology changes are evaluated under varying levels of strictness, including a less strict acceptance criterion for prioritized gates or connections. In some embodiments, the acceptance criterion may comprise accepting at least the best-evaluated candidate topology change among a number of evaluated candidate topology changes. In some embodiments, the acceptance criterion may be stochastic, for example, corresponding to a probability of accepting a change.
[0113] If the acceptance criterion is satisfied at the decision step 625, the method 600 proceeds to an update step 630. At the update step 630, the method 600 updates the description of the logic circuit to incorporate the candidate topology change. If the acceptance criterion is not satisfied at the decision step 625, the method 600 proceeds to a discard step 635. In some embodiments, discarding the candidate topology change includes leaving the logic circuit unchanged or reverting to a backed-up previous state. After either the update step 630 or the discard step 635, the method 600 proceeds to a decision step 640. At decision step 640, the method 600 determines whether iterative simplification is complete based on the various possible termination criteria described herein. If iterative simplifying is not complete at the decision step 640, the method 600 may return to the selection step 610 and repeat the stochastic selection, proposal, evaluation, and acceptance-testing process for one or more additional circuit elements or connections. In some embodiments, each iteration proposes a single candidate topology change. In other embodiments, one or more iterations propose multiple candidate topology changes and accept a combination of the multiple candidate topology changes when the combination satisfies an acceptance criterion.
[0114] If iterative simplifying is complete at the decision step 640, the method 600 proceeds to an output step 645. At the output step 645, the method 600 outputs a simplified description of the logic circuit, according to the various embodiments described herein. In some embodiments, the method 600 is used independently of ranking-guided optimization. In other embodiments, the method 600 is used in combination with ranking-guided optimization, such that one or more candidate topology changes proposed stochastically at the proposal step 615 are inserted into, compared against, and / or selected from a ranking of candidate topology changes.
[0115] FIG. 7 illustrates an example sub-logic-gate-network don’t-care simplification method 700 according to one embodiment. In various embodiments, the method 700 is performed by the logic circuit optimization system 100. In some embodiments, the method 700 is used to simplify a selected portion of a logic circuit by identifying observed input patterns to the selected portion, designating unobserved input patterns as “don’t-cares,” invoking a logic synthesis tool to simplify the selected portion using the don’t-cares, and selectively incorporating the simplified selected portion into a description of the logic circuit. Although the method 700 is illustrated as including the particular steps 705, 710, 715, 720, 725, 730, 735, 740, 745, and 750, the illustrated sequence is non-limiting. Moreover, in various embodiments, one or more steps may be omitted, combined, subdivided, reordered, repeated, and / or executed in parallel.
[0116] At a receive step 705, the method 700 receives a description of a logic circuit and reference input patterns. At a selection step 710, the method 700 may optionally select a sub-logic gate network of the logic circuit. In some embodiments, the selected sub-logic gate network may be selected based on size, location, observed activity, implementation cost, expected simplification opportunity, and / or another selection heuristic. In some embodiments, the selected sub-logic gate network is chosen independently of whether the simplification process to be used includes the ranking-guided and / or the stochastic proposal simplification / optimization methods described herein.
[0117] At a recording step 715, the method 700 records observed input patterns to the selected sub-logic gate network across at least a portion of the reference input patterns. In some embodiments, the logic circuit is simulated, evaluated, or otherwise exercised using the reference input patterns, and input patterns presented to the selected sub-logic gate network are collected, logged, counted, or otherwise recorded. At a designation step 720, the method 700 designates unobserved input patterns as don’t-cares for the selected sub-logic gate network. In some embodiments, the designation step 720 identifies possible input patterns for the selected sub-logic gate network that were not observed during the recording step 715 and marks those unobserved input patterns as don’t-cares. In some embodiments, the don’t-care designation indicates that one or more outputs of the selected sub-logic gate network need not preserve original behavior for input patterns that were not observed across the reference input patterns. In some embodiments, the designation step 720 designates only a subset of unobserved input patterns as don’t-cares. In some embodiments, prior to or as part of the selection step 710, the method 700 records combinations of values of multiple related internal signals across at least a portion of the reference input patterns, and then, based on the recorded combinations, selects the sub-logic gate network and / or a subset of circuit elements therein for subsequent don’t-care consideration.
[0118] In some embodiments, selection of the sub-logic gate network is based at least in part on previously identified don’t-care opportunities associated with internal signals and / or combinations of values of related internal signals. In some embodiments, the selected sub-logic gate network is defined such that its inputs correspond to boundary signals of a partition of the logic circuit, including internal signals of the overall logic circuit. Accordingly, the input patterns recorded for the selected sub-logic gate network need not correspond to primary inputs of the overall logic circuit, but may instead correspond to internal-signal values presented at a selected partition boundary.
[0119] At a synthesis-invocation step 725, the method 700 invokes a logic synthesis tool to simplify the selected sub-logic gate network using the don’t-cares. In some embodiments, the synthesis-invocation step 725 produces a simplified selected sub-logic gate network having fewer gates, reduced depth, reduced area, reduced routing burden, reduced delay, reduced power, and / or another implementation advantage. At an evaluation step 730, the method 700 evaluates the simplified selected sub-logic gate network using at least a portion of the reference input patterns. In some embodiments, the evaluation step 730 determines one or more evaluation scores, including one or more quality metrics, one or more cost metrics, and / or both, as described herein, according to various possible evaluations, metrics, losses, etc.
[0120] At a decision step 735, the method 700 determines whether an acceptance criterion is satisfied, according to any of the various embodiments and options for acceptance criteria described herein. If the acceptance criterion is satisfied at the decision step 735, the method 700 proceeds to an incorporation step 740. At the incorporation step 740, the method 700 incorporates the simplified selected sub-logic gate network into the description of the logic circuit. If the acceptance criterion is not satisfied at the decision step 735, the method 700 proceeds to a retention step 745. At the retention step 745, the method 700 retains the original selected sub-logic gate network.
[0121] After either the incorporation step 740 or the retention step 745, the method 700 proceeds to an output step 750. At the output step 750, the method 700 outputs a modified description of the logic circuit. In some embodiments, when the simplified selected sub-logic gate network has been incorporated at the incorporation step 740, the output step 750 outputs the modified description of the logic circuit, including the simplified selected sub-logic gate network. In some embodiments, when the original selected sub-logic gate network has been retained at the retention step 745, the output step 750 outputs the description of the logic circuit without the synthesized replacement. In some embodiments, the output step 750 stores, transmits, synthesizes, verifies, maps, and / or otherwise prepares the resulting logic circuit description for implementation or fabrication.
[0122] FIG. 8A illustrates an example plot 800 of area and AIG size as a function of dropped reference input patterns, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to the number of dropped reference input patterns, the left vertical axis corresponds to area, and the right vertical axis corresponds to AIG size. The dropped reference input patterns may correspond to patterns omitted from a care set, omitted from a reference set used for evaluation, or otherwise excluded from one or more subsets used for optimization, as described herein. In some embodiments, the solid line represents the area, and the dashed line represents the AIG size. In some embodiments, the retained and / or dropped reference input patterns are selected based on importance and / or representativeness, including via statistical analysis, machine-learning care set determination methods, and / or other care set determination methods.
[0123] In some embodiments, the plot 800 illustrates an example of how circuit-cost metrics vary as the number of constraining reference input patterns decreases. For example, area and AIG size may remain relatively stable over an initial range, then decrease more substantially as additional reference input patterns are removed. This illustrates the trade-off between preserving behavior on retained reference input patterns and reducing circuit cost. In some embodiments, the plot 800 is generated by optimizing the logic circuit using different numbers of retained and / or dropped reference input patterns according to various examples or embodiments described herein.
[0124] FIG. 8B illustrates an example plot 850 of train and test accuracies as a function of dropped reference input patterns from a set of 60,000 reference input patterns from the MNIST training dataset, according to one embodiment. In the illustrated example, the horizontal axis represents the number of dropped reference input patterns, and the vertical axis represents accuracy. The plot 850 includes a first curve labeled Train Acc and a second curve labeled Test Acc, corresponding to in-sample and out-of-sample accuracies, respectively, for optimized logic circuits generated using different numbers of retained and / or dropped reference input patterns.
[0125] FIG. 9A illustrates an example plot 900 of test error as a function of AIG size for different evaluation criteria, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to AIG size, and the vertical axis corresponds to test error. The plot 900 includes a first curve 910 labeled Eval Crit 1 and a second curve 920 labeled Eval Crit 2. In some embodiments, Eval Crit 1 corresponds to an evaluation criterion based on L1 loss, and Eval Crit 2 corresponds to an evaluation criterion based on softmax cross-entropy (CE) loss. The plot 900 illustrates that different evaluation criteria may provide different tradeoffs between test error and circuit size during approximate logic optimization. The plot 900 further illustrates empirically that the proposed systems and methods can reduce the circuit size and reduce the test error, thereby both improving the model in quality while reducing inference cost. The plot 900 illustrates execution of the method until a test error reaches around 2%. Nevertheless, using a model from any point on the horizontal axis is possible and within the scope of the disclosure. For example, a circuit with AIG size of around 50,000 may be selected, which may have an MNIST test accuracy of 98.7%.
[0126] FIG. 9B illustrates an example plot 950 of test error as a function of AIG size for a larger model under different criteria and variants, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to AIG size, and the vertical axis corresponds to test error. The plot 950 includes a first curve 955 labeled Crit 1, a second curve 960 labeled Crit 2, a third curve 965 labeled Crit 3, a fourth curve 970 labeled Crit 2 + Data Augmentations, and a fifth curve 975 labeled Crit 3 + Data Augmentations. In some embodiments, Crit 1 corresponds to a no-output-change criterion, Crit 2 corresponds to a criterion requiring a strict improvement in softmax cross-entropy (CE) loss, and Crit 3 corresponds to a ranking-based approach that approximates selection of the best change according to softmax CE loss. In some embodiments, the curves 970 and 975 correspond to variants of Crit 2 and Crit 3 with further data augmentations comprising shifts by up to 1 pixel of an image in any direction or combinations of directions. The plot 950 illustrates that different criteria and augmentation variants may provide different tradeoffs between test error and AIG size for the larger model. For example, lines 970 and 975 illustrate an AIG of size around 300,000 achieving an MNIST test accuracy of 99.4%, an AIG of size around 100,000 achieving an MNIST test accuracy of 99.3%, and an AIG of size around 50,000 achieving an MNIST test accuracy of 99%. In some embodiments, starting with a larger model may result in better resulting model quality at a certain size, while in some other embodiments, starting with a smaller model may result in a better resulting model quality at the certain size. In various embodiments, this depends on the circuit, the overall architecture of the circuit, the evaluation criterion, the reference input patterns, and / or other practical considerations.
[0127] FIG. 10A illustrates an example plot 1030 of area as a function of AIG size, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to AIG size, and the vertical axis corresponds to area. In some embodiments, AIG size corresponds to a size metric of an and-inverter-graph representation of a logic circuit, and area corresponds to mapped circuit area, estimated implementation area, and / or another implementation-cost metric. The plot 1030 shows that the area generally decreases as AIG size decreases, indicating that structural simplification of the logic circuit may correspond to reduced implementation cost.
[0128] FIG. 10B illustrates an example plot 1060 of train error and test error as a function of AIG size, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to AIG size, and the vertical axis corresponds to error. The plot 1060 includes a first curve labeled Train Error and a second curve labeled Test Error, corresponding to in-sample and out-of-sample error, respectively, for logic circuits or intermediate optimization states having different AIG sizes. In some embodiments, the plot 1060 illustrates a tradeoff between circuit simplification and inference quality. In some embodiments, the errors remain relatively low over an initial range of AIG sizes, then increase substantially as the logic circuit becomes smaller. In some embodiments, the plot 1060 may be used together with the plot 1030 of FIG. 10A to identify an operating point that balances error and implementation cost.
[0129] FIG. 10C illustrates an example plot 1090 of constant signals and matching signals as a function of AIG size, according to one embodiment. In the illustrated embodiment, the horizontal axis corresponds to AIG size, a first vertical axis corresponds to constants, and a second vertical axis corresponds to duplicates. In some embodiments, the curve labeled “Constants” corresponds to a number of internal signals that are constant or nearly constant across evaluated reference input patterns, and the curve labeled “Duplicates” corresponds to a number of matching, duplicated, or substantially duplicated internal signals across evaluated reference input patterns.
[0130] The plot 1090 shows that, in some embodiments, the number of constant signals and the number of matching signals generally increase as AIG size decreases. This behavior may indicate that progressive simplification exposes or creates additional opportunities for constant replacement, the merging of matching internal signals, the removal of duplications, and / or related candidate topology changes, as described herein. In various embodiments, the plots of FIGS. 8A-10C are illustrative and non-limiting. Different embodiments may use different tasks, data sets, evaluation subsets, threshold schedules, cost metrics, logic representations, and optimization procedures. Moreover, the specific numbers and rates may differ from those illustrated, depending on the implementation, according to any of the embodiments or combinations of embodiments described herein.
[0131] This disclosure has been made with reference to various exemplary embodiments, including the best mode. However, those skilled in the art will recognize that changes and modifications may be made to the exemplary embodiments without departing from the scope of the present disclosure. While the principles of this disclosure have been shown in various embodiments, many modifications of structure, arrangements, proportions, elements, materials, mathematical representations, combinations, and permutations of features, optional components, optional steps, and optional methods may be adapted for a specific environment and / or operating requirements without departing from the principles and scope of this disclosure. These and other changes or modifications, and all possible permutations and combinations of examples and embodiments disclosed, are intended to be included within the scope of the present disclosure.
[0132] This disclosure is to be regarded in an illustrative rather than a restrictive sense, and all such modifications are intended to be included within the scope thereof. Likewise, benefits, other advantages, and solutions to problems have been described with regard to various embodiments. However, benefits, advantages, solutions to problems, and any element(s) that may cause any benefit, advantage, or solution to occur or become more pronounced are not to be construed as a critical, required, or essential feature or element. Indeed, even inferior or non-optimized versions of the described embodiments are intended to be included within the scope of this disclosure. The scope of this disclosure includes the numbered claims below, and all claims and clauses in the applications to which this application claims priority, including all feasible combinations thereof.
Claims
1. A method for approximate optimization of a logic circuit, comprising:maintaining, in a memory, a ranking of a plurality of candidate topology changes to a description of a logic circuit;selecting, from the ranking, a candidate topology change for evaluation;evaluating the logic circuit with the candidate topology change using at least a portion of a set of reference input patterns for the logic circuit to determine at least one evaluation score; andresponsive to the at least one evaluation score satisfying an acceptance criterion, updating the description of the logic circuit to incorporate the candidate topology change.
2. The method of claim 1, wherein maintaining the ranking comprises initializing the ranking by traversing a subset of edges or nodes of the logic circuit and retaining a predetermined number of candidate topology changes based on their evaluation scores.
3. A method for optimizing a logic circuit, comprising:performing at least one optimization iteration on a description of a logic circuit using a set of reference input patterns, each optimization iteration comprising:selecting at least one candidate topology change to the logic circuit, where each candidate topology change is selected from a finite set of candidate topology changes, the finite set including at least one of: removing a circuit element, disabling a circuit element, or rewiring a circuit element;evaluating at least one candidate topology change using at least a portion of the reference input patterns to determine at least one evaluation score, each evaluation score based on an effect of the respective candidate topology change on outputs of the logic circuit;incorporating a candidate topology change into the description of the logic circuit in response to the candidate topology change satisfying an acceptance criterion based on one or more evaluation scores of one or more candidate topology changes,wherein the acceptance criterion permits incorporating a candidate topology change that alters one or more output values of the logic circuit for one or more of the reference input patterns; andoutputting a modified description of the logic circuit.
4. The method of claim 3, wherein the finite set of candidate topology changes includes one or more of: adding a circuit element, replacing a circuit element with a simpler operator, merging internal signals, replacing a circuit element with a constant, bypassing a node, collapsing a node, and sub-network simplification.
5. The method of claim 3, wherein the selected candidate topology change comprises a modification to a circuit element, and wherein the circuit element is a connection.
6. The method of claim 3, wherein at least one optimization iteration includes incorporating a candidate topology change that alters one or more output values of the logic circuit for one or more of the reference input patterns.
7. The method of claim 3, wherein the logic circuit has been trained, using an optimization that is stochastic mini-batch based and gradient-based, to perform a machine learning inference task, and the reference input patterns comprise data representative of inputs to the machine learning inference task.
8. The method of claim 3, wherein the logic circuit has been generated or trained to perform a machine learning inference task, and the reference input patterns comprise training data for the machine learning inference task.
9. The method of claim 8, wherein the logic circuit is a logic gate network that was, prior to the optimization, trained via gradient-based training of a differentiable relaxation of logic gate networks.
10. The method of claim 3, wherein the at least one evaluation score comprises a value of a loss function computed using outputs of the logic circuit obtained by processing at least a portion of the reference input patterns with the candidate topology change applied.
11. The method of claim 10, wherein the value of a loss function is further computed using ground-truth labels associated with the reference input patterns.
12. The method of claim 11, wherein the logic circuit, prior to optimization, has at least one error on a training data set.
13. The method of claim 12, wherein the optimization iterations introduce at least one new error and resolve at least one preexisting error in the logic circuit prior to optimization.
14. The method of claim 10, wherein the value of the loss function is further computed using outputs of a trained teacher neural network model associated with the reference input patterns.
15. The method of claim 3, wherein the at least one evaluation score comprises a softmax cross-entropy loss.
16. The method of claim 3, wherein the at least one evaluation score comprises a Kullback-Leibler (KL) divergence.
17. The method of claim 3, wherein the at least one evaluation score comprises a mean squared error loss.
18. The method of claim 3, wherein the at least one evaluation score comprises an L1 loss.
19. The method of claim 3, further comprising adjusting the acceptance criterion during at least one optimization iteration.
20. The method of claim 3, wherein the optimization reduces the number of logic gates in the logic circuit by at least 70%.
21. The method of claim 4, wherein a logic circuit represented by the modified description of the logic circuit attains a lower machine learning training data loss than the description of the logic circuit prior to optimization.
22. The method of claim 4, wherein a logic circuit represented by the modified description of the logic circuit attains a lower machine learning validation data loss than the description of the logic circuit prior to optimization.
23. The method of claim 3, wherein outputs of the logic circuit are aggregated using group sum operations to produce output scores, and wherein evaluating the at least one candidate topology change further comprises applying real-valued output offset scores to the output scores when determining the at least one evaluation score, without requiring that the real-valued output offset scores be directly realizable in circuitry.
24. The method of claim 3, wherein evaluating the at least one candidate topology change comprises determining:a quality metric based on outputs produced for at least a portion of the reference input patterns; andat least one of: (i) a cost metric of the logic circuit or (ii) a confidence level that the candidate topology change will reduce gate count.
25. The method of claim 24, wherein the acceptance criterion comprises (i) the quality metric satisfying an acceptance threshold and (ii) the cost metric improving.
26. The method of claim 24, further comprising:selecting a portion of the logic circuit;recording, across the reference input patterns, observed input patterns to the selected portion;designating unobserved input patterns as don’t-cares for the selected portion; andinvoking a logic synthesis tool to simplify the selected portion using the don’t-cares.
27. The method of claim 3, wherein at least one optimization iteration comprises proposing a set of multiple candidate topology changes and incorporating a combination of the multiple candidate topology changes that collectively satisfy the acceptance criterion.
28. The method of claim 3, further including a ranking process, the ranking process comprising:maintaining a ranking of a plurality of candidate topology changes, the ranking being populated by evaluating candidate topology changes using at least a portion of the reference input patterns;selecting at least one candidate topology change from the ranking in an order determined by the ranking; andwherein, after incorporation of a candidate topology change into the description of the logic circuit during at least one optimization iteration, the maintained ranking includes at least one remaining candidate topology change associated with at least one outdated evaluation score having been determined before the incorporation.
29. An application-specific integrated circuit (ASIC) with logic circuitry that embodies a logic circuit, manufactured using a process comprising:performing at least one optimization iteration on a description of a logic circuit using a set of reference input patterns, each optimization iteration comprising:selecting at least one candidate topology change to the logic circuit, where each candidate topology change is selected from a finite set of candidate topology changes, the finite set including at least one of: removing a circuit element, disabling a circuit element, or rewiring a circuit element;evaluating at least one candidate topology change using at least a portion of the reference input patterns to determine at least one evaluation score, each evaluation score based on an effect of the respective candidate topology change on outputs of the logic circuit;incorporating a candidate topology change into the description of the logic circuit in response to the candidate topology change satisfying an acceptance criterion based on one or more evaluation scores of one or more candidate topology changes,wherein the acceptance criterion permits incorporating a candidate topology change that alters one or more output values of the logic circuit for one or more of the reference input patterns; andoutputting a modified description of the logic circuit;technology mapping the modified description of the logic circuit to create an ASIC design; andfabricating the ASIC.
