ndstrides: [11] Implement general matmul & np_dot() #521

Open
lyken wants to merge 2 commits from ndstrides-11-matmul into ndstrides-10-ops
Collaborator
  1. Reimplements np_dot. There is no improvement on the types of ndarrays np_dot can handle. It is still limited to 1D 'dot' 1D and scalar 'dot' scalar.
  2. Adds general matrix multiplication.
    • 1D @ 2D, 2D @ 1D, and stacking are now supported.
    • Solves #397 (ndarray 1D matrix multiplication).

Other notes

On matmul's signature: Is the typechecker type correct? I have also encountered the same issue like np_size() when the other_ty of impl_matmul is simply set to [ndarray_unsized_t] - primitives.ndarray's dtype and ndims are substituted permanently. See commit "core/ndstrides: implement general matmul".

1. Reimplements `np_dot`. There is ***no*** improvement on the types of ndarrays `np_dot` can handle. It is still limited to 1D 'dot' 1D and scalar 'dot' scalar. 2. Adds general matrix multiplication. - 1D @ 2D, 2D @ 1D, and stacking are now supported. - Solves https://git.m-labs.hk/M-Labs/nac3/issues/397 (ndarray 1D matrix multiplication). ### Other notes On matmul's signature: Is the typechecker type correct? I have also encountered the same issue like `np_size()` when the `other_ty` of `impl_matmul` is simply set to `[ndarray_unsized_t]` - `primitives.ndarray`'s `dtype` and `ndims` are substituted permanently. See commit "core/ndstrides: implement general matmul".
lyken added 1 commit 2024-08-28 14:14:38 +08:00
lyken added 1 commit 2024-08-28 14:15:51 +08:00
lyken added a new dependency 2024-08-28 14:21:29 +08:00
lyken added a new dependency 2024-08-28 14:21:39 +08:00
lyken changed title from ndstrides: [11] Implement general matmul to ndstrides: [11] Implement general matmul & `np_dot()` 2024-08-30 15:00:18 +08:00
lyken force-pushed ndstrides-11-matmul from 75b2e80418 to 4baf1c64ed 2024-08-30 15:08:04 +08:00 Compare
Author
Collaborator

Rebased.

Rebased.
derppening force-pushed ndstrides-11-matmul from 4baf1c64ed to e7aa2688e6 2024-10-18 14:33:31 +08:00 Compare
derppening force-pushed ndstrides-11-matmul from e7aa2688e6 to 7a3e34eb7a 2024-10-18 14:41:02 +08:00 Compare
derppening force-pushed ndstrides-11-matmul from 7a3e34eb7a to 693b7f3774 2024-10-18 15:01:47 +08:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ndstrides-11-matmul ndstrides-10-ops
git pull origin ndstrides-11-matmul

Step 2:

Merge the changes and update on Gitea.
git checkout ndstrides-10-ops
git merge --no-ff ndstrides-11-matmul
git push origin ndstrides-10-ops
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: M-Labs/nac3#521
No description provided.