modularml / max

A collection of sample programs, notebooks, and tools which highlight the power of the MAX Platform
https://www.modular.com
Other
322 stars 41 forks source link

[BUG]: NumPy 2.0 breaking on example model #178

Closed oliverwalsh7 closed 3 months ago

oliverwalsh7 commented 3 months ago

Bug description

hey team,

looks like there could be some breaking changes with the NumPy 2.0 release on the example project for Max.

I'm on latest versions for all facets of my developer environment, when running bash run.sh in the Get started with max guide:

+ python3 ../common/bert-torchscript/download-model.py -o ../../models/bert-mlm.torchscript --mlm

now yields

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.```

### Steps to reproduce

- Include relevant code snippet or link to code that did not work as expected.
- If applicable, add screenshots to help explain the problem.
- Include anything else that might help us debug the issue.

### System information

```shell
- What OS did you do install MAX on ?  
  - Sonoma 14.5
- Provide version information for MAX by pasting the output of max -v`
  - max 24.4.0 (59977802)
  - Modular version 24.4.0-59977802-release
- Provide version information for Mojo by pasting the output of mojo -v` 
  - mojo 24.4.0 (59977802)
- Provide Modular CLI version by pasting the output of `modular -v`
  - modular 0.8.0 (39a426b5)
jackos commented 3 months ago

Hi @oliverwalsh7 did you mean to close this ticket? Does having a numpy1 in your modules allow you to use MAX or do you still get that error? We should update to numpy2, looks like it's backwards compatible.

oliverwalsh7 commented 2 months ago

hey @jackos, sorry I just caught this response. I think I was able to fix the issue by including numpy1? I can try to reproduce if needed, thanks!

ehsanmok commented 2 months ago

Thanks should be fixed already! please pull the changes off of the main branch.

jackos commented 2 months ago

No worries I locked the examples requirements to numpy<2, will update when they all support numpy 2

oliverwalsh7 commented 2 months ago

thanks a ton!