hellas-ai / hellas-ai/catgrad

Use ArcArray in `ndarray` backend

Open
#179 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
34
Forks
7
PR merge metrics
No merged PRs in 30d

Description

# Problem

catgrad's `interpreter::backend::Backend` generally assumes that ops take *ownership* of tensors.
This means they can deallocate them, or even re-use input tensors to write outputs, avoiding allocating additional memory.

However, *parameters* cannot have ownership transferred without (inefficiently) cloning the whole tensor.

# Task

Change Backend::NdArray type for `ndarray` backend to use ArcArrayD instead (so we can cheaply clone parameter tensors).

# Outcome

- Patched `ndarray` backend using `ArcArrayD` for its `NdArray` type
- Criterion Benchmark showing improvement over baseline (current) implementation

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.