Skip to content

fix: apply LightGBM dataset parameters during creation - #2774

Merged
Rana Singh (ranadeepsingh) merged 1 commit into
microsoft:masterfrom
leninworld:fix-lightgbm-dataset-params-issue-2769
Oct 16, 2026
Merged

Rana Singh (ranadeepsingh) merged 1 commit into
microsoft:masterfrom
leninworld:fix-lightgbm-dataset-params-issue-2769

Conversation

@leninworld

Copy link
Copy Markdown
Contributor

This PR fixes issue #2769.

Related Issues/PRs

Fix #2769

What changes are proposed in this pull request?

  • Forward explicit maxBinByFeature, minDataPerBin, isEnableSparse, useMissing, and zeroAsMissing settings when LightGBM datasets are created.
  • Emit the native min_data_in_bin key and remove the later duplicate invalid min_data_per_bin entry.
  • Validate the shape and values of maxBinByFeature before invoking native LightGBM.
  • Add focused bulk and streaming regression coverage for parameter forwarding and invalid inputs.

How is this patch tested?

  • Tests were added to verify the changes.
  • Local testing passed.

Validation on Linux amd64 Docker with Java 11.0.32, Spark 3.5.0, Scala 2.12, and Python 3.11.8:

  • Exact-base fail-before: 0/5 focused tests passed for the intended missing behavior.
  • Pass-after: 32/32 focused and adjacent tests passed.
  • Main and test Scalastyle: zero errors and zero warnings.
  • A branch-built Python/JVM end-to-end run matched native LightGBM 3.3.5 controls in bulk and streaming modes.
  • git diff --check passed.

The manual Fabric multi-executor regression script was not run locally. Dataset parameters supplied only through passThroughArgs remain outside this change.

SynapseML LightGBM dataset parameter validation

Does this PR change dependencies?

  • No. You can skip this section.
  • Yes. Please specify what changes are proposed.

Does this PR add a new feature? If so, how is this feature tested?

  • No. You can skip this section.
  • Yes. Please describe how the feature is tested.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 18:20
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown

Hey Lenin Mookiah (@leninworld) 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues remain, and focused regression coverage addresses both transfer modes; tests were not independently rerun.

0 open findings

What changed in this PR

Fixes #2769 by applying LightGBM dataset settings during dataset creation, before training.

Changes:

  • Forwards binning, sparsity, and missing-value settings.
  • Corrects min_data_in_bin serialization and validates maxBinByFeature.
  • Adds bulk and streaming regression tests.
