Exhaustive search of optimal formulae for bilinear maps Svyatoslav - - PowerPoint PPT Presentation

exhaustive search of optimal formulae for bilinear maps
SMART_READER_LITE
LIVE PREVIEW

Exhaustive search of optimal formulae for bilinear maps Svyatoslav - - PowerPoint PPT Presentation

Exhaustive search of optimal formulae for bilinear maps Svyatoslav Covanov Supervisors: Jrmie Detrey and Emmanuel Thom Team CARAMBA January 16, 2017 Optimal formulae 1 Previous work 2 Contribution and experimental results 3


slide-1
SLIDE 1

Exhaustive search of optimal formulae for bilinear maps

Svyatoslav Covanov Supervisors: Jérémie Detrey and Emmanuel Thomé

Team CARAMBA

January 16, 2017

slide-2
SLIDE 2

1

Optimal formulae

2

Previous work

3

Contribution and experimental results

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 2 / 21

slide-3
SLIDE 3

Karatsuba

How to multiply two polynomials A = a0 + a1X and B = b0 + b1X ?

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 3 / 21

slide-4
SLIDE 4

Karatsuba

How to multiply two polynomials A = a0 + a1X and B = b0 + b1X ? A · B = a0b0 + (a1b0 + a0b1)X + a1b1X 2

1 Naive multiplication:

π0 = a0b0, π1 = a1b0, π2 = a0b1 and π3 = a1b1. We have A · B = π0 + (π1 + π2)X + π3X 2.

2 Karatsuba:

π0 = a0b0, π1 = a1b1 and π2 = (a0 + a1)(b0 + b1). We have A · B = π0 + (π2 − π0 − π1)X + π1X 2.

The bilinear rank is smaller than 3.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 3 / 21

slide-5
SLIDE 5

Short product

Πℓ : K[X]<ℓ × K[X]<ℓ → K[X]<ℓ (A, B) → A · B mod X ℓ For ℓ = 3, Π3 :     a0 a1 a2   ,   b0 b1 b2     →   a0b0 a1b0 + a0b1 a2b0 + a1b1 + a0b2   =   π0 π1 π2   Optimal decomposition: rk(Π3) = 5 a0b0, a1b1, a2b2, (a0 + a1)(b0 + b1), (a0 + a2)(b0 + b2)

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 4 / 21

slide-6
SLIDE 6

Matrix formalism

π0 =

  • a0

a1 a2

  • ·

  1   ·   b0 b1 b2   = a0b0 π1 =

  • a0

a1 a2

  • ·

  1 1   ·   b0 b1 b2   = a1b0 + a0b1 π2 =

  • a0

a1 a2

  • ·

  1 1 1   ·   b0 b1 b2   = a2b0 + a1b1 + a0b2

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 5 / 21

slide-7
SLIDE 7

Matrix representation of formulae:   1  

  • a0b0

,   1  

  • a1b1

  1  

  • a2b2

  1 1 1 1  

  • (a0+a1)(b0+b1)

  1 1 1 1  

  • (a0+a2)(b0+b2)

Decomposition:   1 1  

  • π1

=   1 1 1 1  −   1  −   1     1 1 1  

  • π2

=   1  +   1 1 1 1  −   1  −   1  

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 6 / 21

slide-8
SLIDE 8

Generators definition

Let G be the set of generators G =   (A, B) → (

  • i

λiai)(

  • j

µjbj) | λi ∈ K, µj ∈ K    . For the short product Π3 over F2, the generators are a0b0, a1b0, a2b0, a0b1, a1b1, a2b1, a0b2, a1b2, a2b2, (a0 + a1)b0, (a0 + a2)b0, . . .

     1   ,   1   ,   1   ,   1   , . . .   

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 7 / 21

slide-9
SLIDE 9

Problem to be solved

Let Tℓ = Span           1 · · · 0 ... . . . ... ... . . . · · · 0     ,      1 · · · 0 1 ... . . . ... ... . . . · · · 0      , . . . ,      · · · 1 ... . . . . . . ... ... 1 · · · 0          . Problem to be solved: Find all free families of minimal size F ⊂ G satisfying Tℓ ⊂ Span(F).

Definition

Let r ≥ 0. We denote by Sr all subspaces V ⊂ Mℓ,ℓ such that there exists {g0, . . . , gr−1} a free family of G satisfying V = Span(g0, . . . , gr−1). We denote by Sr,T all subspaces V ∈ Sr such that T ⊂ V .

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 8 / 21

slide-10
SLIDE 10

1

Optimal formulae

2

Previous work

3

Contribution and experimental results

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 9 / 21

slide-11
SLIDE 11

Naive algorithm

Naive algorithm

Input: ℓ, r Output: STℓ,r S ← ∅ for V ∈ Sr do ⊲ Sr = {Span(g0, . . . , gr−1) | ∀i, gi ∈ G} if Tℓ ⊂ V then S ← S ∪ {V } end if end for return S

Complexity: #Sr ≤ #G r

  • . For ℓ = 3 and K = F2, we have

#S5 = 157, 535 ≪ 1, 906, 884 = 49 5

  • .

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 10 / 21

slide-12
SLIDE 12

Incomplete basis improvement

BDEZ ’12 (Barbulescu, Detrey, Estibals, Zimmermann)

