Tags: google/heir
Tags
add math_ext.softmax PiperOrigin-RevId: 952382817
Try more ISL performance improvements 1. Adds a "codegen-strategy" option to implementAssignLayout, which controls folding vs loop generation. When the strategy is AUTO, the code first calculates the number of points in the relation (which is 10x faster than enumeration), and then if that is large, it generates a loop instead of folding. 2. Modifies the method to identify zero-diagonals, which was making the BSGS kernel generation rather slow for the hotword model. For (1), the timing improvement is: ``` Benchmark / Relation │ Size (Points) │ Baseline (Folding) │ mdgrs Patch (Folding)│ Hybrid (AUTO) │ Strategy Used │ Overall Speedup (vs Baseline) ──────────────────────┼────────────────────┼────────────────────┼──────────────────────┼────────────────────┼───────────────────┼─────────────────────────────── Relation 1 │ 8,192 │ ~9 ms │ ~9 ms │ ~10 ms │ FOLD │ ~1.0x (No regression) Relation 2 │ ~45,474 │ ~394 ms │ ~119 ms │ ~60 ms │ LOOP │ ~6.5x Relation 3 │ ~1,078,272 │ ~2.75 s │ ~2.60 s │ ~227 ms │ LOOP │ ~12.1x ``` For (2), I added a new benchmark binary for getCtComplement which reports (after this change, because the before had some very long runtimes I didn't wait to finish). These layouts were all pulled from the hotword model's convolutions just before convert-to-ciphertext-semantics. ``` ---------------------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------------------- BM_GetCtComplementPoints_Layout4 0.636 s 0.635 s 1 BM_GetCtComplementPoints_Layout8 0.549 s 0.548 s 1 BM_GetCtComplementPoints_Layout13 3.98 s 3.98 s 1 BM_GetCtComplementPoints_Layout17 0.659 s 0.659 s 1 BM_GetCtComplementPoints_Layout19 2.01 s 2.01 s 1 BM_GetCtComplementPoints_Layout24 3.05 s 3.05 s 1 BM_GetCtComplementPoints_Layout27 0.336 s 0.336 s 2 BM_GetCtComplementPoints_Layout29 1.45 s 1.45 s 1 BM_GetCtComplementPoints_Layout34 2.58 s 2.58 s 1 BM_GetCtComplementPoints_Layout37 0.260 s 0.260 s 3 BM_GetCtComplementPoints_Layout39 0.009 s 0.009 s 81 ``` After these changes, convert-to-ciphertext-semantics is down from 195 seconds on the hotword model to 19 seconds, and the total compile time (before it crashes at secret-to-ckks) is 33 seconds. Still more to do! PiperOrigin-RevId: 951097379
remove docker directory (unneeded now that we have hermetic llvm) PiperOrigin-RevId: 949206326
Add all domain variables to schedule by default This will replace some of the more complex loop arithmetic with simpler (but possibly more deeply nested) loop structures. More importantly, it dramatically cuts down on compile time, because ISL can generate loops much quicker when it doesn't have to project out variables we've omitted from the schedule. PiperOrigin-RevId: 948491835
PreviousNext