fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.6K
active users

#vectorization

0 posts0 participants0 posts today

RISC-V: векторное расширение и алгоритм Витерби

Недавняя публикация о векторном расширении RISC-V архитектуры, подтолкнула меня к мысли написать небольшую заметку об использовании данного расширения в задаче, имеющей практическое применение. После появления векторного расширения, в сети начали публиковаться статьи о применении RISC-V ядер с данным расширением в задачах, ранее в которых безальтернативно использовались только процессоры ЦОС. В данной статье рассматривается тест, в котором используется алгоритм декодирования Витерби - задача, требующая значительных вычислительных ресурсов.

habr.com/ru/articles/902744/

ХабрRISC-V: векторное расширение и алгоритм ВитербиНедавняя публикация о векторном расширении RISC-V архитектуры, подтолкнула меня к мысли написать небольшую заметку об использовании данного расширения в задаче, имеющей практическое применение. После...

Why in the world does VADDPD (floating-point addition) have a worse throughput than VFMADD132PD (floating-point multiplication and addition) on 2014 Intel Haswell chips
I might genuinely start performing a fused multiply by 1.0 in order to speed my code up

Replied in thread

@dmian @papernoise Cool to see that comparison, and details. You can even try by pushing the "smooth corners" to 1.34, it will produce curves without any kinks or cusps. See that very old article drawingcurved.osp.kitchen/Potr - As far as I know, the #vectorization in #inkscape is using #potrace, probably the last version 1.16 so it has not change for years.

drawingcurved.osp.kitchenDrawing Curved → Potrace_alphamax_1 334.md

Что ищет он в краю далёком? Как найти смысл жизни с PostgreSQL

Эта статья родилась из пары лекций, которые я прочитал студентам в рамках курса, посвященного вопросам машинного обучения. Почему именно PostgreSQL? Почему векторы? За последние два года тема языковых моделей стала невероятно популярной, и вместе с этим появилось множество инструментов, доступных даже начинающему инженеру, стремящемуся познакомиться с миром текстового анализа. Доступность этих технологий открывает безграничные возможности для их применения в самых разных областях: от систем управления знаниями до «копилотов», помогающих более тщательно анализировать анамнез пациентов, или информационных киосков, позволяющих собрать идеальную корзину товаров для пикника. Вряд ли данная работа может похвастаться полнотой или глубиной, однако, я надеюсь, что она предоставит те самые “хорошие” точки входа, которые позволят, погружаясь в детали, открыть для себя множество новых интересных и полезных тем для исследований и инженерных проектов. Откроем скрытые смыслы

habr.com/ru/articles/855712/

ХабрЧто ищет он в краю далёком? Как найти смысл жизни с PostgreSQLАннотация Эта статья родилась из пары лекций, которые я прочитал студентам в рамках курса, посвященного вопросам машинного обучения. Почему именно PostgreSQL? Почему векторы? За последние два года...

I have so many good ideas for polyfilling SIMD instructions in older instruction sets and I don't know how to put them in my library properly

You want PCMPEQQ but don't have SSE4.1? No worries, do a PCMPEQD, use PSHUFD to swap pairs of dwords, then PAND with the original result (3 cycles).

PSRLB? Just PSRLD and PAND out some bits (2 cycles).

PSRAQ? Use PSRLQ, and OR the result with the negation of the shifted MSB (i.e. PSRLQ, PAND, PSUB, POR, 4 cycles). For PSRAB, do the same, but do an additional PAND (concurrently with the PAND / PSUB) to mask out overlapping high bits.

Want a VPOPCNTB for cheap? Perform two PSHUFBs (one on the low bits, one on the high bits, both with masking) to popcount nibbles and add their results. Even older CPUs should be able to do that in 3 cycles. For VPLZCNTB / VPTZCNTB, use PMIN/PMAX instead of adding the results.

#npsimd#intel#simd

AVX2 tip! `PANDN(x, PCMPEQB(y, 0))` where the MSB of `y` is always unset can be transformed into `PSIGN(y, x)`. If you want to mask some elements `x` based on whether an input `y` is non-zero, and the MSB of `y` is always unset, you can multiply `x` by the sign of `y` (which will be 0 or 1) in 1 cycle using `PSIGN`. I think this is actually a pretty common pattern, but compilers can't really see it because of the MSB check.

Given a bit-mask with consecutive sequences of set elements, if you want to unset an entire sequence based on the first (least-significant) element, calculate a 1 for every first element to be masked out, add it to the original bit-mask, then AND it with the original bit-mask. This is very helpful for vectorized lexing!

AVX-512's VPCOMPRESS instruction is so damn cool. For a simple array filtering problem (retain in-place only even 32-bit numbers out of a 256MiB array), it'll out-perform native C code by a factor of 10x. The C code executes at about 800MHz, while the AVX512 code executes at about 90MHz - it's just 100 times more productive with the cycles it executes.

Holy shit, `VPSHLDQ` is so cool! On my laptop, the scalar `SHLD` on 64-bit GPRs is 1-3 cycles of latency. `VPSHLDQ` does the same thing (with a constant shift value, which is fine for my use case) on a 8x64-bit ZMM register with just 1 cycle of latency. I can perform the same operation 8-24 times faster!