cupy / cupy/cupy

ndarray.set() is dramatically slower when the input is a non contiguous array

Open
#6,771 3 comments 1 reaction 1 assignee Claimed by @asi1024 View on GitHub
cat:performance st:needs-discussion
Dominant language
Python
Stars
12.3k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
45

Description

### Description

.set() is much slower when the input is slice of a multidimensional array. I think the offending line is
https://github.com/cupy/cupy/blob/f0d0e7b2675a232c12e59badd5a6c42c5815ef1c/cupy/_core/core.pyx#L1779

I think using this function hurts performance by having to do this reshuffle, and furthermore if the original arrays are in pinned memory then this logic isn't preserving the pinned memory benefit.

### To Reproduce

```py
# Write the code here
```

### Installation

_No response_

### Environment

```
# Paste the output here
```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.