Skip to content

Prepare training-table ingestion before fit - #593

Draft
haoweiyu-kumo wants to merge 1 commit into
mainfrom
tt_ingestion_preparation
Draft

haoweiyu-kumo wants to merge 1 commit into
mainfrom
tt_ingestion_preparation

Conversation

@haoweiyu-kumo

@haoweiyu-kumo haoweiyu-kumo commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move Engine training-table ingestion from Trainer.fit() into generation and row-loading factories. Tables return ready for sampling; repeated fits reuse ingestion and build independent model-specific task metadata.

This PR targets main and is independent of Ray and artifact storage. It replaces #592 after GitHub automatically marked that PR merged into its former base during stack reordering. #584 is stacked on this PR and adds remote preparation and replication.

  • Prepare snapshot-bound native extensions under a lock, using unique attempts and atomic publication. Validate completion before reuse.
  • Preserve original row paths, export IDs, and provenance. Keep the shared core ingestion wrapper available to service callers.
  • Reject unprepared or mismatched tables before fit preflight; fit never ingests rows.

Compatibility: generation/loading pays ingestion cost and surfaces native errors earlier. Fit requires the same native snapshot build; regenerate the table or reload exported rows against another snapshot. Existing MLOps row exports remain unchanged.

Change map

File-by-file change map

Testing Done

  • Standalone against current main: preparation, semantic adapters, and explanations: 60 passed; row exports and CPU fits: 33 passed; shared core workflows: 61 passed.
  • Real native sampling, concurrent reuse, failure/retry, corruption, and build validation covered. CPU fits run with ingestion disabled.
  • Scoped Ruff, four-source Mypy, and repository documentation checks passed. The trainer retains five verified pre-existing Mypy errors.

Checklist

  • Listed compatibility changes.
  • Updated lifecycle documentation.
  • Added and updated tests.

@copy-pr-bot

copy-pr-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@haoweiyu-kumo
haoweiyu-kumo temporarily deployed to gha-kumo-workflow-tests December 3, 2026 06:59 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "tone_instructions" at "reviews"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Pre-merge checks: Passed 1 · Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive The check reviews the PR conversation comment that starts with <!-- kumo-pr-change-map -->. That comment is not in the supplied PR context. The review_comments section returned no threads and does n… To complete this check, supply the full body of the PR conversation comment beginning with <!-- kumo-pr-change-map --> for NVIDIA/kumo-engine PR #593. Include its edit state if the comment was updated after the latest commit. Then re-run …
Pr Size Inconclusive The PR file count depends on which base is correct, and this run could not confirm the base. - Local origin/main and main are both at 868c074. Diffing origin/main...HEAD gives 166 changed files … Confirm the PR file count on GitHub (the "Files changed" tab for PR #593). Alternatively, refresh origin/main from github.com/NVIDIA/kumo-engine and rerun git diff --name-only origin/main...HEAD | wc -l. - If the count is 40 or fewer, t…
Passed Passed checks: 1 passed

Check name Status Explanation
Public Resource Access Passed Result: PASS. The PR's own commit (f11dcdf, "Prepare training-table ingestion before fit", parent f73f29e) adds no external resource references. Evidence - I scanned every added line in f11dcd…
Full details: Public Resource Access

Explanation

Result: PASS. The PR's own commit (f11dcdf, "Prepare training-table ingestion before fit", parent f73f29e) adds no external resource references. Evidence - I scanned every added line in f11dcdf for http(s)://, git+, git@, ssh://, s3://, gs://, .whl, pypi, index URLs, and Markdown link syntax. There were zero matches. - The added Markdown in packages/kumo-engine/README.md and packages/kumo-engine/docs/mlops.md contains no links. - The 11 files changed by the commit are Python sources, tests, and docs. None adds a URL, repository location, or package source location. Scope caveat - The local branch has 7 commits that are not in origin/main (for example 90c358d, 9e80dc2, a18f932). They are not the commit this PR describes. The PR title and description cover only f11dcdf. - If the provider diff against main includes those commits, they add these references: raw.githubusercontent.com/aquasecurity/trivy/... (a pinned public path), pypi.org/simple (public), github.com/NVIDIA/kumo-engine/pull/530 (access depends on repository visibility), and Google/Azure OAuth URLs in test fixtures (excluded as fixtures). - I could not test anonymous access from this sandbox. If those commits belong to this PR, the github.com/NVIDIA/kumo-engine/pull/530 link would need a public-access check. That check would be a separate, inconclusive item.

Full details: Change Map Design Review

Explanation

The check reviews the PR conversation comment that starts with &lt;!-- kumo-pr-change-map --&gt;. That comment is not in the supplied PR context. The review_comments section returned no threads and does not include conversation comments. I searched the checked-out repository (HEAD f11dcdf, "Prepare training-table ingestion before fit"), git refs, notes, and /tmp and home directories for the marker. The only match is the policy text in docs/development/review.md. No comment body was found, so the change map's necessity, abstraction layer, preserved behavior, verification, and stopping condition cannot be assessed. Context from the repository: the commit changes 11 files (613 insertions, 66 deletions), including workflow.py, _ingestion.py (new, 194 lines), predictive_query.py, training_table.py, trainer.py, and four test files. The PR description says it moves training-table ingestion from Trainer.fit() into generation and loading factories. It also says fit now rejects unprepared tables. These are claims from the description. I did not verify the map against the code, and I did not assess its design.

Resolution

To complete this check, supply the full body of the PR conversation comment beginning with &lt;!-- kumo-pr-change-map --&gt; for NVIDIA/kumo-engine PR #593. Include its edit state if the comment was updated after the latest commit. Then re-run the check. The review will test each change row against the diff in commit f11dcdf and the linked code. It will also check for a concrete observed failure or release requirement, inspected existing behavior, the smallest sufficient change, focused verification, and a stopping condition.

Full details: Pr Size

Explanation

The PR file count depends on which base is correct, and this run could not confirm the base. - Local origin/main and main are both at 868c074. Diffing origin/main...HEAD gives 166 changed files (6096 insertions, 6991 deletions). That count exceeds the threshold of 40. - The PR head f11dcdf has 8 commits above 868c074. Only the top commit, "Prepare training-table ingestion before fit", is this PR's own change. It touches 11 files. - The seven commits below it have GitHub squash-merge style subjects: #557, #88, #545, #585, #551, #586, #588. Their file counts are 28, 23, 26, 67, 5, 6, and 2. The PR description says the change is "standalone against current main" and that it replaces a stacked PR. Together these suggest the local origin/main is stale and those commits are already on GitHub main. If so, the provider count would be 11, which passes. - The provider-reported metadata does not include a changed-file count. The available tools cannot fetch remote refs, so the current GitHub main tip could not be checked. The count is 166 against the local base and 11 against the likely current base. Neither result is confirmed, so the check cannot return PASS or FAIL.

Resolution

Confirm the PR file count on GitHub (the "Files changed" tab for PR #593). Alternatively, refresh origin/main from github.com/NVIDIA/kumo-engine and rerun git diff --name-only origin/main...HEAD | wc -l. - If the count is 40 or fewer, the check passes. - If the count exceeds 40, the check fails. The failure message must state the file count and recommend splitting the PR into reviewable units. The seven stacked commits (#557, #88, #545, #585, #551, #586, #588) are the likely split candidates if they are not yet on main.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@haoweiyu-kumo

Copy link
Copy Markdown
Collaborator Author

Requested behavior: move training-table ingestion out of Engine fit and make generation and row loading return sampling-ready tables. This is the independent base for remote preparation in #584.

Existing behavior: fit ingests generated rows for each call. Smallest sufficient change: prepare reusable extensions at factory completion, retain row/export metadata, and make fit consume prepared extensions. Keep the core/service ingest wrapper available; introduce no Ray or artifact-repository dependency.

Verification on main: preparation/adapters/explanations (60 passed), row exports and CPU fits with ingestion disabled (33 passed), core workflows (61 passed), scoped Ruff, four-source Mypy, and documentation checks. The trainer retains its five verified baseline typing errors.

Stopping condition: factories return complete snapshot-bound extensions, concurrent preparation reuses them safely, failures hide partial attempts, and fit only builds per-run task metadata. Remote storage/replication and unrelated typing cleanup belong outside this PR.

Change map

File Function / scope What changed Why
packages/kumo-engine/kumo/engine/pquery/_ingestion.py Preparation and binding validation Add native build identity checks, locked reuse, unique attempts, atomic publication, completion validation, and manifest rebinding. Safely prepare a reusable sampling extension once.
packages/kumo-engine/kumo/engine/pquery/training_table.py Factory completion and table identity Prepare ingestion after row generation/loading and optional MLOps export; retain original row paths and native export ID while keying reuse by snapshot build. Return sampling-ready tables without changing row exports.
packages/kumo-engine/kumo/engine/pquery/predictive_query.py Generation planning Separate plan creation from native row generation and document eager ingestion. Preserve generation consumers and make preparation timing explicit.
packages/kumo-core/src/kumo_core/training/workflow.py Task materialization Extract materialization from ingestion while keeping the existing ingest wrapper. Allow Engine to reuse prepared extensions without changing service callers.
packages/kumo-engine/kumo/engine/trainer/trainer.py Fit validation and task metadata Validate the prepared extension before preflight and always materialize from it. Remove ingestion from fit while keeping model settings per run.
packages/kumo-engine/test/test_training_table_ingestion.py Preparation regressions Cover atomic/concurrent reuse, failure/retry, corruption, build binding, repeated fits, and real native sampling. Establish the prepared-table contract without remote infrastructure.
packages/kumo-engine/test/test_training_table_export.py, packages/kumo-engine/test/test_semantic_carry_forward.py, packages/kumo-engine/test/test_training_explanations.py Consumer regressions Preserve row round trips and export IDs; fit without ingestion; update prepared-table fixtures and early-failure cases. Verify existing consumers under the new lifecycle.
packages/kumo-engine/README.md, packages/kumo-engine/docs/mlops.md Lifecycle documentation Describe eager preparation, exact-build binding, and row loading. Explain timing and compatibility changes independently of cluster execution.

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — f11dcdf2 Deployed Dec 3, 2026 by haoweiyu-kumo via import #3598
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.

1 participant