3 ms·
> Vectorization is a process by which floating-point computations in scientific code are compiled into special instructions that execute elementary operations (
by saagarjha 3y ago
> Vectorization is a process by which floating-point computations in scientific code are compiled into special instructions that execute elementary operations (+,-,*, etc.) or functions (exp, cos, etc.) in parallel on fixed-size vector arrays.
I guess this is a scientific computing course or something but I feel like even so it’s important to point out that most processors have many vector instructions that operate on integers, bitfields, characters, and the like. The fundamental premise of “do a thing on a bunch of data at once” isn’t limited to just floating point operations.
- westurner 3y agoVectorization (disambiguation) https://en.wikipedia.org/wiki/Vectorization https://en.wikipedia.org/wiki/Vectorization : > Array programming, a style of computer programming where operations are applied to whole arrays instead of individual elements > Automatic vectorization, a compiler optimization that transforms loops to vector operations > Image tracing, the creation of vector from raster graphics > Word embedding, mapping words to vectors, in natural language processing > Vectorization (mathematics), a linear transformation which converts a matrix into a column vector Vector (disambiguation) https://en.wikipedia.org/wiki/Vector https://en.wikipedia.org/wiki/Vector > Vector (mathematics and physics): > Row and column vectors, single row or column matrices > Vector space > Vector field, a vector for each point And then there are a number of CS usages of the word vector for 1D arrays. Compute kernel: https://en.wikipedia.org/wiki/Compute_kernel https://en.wikipedia.org/wiki/Compute_kernel GPGPU > Vectorization, Stream Processing > Compute kernels: https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units#Vectorization https://en.wikipedia.org/wiki/General-purpose_computing_on_g... sympy.utilities.lambdify.lambdify() https://github.com/sympy/sympy/blob/a76b02fcd3a8b7f79b3a88df50c19eb7aee33c17/sympy/utilities/lambdify.py#L182 https://github.com/sympy/sympy/blob/a76b02fcd3a8b7f79b3a88df... : > """Convert a SymPy expression into a function that allows for fast numeric evaluation [with the CPython math module, mpmath, NumPy, SciPy, CuPy, JAX, TensorFlow, SymPt, numexpr,] pyorch lambdify PR, sympytorch: https://github.com/sympy/sympy/pull/20516#issuecomment-784285458 https://github.com/sympy/sympy/pull/20516#issuecomment-78428... sympytorch: https://github.com/patrick-kidger/sympytorch https://github.com/patrick-kidger/sympytorch : > Turn SymPy expressions into PyTorch Modules. > SymPy floats (optionally) become trainable parameters. SymPy symbols are inputs to the Module. sympy2jax https://github.com/MilesCranmer/sympy2jax https://github.com/MilesCranmer/sympy2jax : > Turn SymPy expressions into parametrized, differentiable, vectorizable, JAX functions. > All SymPy floats become trainable input parameters. SymPy symbols become columns of a passed matrix.
- bee_rider 3y agoIt seems odd in a scientific computing class to not mention classic cray style vectors. I mean, they haven’t been popular for a while, but you never know, RISC-V might bring them back.
- Joker_vD 3y agoI thought I was crazy when looking at all those vector extensions piling up made me think "why not just have some generic-sized vector instructions, and then let the CPU to sort out what is the largest chunk size it actually supports internally" but apparently no, I am not! It was actually been done before and we might even have that again in the future. That's nice.
- r3ndr 3y agoARM's newer SVE/SVE2 instructions can do something like this now. SVE allows the vector length to vary between 128 and 2048 bits, at 128 bit increments. RISC-V's vector RVV instructions also allow the vector length to vary across different CPU implementations. This way, the same RVV vector code can run on different CPUs having different vector lengths.