Skip to content

Mini matmul#599

Merged
FrancescAlted merged 76 commits intomainfrom
mini-matmul
Mar 23, 2026
Merged

Mini matmul#599
FrancescAlted merged 76 commits intomainfrom
mini-matmul

Conversation

@lshaw8317
Copy link
Collaborator

@lshaw8317 lshaw8317 commented Mar 6, 2026

Multithreaded matrix multiplication.

Unfortunately running the benchmark gives:

numpy finished in 2.36083722114563 s
blosc2 multithreaded finished in 10.80336594581604 s
multithreading failed :( 
blosc2 normal finished in 12.770190715789795 s
multithreading failed :( 
blosc2 normal with default chunks etc. finished in 7.302770137786865 s

so multithreaded is only faster for the specific chunk/block combos made in the bench.

Also:

  • tests still need to be added for the cases supposedly covered.

lshaw8317 and others added 30 commits March 2, 2026 15:04
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 3.3 to 3.4.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](pypa/cibuildwheel@v3.3...v3.4)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-version: '3.4'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
The 'NDArray.save' method does not path 'cparams' to the parent class 'copy'
consequently array is reprocessed with the default 'cparams'.

To observe the bug run the script below.

=================================================================
import os
import blosc2
import numpy as np

a = np.arange(10_000_000)
a = a * a

cparams = blosc2.CParams(
    codec=blosc2.Codec.ZSTD,
    clevel=9,
    filters=[blosc2.Filter.BITSHUFFLE],
)

ba = blosc2.asarray(a, cparams=cparams)
print(f"Blosc2 memory: size {ba.cbytes}\t cratio: {ba.cratio}")

outdir = "cache/"
prefix = "save"
fname = outdir + prefix + ".b2nd"
ba.save(fname, mode="w")
fsize = os.path.getsize(fname)
print(f"Blosc2 array save:\t saved file size = {fsize}\t cratio: {a.nbytes/fsize}")

=================================================================

You should see
~~~~~
Blosc2 memory: size 4370284      cratio: 18.74477722729232
Blosc2 array save:       saved file size = 12370369      cratio: 6.467066584675041
~~~~~

ba.cbytes  ---> 4370284
ba.cratio ---> 18.3

I.e. the array in memory has 'cbytes=4370284',
however the saved file has 12370369 bytes, which gives 'cratio' of about 6.5.
Also if the array is loaded back from the file, it is easy to see
that 'cparams' are different from the original array and changed to the
default one.

After the patch, the memory 'cbytes' are closely matching the saved file size
as well as 'cparams'
~~~~~
Blosc2 memory: size 4370284      cratio: 18.74477722729232
Blosc2 array save:       saved file size = 4370051       cratio: 18.30642251085856
~~~~~
fixing NDArray save method to use its own compression parameters
…uildwheel-3.4

Bump pypa/cibuildwheel from 3.3 to 3.4
First implementation of a VLArray store
FrancescAlted and others added 28 commits March 20, 2026 08:38
Preserve user vlmeta when BatchStore recreates its empty backing
SChunk during initial layout inference, avoid persisting empty
batch_lengths metadata that breaks vlmeta.getall() on empty stores,
and keep user meta/vlmeta when copy(storage=...) is used.

Add BatchStore regression tests covering:
- vlmeta preservation during inferred layout initialization
- clear()/delete-last on empty stores
- metadata preservation on copy(storage=...)
# Conflicts:
#	ANNOUNCE.rst
#	RELEASE_NOTES.md
#	pyproject.toml
#	src/blosc2/version.py
@FrancescAlted FrancescAlted merged commit e13ccaf into main Mar 23, 2026
17 checks passed
@FrancescAlted FrancescAlted deleted the mini-matmul branch March 23, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants