Lazy evaluation chain
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- rust
- Domínio
- data, performance
Direção de pesquisa
Start with the linked pull-request discussion, then inspect the existing ArrayBase methods that could move into ArrayOps. Review the proposed ArrayBase.chain(), LazyChain, and LazyChain.eval() API along with the ownership and copy-versus-in-place decision points. Done requires those design questions to be resolved and the lazy operation chain specified.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Motivation
Following from discussion starting here: https://github.com/rust-ndarray/ndarray/pull/1042#issuecomment-957134294
With contemporary systems, moving the data from memory into caches and registers often dominates the runtime of numerical algorithms depending on how many arithmetic operations they perform relative to each memory access. Fusing operations from multiple passes into a single pass increases this ratio and thereby the likelihood of efficient CPU utilisation. [1]
In theory this problem is solved using loops and/or mapv, but this doesn't provide a very user-friendly interface. Users who want to work at a high level still want to be able to use arr.pow(), arr.log() etc, but also retain the speed of this per-element processing (rather than applying each operation to each element and then the next operation to each element).
Proposed Changes
- We move a subset of the
ArrayBasemethods into anArrayOpstrait. Note: this probably can't be all methods because it can only work for methods that return an array, soaxes,as_slice,getetc don't necessarily make sense - This trait gets implemented by
ArrayBase, but also a new struct calledLazyChain(or something idk) LazyChaingets created byArrayBase.chain()LazyChainwill own (?) anArrayBase, as well as a list of operations that will be sequentially applied to it- Then,
LazyChain.eval()runs these operations sequentially on each element of the owned array, and then returns the modified array
Decision Points
- Names for structs and traits
- Should
LazyChainreturn a copy or a modified in-place array? - Should
LazyChainown the array or just borrow it? Should we have two different types do each?
- Linguagem predominante
- Rust
- Estrelas
- 4.3k
- Forks
- 391
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de rust-ndarray/ndarray
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
rust-ndarray/ndarray#1612 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
rust-ndarray/ndarray#1617 · 1 comentário ·
-
Stack overflow in `triu` Abertabug good first issue
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
rust-ndarray/ndarray#1615 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
rust-ndarray/ndarray#1610 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
rust-ndarray/ndarray#1609 ·
Todas as issues de rust-ndarray/ndarray
Issues semelhantes
-
risk:low runtime status:in-progress type:test
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
bevyengine/bevy#25861 ·