Input: ℓ, r Output: STℓ,r S ← ∅ for W ∈ Sr−ℓ do if Tℓ + W ∈ Sr then S ← S ∪ {Tℓ + W } end if end for return S

Complexity: #Sr−ℓ ≤ #G r − ℓ

  • . For ℓ = 3, #S2 = 980 ≪ 157, 535.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 11 / 21

slide-13
SLIDE 13

Automorphisms

We consider the action of couples (P, Q) (P and Q in GLℓ) on M ∈ Mℓ,ℓ: (P, Q) · M = P · M · QT. Let Stab(Tℓ) be the group of (P, Q) such that ∀M ∈ Tℓ, (P, Q) · M ∈ Tℓ.

Example

For ℓ = 3 and P = Q =   1 1 1 1  , (P, Q) ·   1 1 1   =   1 1 1 1 1   = π1 + π2 ∈ T3.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 12 / 21

slide-14
SLIDE 14

Search with stabilizers

Input: ℓ, r Output: STℓ,r S ← ∅ for W ∈ Sr−ℓ/ Stab(Tℓ) do if Tℓ + W ∈ Sr−ℓ then S ← S ∪ {Tℓ + W } end if end for return SStab(T)

Complexity: #Sr−ℓ/# Stab(Tℓ) ≈ #G r − ℓ # Stab(Tℓ). For ℓ = 3, #S2/ Stab(Tℓ) = 68, # Stab(Tℓ) = 32 and 49 2

  • /32 ≈ 37.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 13 / 21

slide-15
SLIDE 15

1

Optimal formulae

2

Previous work

3

Contribution and experimental results

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 14 / 21

slide-16
SLIDE 16

The rank is a distance

Rank is a distance D : (Φ, Ψ) → rk(Φ − Ψ).

Example

D 1

  • ,

1

  • = rk

1 −1

  • = 2.

We can extend the distance D to any set of formulae.

Definition (Neighbourhood)

Let S and S′ be sets of matrices. We define D(S, S′) as D(S, S′) = min

Φ∈S,Ψ∈S′ (rk(Φ − Ψ)) .

We denote by Vd(S) the d-neighbourhood of S.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 15 / 21

slide-17
SLIDE 17

Theorem

Let W ∈ Sr−ℓ be such that Tℓ ⊕ W ∈ Sr. Then there exists σ ∈ Stab(Tℓ) such that W ◦ σ ∈ V1(πℓ−1) ∩ V1(πℓ−2)

  • r

W ◦ σ ∈ V1(πℓ−1) ∩ V1(πℓ−1 − πℓ−2).

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 16 / 21

slide-18
SLIDE 18

Example with ℓ = 3 on F2

We have T3 = Span(a0b0

  • π0

, a1b0 + a0b1

  • π1

, a2b0 + a1b1 + a0b2

  • π2

) and the set of generators G satisfies #G = 49. set enumerated cardinality S2 980 S2 ∩ (V1(π2) ∩ V1(π1)) ◦ Stab(T3) 64 S2 ∩ (V1(π2) ∩ V1(π2 − π1)) ◦ Stab(T3) 144

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 17 / 21

slide-19
SLIDE 19

Improved search

Improved search

Input: n, r S ← ∅ for W ∈ (Sr−ℓ ∩ V1(πℓ−1) ∩ V1(πℓ−2)) / Stab(Tℓ) do if Tℓ + W ∈ Sr then S ← S ∪ {Tℓ + W } end if end for for W ∈ (Sr−ℓ ∩ V1(πℓ−1) ∩ V1(πℓ−1 − πℓ−2)) / Stab(Tℓ) do if Tℓ + W ∈ Sr then S ← S ∪ {Tℓ + W } end if end for return SStab(Tℓ)

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 18 / 21

slide-20
SLIDE 20

We compare our approach to the search with stabilizer: product time (s)

  • est. speed-up
  • nb. of solutions

ShortProduct4 3.0 10 1, 440 ShortProduct5 2.4 · 103 105 146, 944

Table: Computation of decompositions of the short product on a single core 3.3 GHz Intel Core i5-4590.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 19 / 21

slide-21
SLIDE 21

Matrix product 3 × 2 by 2 × 3

Πp,q,r : the bilinear map πi,j: the bilinear forms of the coefficients Equations for Π3,2,3: S6 ∩ V1(π1,1 + π2,2 + π3,3) S6 ∩ V1(π1,1 + π2,2) ∩ V1(π1,1 + π3,3) S6 ∩ V1(π1,1 + π2,2) ∩ V1(π1,2 + π3,3) S6 ∩ V1(π1,1 + π2,2) ∩ V1(π3,3) S6 ∩ V1(π1,1) ∩ V1(π2,2) ∩ V1(π3,3) product time (s)

  • est. speed-up
  • nb. of solutions

2 × 3 by 3 × 2 4.1 · 106 109 1, 096, 452 3 × 2 by 2 × 3 3.0 · 106 104 7, 056

Table: Computation of decompositions of the matrix product on a single core 3.3 GHz Intel Core i5-4590.

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 20 / 21

slide-22
SLIDE 22

Conclusion

We obtain interesting speed-up for symmetric bilinear maps such as matrix product and short product. What kind of predicates for polynomials product (small group of symmetry)? How to push computations further: possible to decompose matrix product 3 × 3 by 3 × 3?

Svyatoslav Covanov Exhaustive search of optimal formulae for bilinear maps January 16, 2017 21 / 21