File Description
lightgbm/​src/​test/​scala/​com/​microsoft/​azure/​synapse/​ml/​lightgbm/​split1/​VerifyLightGBMDatasetParams.scala Tests forwarding, invalid inputs, and training behavior.
lightgbm/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​lightgbm/​params/​BaseTrainParams.scala Corrects the native parameter key and removes duplication.
lightgbm/​src/​main/​scala/​com/​microsoft/​azure/​synapse/​ml/​lightgbm/​LightGBMBase.scala Forwards dataset settings and validates per-feature bins.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.91%. Comparing base (eca68f8) to head (7a7253f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2774      +/-   ##
==========================================
+ Coverage   87.88%   87.91%   +0.02%     
==========================================
  Files         346      346              
  Lines       21438    21444       +6     
  Branches     2226     2233       +7     
==========================================
+ Hits        18841    18852      +11     
+ Misses       2597     2592       -5     
Files with missing lines Coverage Δ
...osoft/azure/synapse/ml/lightgbm/LightGBMBase.scala 97.10% <100.00%> (+0.05%) ⬆️
...e/synapse/ml/lightgbm/params/BaseTrainParams.scala 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator

Thanks Lenin Mookiah (@leninworld)! This fixes a real issue: explicit LightGBM binning and missing-value settings were reaching training too late to affect dataset creation. I kept your implementation and tests unchanged and independently validated 7a7253fbbb7cbd8245eaa356a89cd689655ea1eb.

  • Before/after: the original production code reproduces the reported 229 thresholds instead of 1. All five new regression tests fail against that baseline and pass with your fix locally, including bulk and streaming training.
  • Full CI: Azure build 241234907 is green, with all 65 final job results successful. It was triggered by /azp run (reason=pullRequest) against PR merge 73e870813e5d5e2b4a29f1875fb53effe90c2aab, whose parents match this head and current master. The first deep-learning-HF job lost its hosted agent during setup, before tests ran; retrying only that failed job preserved the other 64 successes, and all four HF tests then passed.
  • Regression evidence: published test run 1173585851 confirms all five added tests passed. All six LightGBM Scala splits and the LightGBM Python/R jobs passed. The existing local-only performance utility remains explicitly ignored.
  • Review/checks: all GitHub workflows passed, Codecov reports all modified coverable lines tested, and the current-head automated review has no unresolved or suppressed findings.

Engineering validation is complete for this head. The remaining merge gate is one maintainer approval; this comment is validation evidence, not that approval. No source changes were pushed.

@ranadeepsingh
Rana Singh (ranadeepsingh) merged commit 0543bf7 into microsoft:master Oct 16, 2026
77 checks passed
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 19, 2026
## Summary
Strengthen external-contributor and PR-loop guidance with revision-pinned
readiness, Azure job-attempt and named-test evidence, trusted-guidance
verification, and explicit validation-only success without maintainer edits.
Keep evidence collection separate from authorization and merge approval.

## Prompting Intent
The engineer asked to implement the agreed lessons from recent external PR
validation work and open a pull request. Preserve contributor ownership, reuse
the existing workflow and watcher, and avoid product, dependency, release, or
CI-definition changes. Continue the required reviews and publish their history.

## Linked Sources
- Recent external PR validation: microsoft#2774
- External-contributor guidance: .github/skills/synapseml-external-contributor-review/
- PR-loop guidance and review policy: .github/skills/synapseml-pr-loop/
- Existing CI discovery: pipeline.yaml, CIHelpers
- Regression evidence: tools/ci/tests/test_get_pr_readiness.py,
  test_collect_ci_evidence.py, test_trusted_guidance.py,
  test_watch_azure_pipeline.py
- Pre-commit review: six independent clean lenses on the frozen pass-12 patch;
  original review drafts will be published under the assigned PR number.

## Rationale
Extend the existing watcher and share its read-only Azure collector rather
than add another polling framework. Fail closed on stale or incomplete evidence
without equating technical validation with human approval. Keep secret-bearing
CI authorization in the external-contributor contract. Verify a previously
trusted snapshot rather than let candidate guidance authenticate itself.
Extract the review gauntlet without changing its policy. Use offline regressions
for destructive trigger guards and live read-only checks for API provenance.
This is a non-feature tooling chore; the PR carries documentation/build labels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0bb95beb-b5fd-44e0-9fc0-9d036d4c74c7
Rana Singh (ranadeepsingh) added a commit to ranadeepsingh/SynapseML that referenced this pull request Oct 19, 2026
## Summary
Harden PR readiness, Azure build and named-test collection, bounded polling,
and trusted-guidance verification. Add regression coverage and make the
no-bloat gate and permission boundaries explicit.

## Prompting Intent
The engineer requested merge-ready validation except human review, removal
of useless changes and files, and publication of the updates. No merge or
secret-bearing CI trigger is included in this commit.

## Linked Sources
- Pull request: microsoft#2775
- Related validation lessons: microsoft#2774
- Review and finding dispositions: reviews/pr-2775/
- Repository guidance: AGENTS.md
- Validation contracts: .github/skills/synapseml-pr-loop/

## Rationale
Extend existing helpers rather than introduce a parallel validation system.
Separate collected evidence, engineering readiness and human approval;
reject stale, incomplete or mismatched evidence. Preserve superseded safe
review feedback in a published archival commit before pruning it from the
final diff. All six pre-commit lenses passed the same source patch; current-head
Azure validation and final CI-qualified review remain outstanding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0bb95beb-b5fd-44e0-9fc0-9d036d4c74c7
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.

[BUG] LightGBM maxBinByFeature seems to be miswired

4 participants