Skip to content

Fixed light gbm update #7431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged

Fixed light gbm update #7431

merged 2 commits into from
Apr 1, 2025

Conversation

michaelgsharp
Copy link
Member

@michaelgsharp michaelgsharp commented Apr 1, 2025

Fixes #7320.
Fixes #7045.
Updated light GBM to the latest version.

@Copilot Copilot AI review requested due to automatic review settings April 1, 2025 06:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the LightGBM interface to accommodate changes in the latest LightGBM version.

  • The API signature in WrappedLightGbmInterface.cs was updated by replacing a single parameter (numTotalRow) with two separate parameters (numTotalLocalRow and numTotalDistributedRow).
  • The API call in WrappedLightGbmDataset.cs was updated to pass a hardcoded value for the new numTotalDistributedRow parameter.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/Microsoft.ML.LightGbm/WrappedLightGbmInterface.cs Updated method signature to split numTotalRow into two parameters.
src/Microsoft.ML.LightGbm/WrappedLightGbmDataset.cs Updated method call to include the new parameter with a 0 literal.
Files not reviewed (1)
  • eng/Versions.props: Language not supported
Comments suppressed due to low confidence (2)

src/Microsoft.ML.LightGbm/WrappedLightGbmInterface.cs:91

  • [nitpick] The new parameter 'numTotalDistributedRow' might benefit from additional inline documentation to clarify its intended use compared to 'numTotalLocalRow'.
int numTotalDistributedRow,

src/Microsoft.ML.LightGbm/WrappedLightGbmDataset.cs:70

  • [nitpick] Consider replacing the hardcoded literal '0' with a named constant or adding a comment to explain its significance for improved readability.
(IntPtr)ptrValues, (IntPtr)ptrIndices, numCol, sampleNonZeroCntPerColumn, numSampleRow, numTotalRow, 0,

@LittleLittleCloud
Copy link
Contributor

Can LightGBM 4.* load model created by LightGBM 3.*?

@ericstj
Copy link
Member

ericstj commented Apr 1, 2025

Can LightGBM 4.* load model created by LightGBM 3.*?

I saw mention of this here microsoft/LightGBM#2228 (comment) it seems that what we are doing should be supported. I was hoping to find something about it in the docs though.

@michaelgsharp - oddly it seems like TensorFlow tests are failing on windows jobs in this PR with higher accuracy. I'm not sure what to think about that - but it's pretty consistent across multiple machines. 🤔

@michaelgsharp
Copy link
Member Author

@ericstj just looked into the failing test. It looks like in that case TensorFlow is used only to featurize the data. That data is then fed into a LightGBM pipeline.. so thats the corrolation between them.

@michaelgsharp
Copy link
Member Author

I'll get the test updated with the new values since it does seem to be directly related to lightGBM in this specific case.

Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.99%. Comparing base (1ccbbd4) to head (48a356e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7431   +/-   ##
=======================================
  Coverage   68.99%   68.99%           
=======================================
  Files        1482     1482           
  Lines      273876   273876           
  Branches    28250    28250           
=======================================
+ Hits       188966   188968    +2     
+ Misses      77529    77523    -6     
- Partials     7381     7385    +4     
Flag Coverage Δ
Debug 68.99% <100.00%> (+<0.01%) ⬆️
production 63.28% <100.00%> (+<0.01%) ⬆️
test 89.46% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/Microsoft.ML.LightGbm/WrappedLightGbmDataset.cs 74.21% <100.00%> (ø)
.../Microsoft.ML.LightGbm/WrappedLightGbmInterface.cs 87.71% <ø> (ø)
...t/Microsoft.ML.TensorFlow.Tests/TensorflowTests.cs 91.64% <100.00%> (ø)

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ericstj
Copy link
Member

ericstj commented Apr 1, 2025

So it looks like this LightGBM update improved the accuracy of that test. Bonus!

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericstj
Copy link
Member

ericstj commented Apr 1, 2025

Failures are known due to file sharing between tests @LittleLittleCloud

@ericstj ericstj merged commit 87e1fec into dotnet:main Apr 1, 2025
22 of 25 checks passed
@michaelgsharp michaelgsharp deleted the light-gbm-update branch April 1, 2025 21:50
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.

Update LightGBM to 4.5.0 LightGBM Version
3 participants