Repository navigation
Record fits in experiment tracking and publish models to registries - #60
Conversation
Change map
|
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments: 2
packages/kumo-engine/kumo/engine/_tracking.py: 1
59-63: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDo not mark the session as started when
context()raises.
startsetsself._started = Truebefore it builds theFitContext. The build happens inside the_calllambda, and it can raise. Two examples are aKeyErrorontrain_table_spec['tt_id']and aTypeErrorfromto_json_dict. When the build raises,_calllogs the error andTracking.startis never called. The session still forwards later events, andTrainer.fitstill callsfinish. A third-partyTrackingthen getson_eventandfinishwithoutstart, which breaks the lifecycle that theTrackingprotocol documents.MlflowTrackinghandles this case only because_reset()clears its state.Build the context first. Set
_startedonly after the build succeeds. Keep_started = Truebeforeself._tracking.start(...), so thatfinishstill runs cleanup whenstartitself raises.Proposed fix
def start(self, context: Callable[[], FitContext]) -> None: if self._tracking is None: return - self._started = True - self._call(lambda: self._tracking.start(context())) + fit_context = self._call(context) + if fit_context is None: + return + self._started = True + self._call(lambda: self._tracking.start(fit_context))packages/kumo-core/src/kumo_core/train/trainer.py: 1
1443-1445: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHandle
loggervalues that are lists or booleans.
create_pl_trainerwraps every suppliedloggervalue in a list with the TensorBoard logger. A logger list becomes nested, andlogger=Falsebecomes a logger collection containingFalse. These values do not produce a valid Lightning logger collection.logger=Falsealso no longer disables logging. The fix must preserve that boolean behavior.Suggested fix
-from collections.abc import Callable +from collections.abc import Callable, Iterable ... extra_logger = self.kwargs.pop("logger", None) - if extra_logger is not None: + if isinstance(extra_logger, bool): + pl_logger = extra_logger + elif isinstance(extra_logger, Iterable): + pl_logger = [pl_logger, *extra_logger] + elif extra_logger is not None: pl_logger = [pl_logger, extra_logger]
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/kumo-engine/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
7e4f692d-f9c2-4dc1-9c3a-15926fab9fd4
⛔ Files ignored due to path filters: 1
uv.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing: 15
packages/kumo-core/src/kumo_core/automl/auto_trainer.pypackages/kumo-core/src/kumo_core/train/trainer.pypackages/kumo-core/src/kumo_core/training/orchestration.pypackages/kumo-core/src/kumo_core/training/runtime.pypackages/kumo-core/tests/test_training.pypackages/kumo-engine/kumo/engine/__init__.pypackages/kumo-engine/kumo/engine/_tracking.pypackages/kumo-engine/kumo/engine/integrations/__init__.pypackages/kumo-engine/kumo/engine/integrations/mlflow.pypackages/kumo-engine/kumo/engine/trainer/_runtime.pypackages/kumo-engine/kumo/engine/trainer/trainer.pypackages/kumo-engine/pyproject.tomlpackages/kumo-engine/test/test_mlflow_tracking.pypackages/kumo-engine/test/test_optional_imports.pysetup.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 7 remain after this review.
74477db to
c4c4d43
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Handle concurrent experiment creation without disabling tracking. · mlflow.py:153-158
packages/kumo-engine/kumo/engine/integrations/mlflow.py:153-158
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winHandle concurrent experiment creation without disabling tracking.
When
create_experimentraisesRESOURCE_ALREADY_EXISTS, perform a freshget_experiment_by_namelookup and use the returned experiment. Catch only this duplicate-creation error. Re-raise unrelated MLflow failures.🛡️ Suggested fix
if self.experiment_name is not None: experiment = self._client.get_experiment_by_name( self.experiment_name) - experiment_id = (experiment.experiment_id - if experiment else self._client.create_experiment( - self.experiment_name)) + if experiment is None: + try: + experiment_id = self._client.create_experiment( + self.experiment_name) + except Exception as error: + exceptions = import_provider( + 'mlflow.exceptions', 'mlflow') + databricks_pb2 = import_provider( + 'mlflow.protos.databricks_pb2', 'mlflow') + if not isinstance(error, exceptions.MlflowException) or ( + error.error_code != + databricks_pb2.RESOURCE_ALREADY_EXISTS): + raise + experiment = self._client.get_experiment_by_name( + self.experiment_name) + if experiment is None: + raise + experiment_id = experiment.experiment_id + else: + experiment_id = experiment.experiment_id
🧹 Nitpick comments: 1
packages/kumo-engine/test/test_tracking_contract.py: 1
378-388: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover global-rank gating in the tracking test.
The test covers only
LOCAL_RANK=1. It does not detect a regression that removesRANKgating while retaining local-rank gating. Add theRANK=1, LOCAL_RANK=0case.🐛 Suggested fix
def test_only_rank_zero_tracks(monkeypatch): monkeypatch.setenv('LOCAL_RANK', '1') recorder = _Recorder() session = TrackingSession(recorder) session.start(lambda: CONTEXT) session.on_event(EVENTS[0]) session.finish(RESULT, None) assert not session.enabled assert recorder.calls == [] +def test_only_global_rank_zero_tracks(monkeypatch): + monkeypatch.setenv('RANK', '1') + monkeypatch.setenv('LOCAL_RANK', '0') + recorder = _Recorder() + session = TrackingSession(recorder) + + session.start(lambda: CONTEXT) + session.on_event(EVENTS[0]) + session.finish(RESULT, None) + + assert not session.enabled + assert recorder.calls == []
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/kumo-engine/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
413901b2-1304-4d92-8208-5f67666de42c
📒 Files selected for processing: 10
packages/kumo-core/src/kumo_core/automl/auto_trainer.pypackages/kumo-core/src/kumo_core/train/trainer.pypackages/kumo-core/tests/test_training.pypackages/kumo-engine/README.mdpackages/kumo-engine/kumo/engine/__init__.pypackages/kumo-engine/kumo/engine/_tracking.pypackages/kumo-engine/kumo/engine/integrations/mlflow.pypackages/kumo-engine/kumo/engine/trainer/trainer.pypackages/kumo-engine/test/test_mlflow_tracking.pypackages/kumo-engine/test/test_tracking_contract.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/kumo-engine/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
4675a596-3919-4607-940f-c95403683072
📒 Files selected for processing: 5
packages/kumo-engine/README.mdpackages/kumo-engine/kumo/engine/_tracking.pypackages/kumo-engine/kumo/engine/integrations/mlflow.pypackages/kumo-engine/test/test_mlflow_tracking.pypackages/kumo-engine/test/test_tracking_contract.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
90ddb38 to
50dda4a
Compare
50dda4a to
11f23bd
Compare
Squashed copy of #60 (vedaant/mlops-mlflow-tracking) at its current head, so this branch builds until #60 merges. Review #60 itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
11f23bd to
ec7ea6e
Compare
Squashed copy of #60 (vedaant/mlops-mlflow-tracking) at its current head, so this branch builds until #60 merges. Review #60 itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Squashed copy of vedaant/mlops-fit-events..vedaant/mlops-mlflow-tracking (ec7ea6e) so prediction tracking builds on the fit tracking stack. Review it in #60; drop this commit when #60 merges. Applied without conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ec7ea6e to
be04f00
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # packages/kumo-core/src/kumo_core/object_store_sink.py
…ing tests Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hecks Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he specced bundle Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#60 keeps the manifest artifact helpers, embedded(), full_error, warn_failure and TrainingResult._model that #50 no longer uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pass an explicit 16 MiB part size and 4 upload threads to files.upload when the SDK accepts them (databricks-sdk 0.70+), so a large plain object no longer buffers up to parallelism x part_size with the SDK's defaults. Older SDKs upload single-threaded in 10 MiB chunks and get no extra args. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Done. Each dataset is now named for what it is and labelled with its role, and the run card has a short Lineage block. The MLflow list stays flat. Ids, versions and locations are unchanged.
A fit's inputs:
A prediction's inputs: Lineage, fit: Lineage, prediction on a newer snapshot:
|
Victsm
left a comment
There was a problem hiding this comment.
Re-reviewed 945ec4a. The alias/version, strict tracking timeout, and occupied Snowflake run fixes remain intact; independent regression probes pass. Tracking-contract/MLOps checks on the integrated stack pass (39 passed, 6 skipped). No new code blocker found. This is code approval, not fresh three-platform live qualification or a waiver of the credential/permission CI failures.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The MLflow runs list shows a run's first input, so a fit logs its training table, then its graph snapshot, then its source tables by name. The snapshot input lists its id and each table's row count as its schema. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stack: main (#53 merged) → #112 → #114 → #50 → #60 → #64 → #115. Merge bottom to top.
Summary
This PR adds experiment tracking and model registration for
Trainer.fit. Before it, a fit reported progress only as progress-bar text on stdout and could not record itself anywhere a team already looks, and a chosen threshold had nowhere to live in the bundle.kumo.MLOps(tracking=..., registry=...)records each fit as one run in MLflow (Databricks, SageMaker managed MLflow, any server) or Snowflake Experiment Tracking. The run gets params, per-split metrics, the search trials, and data summaries (split, health and column tables, notes, and the source tables as datasets) read from the stats files the builds already write. The model is then registered under an alias in that tracker's registry.Trainer.predict, the batch prediction API.kumo.engine.integrations.mlflow.log_model(trainer, snapshot=..., experiment_name=...)logs one outside a fit, creating the experiment if it is missing.fit(callbacks=)andgraph.snapshot(callbacks=)receive progress events.fit(scoring_defaults=)stores a threshold or top-k in the bundle.Usage
Snowflake uses
SnowflakeTracking(connector, experiment_name=...). A custom tracker implementskumo.engine.tracking.Tracking.Back-compat
kumo.MLOpswithouttrackingandregistryon_error="warn"(default) warns once;"raise"raises after the result is stored.predictwithout a thresholdTARGET_PRED; before, it raised.scoring-defaults.json, nodependencies)scoring-defaults.jsonread by an older enginekumo_bundle_id.mlfloworsnowflakeextraimport kumo.engineworks. Building a tracker raises anImportErrornaming the extra.Testing
test_fit_events.py,test_tracking_contract.py,test_mlflow_tracking.py,test_mlflow_target.py,test_mlflow_model.py,test_snowflake_tracking.py,test_scoring_defaults.py,test_data_summaries.py,test_summary_tables.py,test_model_agnostic_mlops.py;test_trainer_registry.pygrows with registration, alias andregistry=cases.Trainer.predict. Snowflake tests use a recording fake ofsnowflake.ml.experimentwhose signatures are checked against the installed library.mlflow-floorjob that runs the MLflow suites on mlflow-skinny 3.5.0.Also fixes
pidfd_open;encoder_selectioninstall hint; OptunaExperimentalWarningfilter scoped toanalyze().Change map: see the
kumo-pr-change-mapcomment.🤖 Generated with Claude Code