gussmith23 / glenside

A pure, low-level tensor program representation enabling tensor program optimization via program rewriting. See the web demo at https://gussmith23.github.io/glenside-web-demo/
71 stars 10 forks source link

Memoization #59

Open hypercubestart opened 4 years ago

hypercubestart commented 4 years ago

working on #7,

test_name original memo
access_cartesian_product 28,724 ns/iter (+/- 3,391) 30,334 ns/iter (+/- 3,681)
access_concatenate_0 1,341 ns/iter (+/- 105) 3,336 ns/iter (+/- 305)
access_concatenate_1 1,754 ns/iter (+/- 147) 3,690 ns/iter (+/- 1,929)
access_pad 2,294 ns/iter (+/- 229) 3,094 ns/iter (+/- 846)
access_pair_0 1,506 ns/iter (+/- 124) 3,455 ns/iter (+/- 244)
access_pair_1 2,196 ns/iter (+/- 198) 4,131 ns/iter (+/- 221)
access_pair_2 2,126 ns/iter (+/- 113) 4,056 ns/iter (+/- 235)
access_slice_0 861 ns/iter (+/- 93) 2,031 ns/iter (+/- 204)
access_slice_1 915 ns/iter (+/- 514) 1,987 ns/iter (+/- 104)
access_slice_2 1,138 ns/iter (+/- 328) 2,243 ns/iter (+/- 143)
access_windows 21,145 ns/iter (+/- 2,394) 22,899 ns/iter (+/- 2,094)
compute_dot_product_0 2,126 ns/iter (+/- 605) 3,115 ns/iter (+/- 167)
compute_dot_product_1 3,288 ns/iter (+/- 382) 4,318 ns/iter (+/- 305)
compute_elementwise_add_0 1,199 ns/iter (+/- 80) 2,152 ns/iter (+/- 655)
compute_elementwise_mul_0 1,219 ns/iter (+/- 144) 2,132 ns/iter (+/- 228)
compute_reduce_sum_0 1,985 ns/iter (+/- 218) 3,019 ns/iter (+/- 244)
compute_reduce_sum_1 1,203 ns/iter (+/- 274) 2,175 ns/iter (+/- 283)
compute_reduce_sum_2 1,736 ns/iter (+/- 174) 2,709 ns/iter (+/- 477)
compute_reduce_sum_3 1,146 ns/iter (+/- 74) 2,071 ns/iter (+/- 150)
compute_relu_0 610 ns/iter (+/- 33) 1,518 ns/iter (+/- 119)
compute_relu_1 643 ns/iter (+/- 52) 1,526 ns/iter (+/- 108)
mobilenet_shallow stack overflow 114,933,006 ns/iter (+/- 2,813,140)
hypercubestart commented 4 years ago

on hold for now...because of difficulty of getting lifetimes to work out. Ideally, we could use ArrayViews that reference owned arrays already in the hashmap, but Rust doesn't like this.