microsoft / hummingbird

Hummingbird compiles trained ML models into tensor computation for faster inference.
MIT License
3.32k stars 274 forks source link

Kernel crashing while converting #663

Open EmanuelCastanho opened 1 year ago

EmanuelCastanho commented 1 year ago

RF was previously defined.

# Can crash sometimes
# Convert model to pytroch with Hummingbird-ml
RFconv = convert(RF, 'pytorch')

# Save Model Converted
RFconv.save(os.path.join(ResultsFolder, "RFmodel_V3"))

When I ran this on macOS it crashes the Jupyter kernel, this doesn't happen in Windows.

Screenshot 2022-12-15 at 16 14 19

interesaaat commented 1 year ago

Thanks for reporting this, but this is hard to debug. It crashes during conversion, not saving, right? Can you provide a stack trace and which versions are you using?

EmanuelCastanho commented 1 year ago

Yes, it crashes during conversion. Here is some information about my setup:

interesaaat commented 1 year ago

From the error log it looks that is something related to trailets? (Not an Hummingbird dependency)

error 23:29:05.817: Disposing session as kernel process died ExitCode: undefined, Reason: /Users/USER/miniconda3/envs/CreateModel-Env/lib/python3.9/site-packages/traitlets/traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.

Maybe on Windows worked because you had a newer trailets version? Can you please check?

EmanuelCastanho commented 1 year ago

I am using recent versions of traitlets on both machines (Windows - 5.3.0 and MacOS - 5.7.1), I tried to:

However, the kernel continued to crash on both cases when running convert.

I can't downgrade to versions bellow 5.0.0, because I have other libraries that depend on the most recent versions.