# Any faster way of computing small gradients?

**URL:** <https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531>\
**Category:** Performance\
**Tags:** zygote, forwarddiff, symbolics, autodiff\
**Created:** [August 9, 2022, 12:47pm UTC](https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531 "2022-08-09T12:47:35Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [August 9, 2022, 3:04pm UTC](https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531/4 "2022-08-09T15:04:30Z")

</div>

Isn’t Jax using multithreading by default? If so, compare with that in Julia as well. What data type is Jax using? Could they be defaulting to Float32?

See, e.g thus thread for similar benchmarks

> [@Speed comparison matrix multiplication in Julia](https://discourse.julialang.org/t/speed-comparison-matrix-multiplication-in-julia/66656):
>
> Optimized version in Julia. (126ms opt. Julia vs. 676ms in Jax - Int32) (521ms opt. Julia vs. 2.2s in Jax - Int64) Using tullio Int32 using Tullio, BenchmarkTools, LoopVectorization # Row major a = Array(reshape(Int32.(1:2\*2000\*400), 2,2000,400)); b = Array(reshape(Int32.(1:2\*2000\*400), 2,400,2000)); @btime @tullio c[i, j, k] := $a[i, j, q] \* $b[i, q, k]; # 682ms using Tullio, BenchmarkTools, LoopVectorization # Column major a = Array(reshape(Int32.(1:2\*2000\*400), 2000,400,2)); b = Array(r…

---

_[View the full topic](https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531)._
