Download presentation
Presentation is loading. Please wait.
Published byAllan McLaughlin Modified over 9 years ago
1
Polynomial Datapaths Optimization Using Finite Abstract Algebra(I) Presenter: 陳炳元 Graduate Institute of Electronics Engineering Graduate Institute of Electronics Engineering, NTU, MD – 526 ALCom Lab
2
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
3
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
4
2015/9/11 4 Introduction In recent years, complexity of arithmetic circuit design grows exponentially In order to make it more effective, it‘s necessary to reduce the cost and increase performance Optimization of the High Level design is necessary In RTL level most of DSP applications (such as audio, 、 video and other multimedia applications) use polynomials for optimization Our focus lies in the optimization of polynomials. The mathematical methods being used belong to abstract algebra
5
Problem and Motivation y = a0. x1 2 + a1. x1 + b0. x0 2 + b1. x0 + c. x0. x1
6
Fixed-Size Data-path: Modeling Control the datapath size: Fixed size * * Z8Z8 Z8Z8 Z 16 Z 32 * * Z 31 Image is Z p : integer values in 0,…, p-1 Fixed-size vector arithmetic Polynomials reduced %p Algebra over the field Z p
7
Example: Anti-Aliasing Function F = 1 = 1 = 2√a 2 + b 2 2√x Expand into Taylor series F ≈ 1 x 6 – 9 x 5 + 115 x 4 64 32 64 – 75 x 3 + 279 x 2 – 81 x 16 64 32 + 85 64 Coefficients are fractional! MAC x = a 2 + b 2 coefficients ab x F DFF
8
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
9
General Datapath Model Bit-vector operands with different word-lengths Input variables : {x 1,…, x d } Output variables : f x 1 ,..., x d , Image(f ) , p: primex 1 Z 2 n1,..., x d Z 2 nd, Image(f ) Z p, p: prime Model f as polynomial function f : … f : Z 2 n1 … Z 2 nd Z p
10
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
11
Previous Work Boolean Representations ( f: B → B ): BDDs, ZDDs etc. Moment Diagrams ( f: B → Z ): BMDs, K*BMDs, HDDs etc. Canonical DAGs for Polynomials ( f: Z → Z ) Taylor Expansion Diagrams (TEDs) Required: Representation for f: Z 2 m → Z 2 m SAT, MILP, Word-level ATPG, … Vanishing Polynomial
12
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
13
Polyfunctions over Z p Polynomials over Z p [x 1, …, x d ] Represented by polyfunctions from Z p [x 1, …, x d ] to Z p F 1 % p ≡ F 2 % p => they have the same underlying polyfunction f Use equivalence classes of polynomials f g Equivalence classes Z p [x 1, …, x d ] Z2mZ2m F2F2 F1F1 G2G2 G1G1 1
14
Unity polynomials: Requirement Generate unity polynomials U(x) Test if f (x) = q(x)U(x) + r(x) f (x) = q(x) + r(x) Required: To generate U(x) specific to given f (x) ZpZp Set of all unity polynomials f U Z p [x 1, …, x d ] 1 h: % p
15
Cyclic group Let G be a group, G is called cyclic if there is an element a G such that G =, a is called generator of G For example, (Z n, +) is a cyclic group with generator 1 (Z p \{0}, *) is also a cyclic group, and has some generator (we will prove it later)
16
Order (1) The order of a group is its cardinality, i.e., the number of its elements. (2) If G is a group and a G, then order of a is | |. (3) We denote the order of a group G by o(G) and the order of an element a by o(a).
17
Property Let G be a group and let a G, if o(a) = n then = { a 0, a 1, a 2,…,a n-1, a n,…} i.e. n is the smallest positive integer a n = e
18
Unit Element Definition: Let R be a ring and a R, if a -1 exists, then we say that a is a unit Theorem: Let an element a in Z n, then a is unit gcd(a, n)=1
19
Unit Element Proposition: Z p Let P be a prime, in Z p all nonzero elements are unit Let F be a field if F is a commutative ring with unity 1 and all nonzero elements are unit
20
Polynomial Function Let F be a function on n and Image(F) U( n ), then K > 0 s.t. F K is a unity function, where Theorem: Let F be a function on n and Image(F) U( n ), then K > 0 s.t. F K is a unity function, where U( n ) = { a n | gcd(a, n) = 1 } U( n ) = { a n | gcd(a, n) = 1 } Theorem: Let f: Z n1 X Z n2 x... x Z nd Z m be a function and f(t) =c t whenever t = (t 1, t 2, …, t d ). Then f is polynomial function = c t (mod m) has a solution
21
Example Let f: Z 2 Z 3 Z 4 by f(0,0) =1, f(0,1) =3, f(0,2) =1, f(1,0) =1, f(1,1) =0, f(1,2) =1 Then (t) 00 X 00 + (t) 01 X 01 + (t) 02 X 02 + (t) 10 X 10 + + (t) 11 X 11 + (t) 12 X 12 = f(t) (mod4), X 00 + t 2 X 01 + t 2 (t 2 - 1)X 02 + t 1 X 10 + t 1 t 2 x 11 + + t l t 2 (t 2 - 1)x 12 = f(t 1, t 2 ) (mod4), t 1 =0, 1; t 2 =0,1,2, then
22
Example X 00 = 1 (mod4), X 00 + X 01 = 3 (mod4), X 00 + 2X 01 + 2X 02 = 1 (mod4), X 00 + 0X 01 + 0X 02 + X 10 = 1 (mod4), X 00 + X 01 + 0X 02 + X 10 + X 11 = 0 (mod4), X 00 + 2X 01 + 2X 02 + X 10 + 2X 11 +2X 12 = 1 (mod4). Then we have X 00 = 1, X 01 = 2, X 02 = 0, X 10 = 0, X 11 = 1 and X 12 = 1, thus F = 1 + 2y + xy 2
23
Polynomial Function n In most cases, functions on n are not necessarily polynomial Theorem: Let P be a prime, then f is a function on Z p iff f is a polynomial Corollary: Every unity function on Z p is unity polynomial
24
Order of Element Let G = be a cyclic group of order n, then o(a m ) = n/d, whenever d = gcd(m, n) Proof: (a m ) n/d = (a n ) m/d = e Let K be any positive integer such that (a m ) K = e Claim: K ≥ n/d (a m ) K = e a mK = e n | mK n/d | mK/d n/d | K K ≥ n/d
25
Euler function Given any positive integer n. (n) is the of positive integers less than or equal to which are relatively to. The is known as the Euler function. i.e. (n) = | U( n ) | Given any positive integer n. (n) is the number of positive integers less than or equal to n which are relatively prime to n. The function is known as the Euler function. i.e. (n) = | U( n ) | Theorem: Let n be a positive integer, then Definition: Let p be a prime and k|p-1, we define R(k) ={a p * | o(a) = k} we define R(k) ={a p * | o(a) = k}
26
Theorem U(Z p ) is a cyclic Proof: Let s Z p \{0}and o(s) = k mean that s k = 1, may assume f(x) = x k – 1 in Z p. According to Fundamental Theorem of Algebra, every n-th polynomial has at most n roots {s, s 2,..., s k } is solution space of f=0. t 0 (s t ) k/d = (s k ) t/d = 1 o(s t ) < k | R(k) | (k) p - 1 = k|p-1 |R(k)| k|p-1 (k) | R(k) | = (k), k |p-1 | R(p-1) | = (p-1) > 0 Therefore, U(Z p ) is a cyclic
27
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
28
Algorithm 1: OPT_POLY (F, d, x, p, n) 2: F: polynomial; d: number of variables; 3: x[1... d]: list of input variables; p: prime 4: n[1... d]: list of bit-widths of input variables, x; 5: A = {1} ; 6: // search for generator 7: for i= 2 to p-1 do 8: Oi = order(i); 9: if (Oi == p-1) 10: then break; 11: end for 12: // A: set of elements of order 1 or k 13: for j= 2 to p-1 do 14: if (gcd(j, p-1) == (p-1)/k) // k divides p-1 15: then A = A { i j }; 16: end for
29
Algorithm 17: // construct the function g 18: for k= 0 to p-1 do k+1(mod r) +1 19: g(k) = A k+1(mod r) +1 ; // r = |A| 20: end for 21: //G is polynomial of g 22: G= solver(g); 23: U = G k ; // unity polynomial 24: quo= F/U; 25: rem= F%U; 26: F= quo + rem; 27: // reduction 28: for i= 1 to d do i 29: F= F%Y(0,0,..,ni,..,0); 30: end for
30
Outline Overall Optimization Problem Our Focus: Fractional Optimization of Fixed-size Fractional Arithmetic DatapathsOur Focus: Fractional Optimization of Fixed-size Fractional Arithmetic Datapaths Applications: DSP for audio, video, multimedia….Applications: DSP for audio, video, multimedia…. Problem Modeling Polynomial Functions over Finite FieldPolynomial Functions over Finite Field Limitations of Previous Work Theory and Approach Algorithm Conclusions & Future Work
31
Conclusions & Future Work Currently, partial results show good performance of our algorithm Fixed-size arithmetic circuit is a polynomial algebra over the finite field, Z p We presented an efficient algorithm to optimize polynomials Also our algorithm can deal with fractional coefficients Future work involves extensions for optimizing Multiple output polynomials(II) Complex polynomials …
32
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.