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
fix: Refactor of LightGBM wrapper to prepare for streaming #1557
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #1557 +/- ##
==========================================
- Coverage 83.76% 83.55% -0.21%
==========================================
Files 301 305 +4
Lines 15376 15776 +400
Branches 698 732 +34
==========================================
+ Hits 12879 13181 +302
- Misses 2497 2595 +98
Continue to review full report at Codecov.
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/BasePartitionTask.scala
Outdated
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/BasePartitionTask.scala
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/BulkPartitionTask.scala
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/LightGBMBase.scala
Outdated
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/LightGBMBase.scala
Outdated
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/LightGBMBase.scala
Outdated
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/LightGBMBase.scala
Outdated
Show resolved
Hide resolved
lightgbm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/LightGBMPerformance.scala
Show resolved
Hide resolved
...bm/src/main/scala/com/microsoft/azure/synapse/ml/lightgbm/params/ClassifierTrainParams.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few nits and comments, awesome work :)
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved to the best of my knowledge, @imatiach-msft @eisber please feel free to take a look and provide any comments!
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed VW changes. Nice work!
Summary
In preparation for adding a "streaming" mode to LightGBM functionality (mostly to improve memory usage), this PR refactors the existing wrapper code. Followup PRs will actually add the streaming components, but this initial PR makes the following major interrelated changes to improve the organization of LightGBM code:
LightGBMBase
is now driver-only methods, and all worker code is inBasePartitionTask
and derived classes (onlyBulkPartitionTask
for now).NetworkManager
, a class that encapsulates all Networking functionality, both driver/worker and Spark/LightGBM.TrainingContext
object to help pass around configuration and initialization information easily, without passing lots of method parameters. This applies at the driver level for all of training, but there are also similar newPartitionTaskContext
andPartitionTaskTrainingState
objects that encapsulate read-only and variable properties respectively for individual tasks.InstrumentationMeasures
, a class that holds timing perf for various stages, both for all of training and individual tasks. This class is returned along with the Booster, so is even exposed to the user.I also cleaned up all warnings about file/method length, use of "while" loops, excessive code branching, etc. There's more official tail recursion and less use of vars.
Notable new functionality:
NOTE: The actual streaming components are not huge, but were omitted for now to help shorten the long PR, and also since this PR can be checked in without any new native LightGBM library components.
Tests
Since this is a refactor, the existing LightGBM test suite should be sufficient, and for now runs in "bulk" mode only. The next PR will add "streaming" mode and reconcile the tests.
Dependency changes
If you needed to make any changes to dependencies of this project, please describe them here.
AB#1866292