Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH,BUG: Allow strides without mem, fix empty byte-bounds#9453

Merged
asi1024 merged 2 commits into
cupy:mainfrom
seberg:strides-checks
Nov 6, 2025
Merged

ENH,BUG: Allow strides without mem, fix empty byte-bounds#9453
asi1024 merged 2 commits into
cupy:mainfrom
seberg:strides-checks

Conversation

@seberg

@seberg seberg commented Oct 29, 2025

Copy link
Copy Markdown
Member

It ended up a bit more than I thought... on the plus side:

  • Speed up creation slightly by avoiding use of Python functions for the bounds calculation.
  • Use cython side helper for byte-bounds, which also fixes a bug (NumPy 2 moved this function, but a different thing.)
  • Allow allocation if strides= is passed, closes ndarray constructor behavior mismatches when strides is given #7818 (Limited to what NumPy does, whether thought through or not...)

All of these are very small improvements, but since I started, let's finish it I guess.

It ended up a bit more than I thought... on the plus side:
* Speed up creation slightly by avoiding use of Python functions
  for the bounds calculation.
* Use cython side helper for byte-bounds, which also fixes a bug
  (NumPy 2 moved this function, but a different thing.)
* Allow allocation if `strides=` is passed, closes cupygh-7818
  (Limited to what NumPy does, whether thought through or not...)

In the end the speed up might be the most wortwhile thing here...
@seberg seberg requested a review from a team as a code owner October 29, 2025 12:20
@leofang

leofang commented Oct 29, 2025

Copy link
Copy Markdown
Member

/test mini

@leofang leofang added this to the v14.0.0rc1 milestone Oct 29, 2025
@kmaehashi kmaehashi added cat:enhancement Improvements to existing features prio:medium labels Oct 30, 2025
@seberg

seberg commented Oct 30, 2025

Copy link
Copy Markdown
Member Author

Hmmmm, lots of CI timeouts, just chance or real risk of a slowdown?

@leofang

leofang commented Oct 31, 2025

Copy link
Copy Markdown
Member

Hmmmm, lots of CI timeouts, just chance or real risk of a slowdown?

It's fixed by #9460.

@leofang

leofang commented Oct 31, 2025

Copy link
Copy Markdown
Member

/test mini

@asi1024

asi1024 commented Nov 6, 2025

Copy link
Copy Markdown
Member

I restarted some CIs that resulted in a timeout and confirmed that all tests passed.

@asi1024 asi1024 merged commit 0b06bfe into cupy:main Nov 6, 2025
47 checks passed
@seberg seberg deleted the strides-checks branch November 6, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:enhancement Improvements to existing features prio:medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ndarray constructor behavior mismatches when strides is given

4 participants