Skip to content

LightGBM.Fit() exits with 139 on osx-arm64 #6966

Closed

Description

@gijs-koehorst

System Information:

  • OS & Version: MacOS (M3) Sonoma 14.2.1
  • ML.NET Version: ML.NET 3.0.1
  • .NET Version: 7.0
  • ML.LightGbm 3.0.1
  • LightGBM 4.2.0

Describe the bug
ML.LightGBM by default does not include a binary for osx-arm64. To circumvent this we manually built a lib_lightgbm.dylib binary for arm and copied it to /bin/Debug/net7.0/runtimes/osx-arm64/native. This worked for ML.NET 2.0.0 and ML.LightGBM 2.0.0. However, after upgrading to the above versions and manually adding the lib_lightgbm.dylib of LightGBM 4.2.0, calling BinaryClassificationModel.Trainers.LightGbm.Fit() exits with exit code 139 without any error message.

To Reproduce
Steps to reproduce the behavior:

  1. Add lib_lightgbm.dylib of LightGBM 4.2.0 to /bin/Debug/net7.0/runtimes/osx-arm64/native
  2. Create a BinaryClassificationModel.Trainers.LightGbm
  3. Call Fit() with some data

Expected behavior
I would expect the LightGBM model to simply train on the data.

Activity

  1. ghost added
    untriagedNew issue has not been triaged
    on Jan 19, 2024
  2. ericstj commented on Jan 22, 2024

    @ericstj
    Member

    Perhaps this has to do with the version of LightGBM codebase you are building? @michaelgsharp updated our version and had to react to a breaking change in #6880.

    If you were using an earlier version (that worked with 2.0.0 as you suggest) then that would be broken with 3.0.0. Could you update your codebase and see if that fixes things?

  3. added this to the ML.NET 4.0 milestone on Jan 22, 2024
  4. gijs-koehorst commented on Jan 23, 2024

    @gijs-koehorst
    Author

    @ericstj as mentioned in my initial comment, it breaks when using the latest versions:

    • ML.NET Version: ML.NET 3.0.1
    • .NET Version: 7.0
    • ML.LightGbm 3.0.1
    • Manually adding the binary from the LightGBM 4.2.0 codebase

    So I am not sure what more I can update in my codebase?

  5. ghost added
    needs-further-triageNeeds deeper review after initial triage
    on Jan 23, 2024
  6. ghost removed
    needs-author-actionMore information or action is needed from the author
    on Jan 23, 2024
  7. ericstj commented on Jan 24, 2024

    @ericstj
    Member

    It's possible the latest version or LightGBM codebase will not work - it definitely wouldn't have worked with 2.0.0 due to the breaking changes we already had to adjust to - we haven't yet tested out the latest version of the LightGBM codebase and it may have more breaking changes. We're currently on 3.3.5

    <LightGBMVersion>3.3.5</LightGBMVersion>
    . If this method worked for you before, you might try building from their 3.3.5 tag and see if that works.

  8. gijs-koehorst commented on Jan 24, 2024

    @gijs-koehorst
    Author

    @ericstj I set the versions as follows:

    <PackageReference Include="Microsoft.ML" Version="3.0.1"/>
    <PackageReference Include="LightGBM" Version="3.3.5"/>
    

    I built 3.3.5 lib_lightgbm.dylib from source and include it in bin.

    Now LightGBM().Fit() gives "[LightGBM] [Fatal] Unknown importance type: only support split=0 and gain=1" and exits with 138.

  9. ericstj commented on Jan 24, 2024

    @ericstj
    Member

    Can you double check your reference to Microsoft.ML.LightGBM to ensure it's also 3.0.1? I see from previous issues this might be related to using an 3.x LightGBM package with older Microsoft.ML.LightGBM:
    #5447

    If it's possible to share your simplified repro - or even just the project.assets.json we might be able to spot any other version discrepencies.

  10. gijs-koehorst commented on Jan 25, 2024

    @gijs-koehorst
    Author

    Setting Microsoft.ML.LightGBM explicitly to 3.0.1 fixed the issue:

    <PackageReference Include="Microsoft.ML" Version="3.0.1"/>
    <PackageReference Include="LightGBM" Version="3.3.5"/>
    <PackageReference Include="Microsoft.ML.LightGbm" Version="3.0.1" />
    

    Thank you a lot for your help @ericstj.

  11. ericstj commented on Jan 25, 2024

    @ericstj
    Member

    Thank you for sticking with me to find the problem. I think the fact that 4.2.0 created problems might mean that we have some breaking changes to react to in LightGBM (assuming you were using the latest ML.LightGBM package in that case). We'll get to those when updating LightGBM next.

  12. locked and limited conversation to collaborators on Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-further-triageNeeds deeper review after initial triage

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions