Repository navigation
Record provenance for every artifact under one MLOps artifact root - #50
Conversation
Change map
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/kumo-engine/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
27abe888-d440-4212-bd1a-b59a2746c5b0
📒 Files selected for processing: 4
packages/kumo-core/src/kumo_core/sources/object_store_sessions.pypackages/kumo-engine/kumo/engine/_provenance.pypackages/kumo-engine/kumo/engine/graph.pypackages/kumo-engine/test/test_snapshot_manifest.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.
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: 1
packages/kumo-engine/kumo/engine/graph.py: 1
269-269: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winTrack backfill warnings only after a backfill failure.
If a fresh manifest write fails, Line 269 adds its path to
_warned_backfill. If the index is later reused and its backfill also fails, the backfill failure produces no warning. Add the path to this set only whenfreshis false.Proposed change
if fresh or path not in _warned_backfill: - _warned_backfill.add(path) + if not fresh: + _warned_backfill.add(path) warnings.warn(
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository: NVIDIA/kumo-engine/.coderabbit.yaml
- Review profile: QUIET
- Plan: Enterprise
- Run ID:
fec48a97-da42-43cd-9e74-6708ef97c388
📒 Files selected for processing: 4
packages/kumo-engine/kumo/engine/_manifest.pypackages/kumo-engine/kumo/engine/_provenance.pypackages/kumo-engine/kumo/engine/graph.pypackages/kumo-engine/test/test_snapshot_manifest.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.
75f9e80 to
a748d54
Compare
aaron-kumo
left a comment
There was a problem hiding this comment.
The separation between snapshots, model bundles, and explicit scoring inputs looks sound. My main concern is preserving enough information now for future restoration, freshness, and compatibility checks. We can defer those policies, but information omitted from today’s artifacts will be difficult to recover later.
P2 — Record the DiskGraph producer version/build.
environment() records engine, core, Torch, and Python versions, but omits the DiskGraph package that actually writes the index. Format constants identify the declared storage formats, but cannot distinguish implementations with different behavior or fixes under the same format version. Please record the installed DiskGraph version and a build identifier when available. This should be diagnostic provenance; package-version differences should not automatically imply incompatibility.
Discussion — Should the artifact retain the Custom SQL definition?
Could we retain literal SQL alongside its fingerprint, with an explicit option to omit/redact it for distribution? The product already persists literal SQL in table definitions and exposes it through SDK objects and generated scripts. Hash-only storage introduces a more restrictive policy here and loses the ability to inspect transformations, explain changes, or reconstruct the source definition.
SQL can contain sensitive literals or business logic, so an explicit retention policy makes sense. Is there a specific sharing or privacy requirement driving unconditional omission? If not, I’d favor retaining the SQL, dialect, resolution namespace, and referenced tables. The exact-text fingerprint and normalized-query fingerprint should also have distinct purposes; the existing Custom SQL identity already uses normalization.
Discussion — Can source identity and version evidence be structured before publication?
Could we preserve a credential-free source descriptor and typed version evidence rather than only {connector, location, version}? For example, a Snowflake table coordinate needs account context, and an actual source version, a metadata timestamp, and an hour-bucket fallback have different guarantees.
For Custom SQL, the version calculation already gathers dependency versions and folds in a staleness bucket. Could those components be retained alongside the resulting hash? Otherwise future freshness checks cannot explain whether the query, a dependency, or only the bucket changed.
I’m not suggesting implementing every comparison now. A small versioned representation that retains the evidence—including observation time, fallback status, and observed versus reconstructed provenance—would leave those decisions open.
Discussion — Should publication offer a metadata-completeness requirement?
Best-effort manifest writing seems appropriate for preserving existing local snapshot() behavior. Should export/publication optionally require complete provenance, though? Otherwise a newly created snapshot whose manifest write failed can become a durable artifact without the evidence needed for future compatibility checks. Legacy artifacts could remain supported with an explicit incomplete-provenance state.
|
P2 — Record the DiskGraph producer version/build. Discussion — Should the artifact retain the Custom SQL definition? Your two remaining points, both in 60e1ab6:
Discussion — Can source identity and version evidence be structured before publication? Discussion — Should publication offer a metadata-completeness requirement? CodeRabbit: object-store locations keep their percent-encoding, a |
c354971 to
71fcb43
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]>
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]>
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]>
…ed tests 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
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]>
Victsm
left a comment
There was a problem hiding this comment.
Re-reviewed 2eb87dc and its delta from the prior reviewed head. Prior provenance/reuse fixes are preserved; snapshot transfer allocation and integrity checks retain their semantics after consolidation. No new code blocker found. Current connector failures concern the restricted-BigQuery identities and the Snowflake TEST_TABLE permission fixture; approval does not waive those CI gates.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Stack: main (#53 merged) → #112 → #114 → #50 → #60 → #64 → #115. Merge bottom to top.
Summary
Every graph snapshot, training table and model bundle now carries a self-contained
_provenance.jsonthat leads back to the source table versions (and locations, wherever the source backend can name them), query, plan and engine build that produced it. Today a model has no id, an artifact records no lineage, an index works only on the machine that built it, and scoring needs the training job'sGraph.This PR adds
kumo.MLOps/with kumo.mlops(...)to store each artifact once under one artifact root (s3://,gs://, local, or a(connector, path)file store from #112);GraphSnapshot.export/load_from_connectorto move a checksummed index between machines;snapshot.source_changes(graph)to see which tables changed since a snapshot; andTrainer.predict(snapshot)to score a stored snapshot with the trained query.MLOps(on_error='raise')turns a failed store into aRuntimeErrorafter the call finishes. Off unless asked for.Design decision: for this release MLOps is opt-in per call or per block (
mlops=orwith kumo.mlops(...)). A call outside both runs without MLOps, andon_error="raise"does not detect that. A model- or workflow-bound association with an explicitmlops=Falsewas considered and is left as a follow-up. See "Per call, not per model" indocs/mlops.md.Usage
Back-compat
Without a block or
mlops=, existing calls behave as before."reconstructed": true.manifestisNone.verify_model_bundlereturn valueDatabricksConnector(identity=...)identityis now optional (ambient auth).RuntimeErrorinstead, once the call has finished, withMLOps(on_error='raise').Testing
test_snapshot_export.py(round trip, reuse, interrupted and concurrent exports, corrupt markers,source_changes,on_error),test_snapshot_manifest.py,test_training_table_export.py,test_holdout_df.py(published model's holdout, loaded and fetched holdout, empty test split),test_bundle_provenance.py,test_query_from_snapshot.py,test_filestore_sink.py(identical bundle reused),test_mlops.py,test_graph_mismatch.py,test_artifacts.py.test_sink_delete.py; Snowflake, Databricks and BigQuery identity tests assertversion_kind.range_checksums_cover_every_listed_file_and_the_manifest; pybindtest_exception_exports.py.test_snapshot_export_live.py.Change map: see the
kumo-pr-change-mapcomment.🤖 Generated with Claude Code