mteb icon indicating copy to clipboard operation
mteb copied to clipboard

Allow Numpy >=2.0

Open mgraczyk opened this issue 1 year ago • 9 comments

Checklist

  • [x] Run tests locally to make sure nothing is broken using make test.
$ make test
...
=================================================================================== 944 passed, 236 skipped, 287 warnings in 146.92s (0:02:26) ====================================================================================
  • [x] Run the formatter to format the code using make lint.
~/dev/mteb> make lint
--- 🧹 Running linters ---
ruff format .                   # running ruff formatting
695 files left unchanged
ruff check . --fix      # running ruff linting
All checks passed!

Fixes #1263

mgraczyk avatar Sep 29 '24 20:09 mgraczyk

I'm currently running the tests in a docker container python:3.10-bullseye to see what is going wrong with the AUC test

mgraczyk avatar Sep 30 '24 19:09 mgraczyk

I don't have an x86 machine handy right now, and running with mac ARM emulation is very slow (running for > 30 minutes) I can run later, otherwise somebody else could run this on an x86 machine

mgraczyk avatar Sep 30 '24 19:09 mgraczyk

The issue is that np.argsort' is stable by default in numpy 2.0 I switched to stable=True` so that results match between numpy 1.0 and 2.0, and between different platforms

mgraczyk avatar Sep 30 '24 23:09 mgraczyk

@isaac-chung The tests should be good to rerun now

mgraczyk avatar Sep 30 '24 23:09 mgraczyk

Hmm looks like for python 3.9 and 3.10 numpy 2.0.0+ was installed in the tests. For Python 3.8, numpy 1.24 was installed, and "stable" doesn't seem to be a valid keyword for argsort (test).

isaac-chung avatar Oct 01 '24 18:10 isaac-chung

Looks like numpy 2.0 dropped support for Python 3.8 I can add a wrapper that uses one or the other conditionally

mgraczyk avatar Oct 02 '24 01:10 mgraczyk

Looks like numpy 2.0 dropped support for Python 3.8 I can add a wrapper that uses one or the other conditionally

I think I am more for dropping support for 3.8 it is getting close to end-of-life anyway (end of this month).

(@Muennighoff looping you in here as well)

KennethEnevoldsen avatar Oct 03 '24 09:10 KennethEnevoldsen

Ok, this isn't urgent so I'll probably just wait until Python 3.8 is dropped, then try to merge this as-is without a workaround

mgraczyk avatar Oct 03 '24 17:10 mgraczyk

Dropping Py3.8 now or later; either works w/ me

Muennighoff avatar Oct 03 '24 17:10 Muennighoff

Dropped 3.8 in #1281

KennethEnevoldsen avatar Oct 06 '24 14:10 KennethEnevoldsen

@mgraczyk updating from main should resolve outstanding issues and we can merge this in

KennethEnevoldsen avatar Oct 06 '24 15:10 KennethEnevoldsen

@KennethEnevoldsen Thanks! Just rebased

mgraczyk avatar Oct 07 '24 03:10 mgraczyk

When I'm trying to run mteb with numpy<2.0, then I got this error TypeError: argsort() got an unexpected keyword argument 'stable'. Maybe bump version in pyproject? @KennethEnevoldsen

Samoed avatar Oct 12 '24 14:10 Samoed

Yeah you may need to keep support for <2.0 in some way, because many other libraries that could be used with MTEB do not yet support 2.0 (unstructured, for example)

mgraczyk avatar Oct 12 '24 22:10 mgraczyk

Def. agree - Added a PR here: #1291

KennethEnevoldsen avatar Oct 14 '24 10:10 KennethEnevoldsen