RFC: Example Rule "Gallery" to showcase CRC best practices?

オープン
#549 コメント 4 件 リアクション 4 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia
領域
documentation

調査の方向性

この issue では、ファイル、テスト、具体的なエントリーポイントが指定されていません。まず ChainRules の既存のドキュメント例と、リンクされているギャラリーのインスピレーションを確認し、その後、ギャラリーの範囲とコントリビューションモデルを明確にしてください。カスタム rrule と frule の例を紹介するための合意済みの構成と、外部パッケージの例をどのように選定するかについての決定があれば完了です。

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

説明

documentation

Following up on some Slack (#autodiff) discussion with @mzgubic, I want to float the idea of adding a CRC rule "gallery" to the ChainRules docs, inspired by analogous things in the plotting world (eg BeautifulMakie).

I think that best practices for rule authors have become a bit too complicated to sufficiently demonstrate with just one or two small examples per section in the docs, particularly with interplay between

  • custom structs & their constructors
  • higher order functions
  • CRC Thunks, Tangent types & AD callbacks

There are many clever rule authors in the wild who post helpful examples on Github/Discourse/Slack/Zulip but this information is very disaggregated and un-searchable. If there were some way for users to submit nice but less ultra-minimal examples and/or to aggregate relevant examples of custom rrule and frule definitions in published packages (as @ToucheSir suggested) I think linking to such a "gallery" from the CR docs would speed up the learning process for rule authors.

I would be glad to help realize such a thing if it seemed feasible and people wanted it.

Less organized thoughts from Slack:
A few custom rule examples I can find in forums but which I wouldn't know how to write based on CR docs:

  • Constructors of widely used AbstractArray subtypes like StaticArrays, StructArrays, etc.
  • LinearAlgebra methods of “implicit operator” types representing giant Matrices, eg from LinearMaps.jl
  • Iterative solver and partial decomposition methods involving the former, eg methods from IterativeSolvers.jl, KrylovKit.jl, Arpack.jl, etc, (“adjoint method” VJP rules)
  • Higher order function methods defined outside Base, often versions of map or reduce with parallelism.
  • Gradient accumulation into an InplaceableThunk of a custom struct
主要言語
Julia
スター
267
フォーク
66
平均マージ
1日 1時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDiff/ChainRulesCore.jl のほかの issue

JuliaDiff/ChainRulesCore.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

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

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