JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Turbo precondition checks

オープン
#286 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
789
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

説明

The readme warns

> We expect that any time you use the `@turbo` macro with a given block of code that you:
>
> Are not indexing an array out of bounds. `@turbo` does not perform any bounds checking.
> Are not iterating over an empty collection. Iterating over an empty loop such as for i ∈ eachindex(Float64[]) is undefined behavior, and will likely result in the out of bounds memory accesses. Ensure that loops behave correctly.
> Are not relying on a specific execution order. `@turbo` can and will re-order operations and loops inside its scope, so the correctness cannot depend on a particular order. You cannot implement cumsum with `@turbo`.
> Are not using multiple loops at the same level in nested loops.

The docs also warn

> Broadcasting an Array A when size(A,1) == 1 is NOT SUPPORTED, unless this is known at compile time (e.g., broadcasting a transposed vector is fine).

I assume turbo can't check these preconditions at runtime for performance reasons. During testing and debugging, I want to check the preconditions. Is it possible to enable these checks in a certain mode?

I count five checks. Are some of them more costly than others?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

5つの @turbo の前提条件を説明している README とドキュメントの箇所から始め、次に、テストまたはデバッグ中に @turbo がそれらの条件をどのように処理しているかを調査します。ランタイムチェックを有効にできるモードがあるかを判断し、実行可能なチェックとその相対的なコストを文書化します。その動作とカバレッジが明確に仕様化された時点で issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia
領域
performance
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。