Repository navigation
Add kumo-pytorch as an experimental package - #244
Conversation
Change mapObserved requirement: add kumo-pytorch as an experimental workspace package with its own CI, excluded from releases. Smallest change: the package, its workflows, and the registrations the repository's checks require. Verification: the kumo-pytorch workflows on this PR (including a build and fresh-environment install) and the existing checks. Stopping condition: all checks green.
|
|
Important Review skippedToo many files! This PR contains 304 files, which is 4 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.
|
f8b930c to
3a47485
Compare
3a47485 to
9a170e2
Compare
9a170e2 to
1088a28
Compare
The package and its CI workflows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Workspace member and uv.lock, license-metadata and notice registration, lint and type-check scoping, the license wheel build, Docker contexts, and an engine-wheel test showing experimental packages are not bundled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1088a28 to
79ba160
Compare
|
/ok to test 79ba160 |
Victsm
left a comment
There was a problem hiding this comment.
Reviewed integration, licensing, wheel exclusion and CI at 79ba160; no blocking issue found in that scope.
Nonblocking follow-up: add root uv.lock and pyproject.toml to the experimental unit/native-test PR path filters. The shared setup consumes both, so dependency-only changes can alter the test environment without running these checks before merge; nightly coverage catches issues later. The heavier E2E workflows can retain their selective triggering.
|
Thanks, agreed. Adding the root |
## Summary Allow non-entity tables without primary keys in `kumo.pytorch`, following DiskGraph's existing row identity. For example, `events(owner FK → users.id, at, amount)` can supply histories, aggregates and graph neighbors without an artificial event key. Entity/root and candidate entity declarations still require a PK. This ports [rdl-platform#139](kumo-ai/rdl-platform#139) into the API's new home at `packages/experimental/kumo-pytorch`, introduced by #244. The API implementation, tests and agreed examples are retained under the `kumo.pytorch` namespace. The standalone dependency-pin changes are omitted: this package already uses the workspace DiskGraph, including merged native support from #184. ## Where support is missing The current `TableSpec` constructor rejects `primary_key=None` with `table name and primary key must be non-empty`, before the table reaches ingestion. Downstream API paths also assume every table has a PK: native ingestion configuration always declares one, temporal sequences project it, graph output reads it for identity, and serving requires it for row uniqueness and fetching. DiskGraph already stores and traverses rows without PKs. Ingestion assigns native node IDs; graph sampling and temporal queries use those IDs to address individual occurrences. External PK lookup is a separate requirement for choosing entities. This change carries that existing distinction through the API. ## Implementation and intended behavior - Accept `TableSpec(..., primary_key=None)` and `build.Table(..., key=None)`. A shared declaration check rejects PK-less sample/candidate entities before binding, type inference or source access. - Omit absent PK metadata and projections in the DiskGraph adapter. Use returned native node IDs for temporal and graph identity. Constant-only sequences project their existing clock to satisfy the native sequence API. - Use private source-occurrence ordinals in the in-memory test/serving paths. Keep separate source occurrences distinct, including equal-valued rows and aliases of the same input mapping. Repeated visits reuse an occurrence; `distinct=True` removes repeated visits rather than collapsing equal values. - Validate key presence/uniqueness and request PK columns in `rows_spec` only for keyed tables. Update authored documentation and regenerate the public API reference. No source key generation, additional identity column or persistent identity inventory is introduced. Existing keyed ordering, entity lookup, source cleanup and unsupported-operation checks retain their behavior. Native source, workspace packaging and dependencies are unchanged by this PR. The new `G-KEYLESS-001` guarantee has two hand-calculated examples: | Case | Input | Required answer | | --- | --- | --- | | C-KEYLESS-001 | Identical amount-2 events at time 9, amount 3 at 10, and future amount 100 at 11. | Cutoff 9: count 2, sum 4. Cutoff 10: count 3, sum 7. Recent `(9,10]` count 1. Empty history: count/sum 0. | | C-KEYLESS-002 | Two links revisit the same two identical eligible facts. | Distinct count 2 / sum 4; repeated count 4 / sum 8. Future facts excluded. | Keyless IDs remain opaque and local to an index or prepared serving dataset. Reordering, repartitioning or serving subsets can change tied selections and floating reduction rounding. Occurrence multiplicity and integer reductions remain exact; stable cross-preparation identity requires a declared PK. ## Testing Done - **Full CPU suite: 1,926 passed**, 3 GPU skips and 47 opt-in end-to-end/notebook checks deselected. - **Complete conformance: 705 passed**, with no skipped or deselected obligations, including DiskGraph and the in-memory differential checks. - **Installed wheels: 41 passed** for keyless/entity behavior and the README quick start, followed by **all 3 example notebooks passing** with exact committed-file comparisons. - Fresh independent adversarial review: 26 focused keyless tests, four case/engine golden checks, and additional alias, NULL-FK, repeated-visit, multi-file/shard, graph and serving probes passed. - Source/wheel builds, Ruff 0.17.3 lint/format, generated API/limitations freshness, whitespace checks and the repository-wide SPDX check passed. Validation uses Python 3.12 on CPU, with DiskGraph built from this branch's in-tree source. The editable package is `kumo.pytorch`; the old `rdl-pytorch` editable install was removed. Installed-wheel checks use a separate environment and staged tests/docs/examples without `src/`; both API and engine imports were verified to come from the installed wheels. From `packages/experimental/kumo-pytorch`: ```bash CUDA_VISIBLE_DEVICES='' python -m pytest -q --require-imports CUDA_VISIBLE_DEVICES='' python -m conformance --engine all python -m tests.api_reference python -m tests.limitations_reference python -m ruff check . python -m ruff format --check . ``` Both the source distribution and its wheel build successfully. The installed-wheel gate also exercises the README, keyless/entity tests and example notebooks. Ruff uses the CI pin, 0.17.3. Native compilation used the existing Rust 1.98 compiler; CI uses the repository's pinned toolchain. No GPU or live-service validation is claimed. Earlier standalone benchmarks measured roughly 4% additional in-memory test-engine time and 6.3% retained source heap. Those historical measurements were not repeated for this monorepo port. ## Migration and review All 26 existing touched files matched the imported base after namespace conversion; the four new guarantee/test files had no collisions. This is the same RDL feature moved into the monorepo, with no additional behavior or altered golden answers. The new package's existing CPU, DiskGraph, notebooks and installed-wheel workflows cover the changed paths. Independent adversarial review found no actionable issues. It executed all 26 focused keyless cases and four golden case/engine combinations, plus multi-file/shard, NULL-FK, aliased-row, repeated-visit, graph and serving probes. It also checked namespace coexistence and verified that all 67 Python modules in the built wheel match source byte-for-byte. ## Change map [File-by-file change map](#267 (comment)). Reviewed at: e7a75e6 Co-authored-by: Codex <[email protected]>
Adds kumo-pytorch as an experimental package at
packages/experimental/kumo-pytorch/, imported askumo.pytorch. It builds point-in-time-correct PyTorch batches from relational tables using DiskGraph; see the package README for an overview and a quick start.Summary
Besides the package itself, this PR adds its CI and registers it with the repository's tooling:
CI. Four workflows share a
kumo-pytorch-setupaction:kumo-pytorch-tests.ymlruns the CPU checks.kumo-pytorch-diskgraph.ymlruns the suite, the example notebooks, and a build-and-install job against DiskGraph built from the same commit.kumo-pytorch-t2a.ymlruns the end-to-end train, score and serve flows on small generated data.kumo-pytorch-t2b.ymlruns them nightly at 09:00 UTC on larger data, with extra conformance seeds.Pull request triggers are path-filtered to the package, the setup action and the workflow itself; the DiskGraph workflow also runs on DiskGraph changes. All run on GitHub-hosted CPU runners, and none is a required check.
Workspace. The package is a member in the root
pyproject.toml.uv.lockadds kumo-pytorch and its one new runtime dependency,tokenizers, with the six packagestokenizersneeds (huggingface-hub,hf-xet,httpx2,httpcore2,httpx2-jsfetch,truststore). The package's extras add nothing new:devis pytest andexamplesistorch-geometric, both already locked. No existing locked version changes.Licensing. The package is added to
scripts/check_python_license_metadata.py(DistributionSpecandFIRST_PARTY_DISTRIBUTIONS), to the licensing job's wheel build, and to the distribution count intest/scripts/test_python_license_metadata.py.Lint scoping. The package keeps its own ruff configuration, so it's excluded from flake8, isort, yapf, autoflake and pyright, like
kumo-coreanddiskgraph.Notebooks. The root
.gitignoreignores*.ipynb; the package's three example notebooks are un-ignored by path.Docker contexts.
tests/public_setup/Dockerfile.dockerignorekeeps the new member'spyproject.toml, which that context needs for every workspace member.Not part of the next release
kumo-pytorch won't ship in the next kumo-engine release, and nothing in this PR publishes it:
packages/kumo-engine/scripts/build_wheel.shbundles eachpackages/*/directory that has apyproject.toml, and now skipsexperimentalby name, next tokumo-sdkanddiskgraph.test/scripts/test_engine_wheel.pyadds an experimental package to its fake monorepo, and apyproject.tomldirectly underpackages/experimental/, and checks neither is built. Releasing kumo-pytorch later means removing that skip.kumo-engine-wheel.ymland itskitmaker-portal.ymlstep,kumo-api-release.yml,kumo-sdk-*andkumo-glove-6b-50d-wheel.yml.scripts/stamp_version.pydoesn't stamp kumo-pytorch's version, so a release version bump doesn't touch it.packages/experimental/is added to.dockerignorenext to the other members the images don't ship. The requirements exported for the backend images and the public-tests image are identical before and after this PR.Change map
See the change-map comment.
Testing Done
The kumo-pytorch workflows run on this PR, since it adds them:
kumo-pytorch-tests: conformance,pytest -q, ruff (pinned in the workflow, not a package dependency) and the package build.kumo-pytorch-diskgraph: conformance on both engines, andpytest -q --require-importswith DiskGraph built from this commit.kumo-pytorch-notebooks: the three example notebooks reproduce their committed outputs. The notebook runner (nbclient,ipykernel) is pinned in the workflow; like kumo-engine's other notebooks, the package doesn't depend on Jupyter.kumo-pytorch-install: builds the sdist, then the wheel from it, and installs the wheel and DiskGraph's into a fresh virtual environment outside the workspace. It then runs the README quick start and the notebooks from a copy of the docs, tests and examples withoutsrc/, sokumo.pytorchcan only come from the installed wheel.kumo-pytorch-t2aandkumo-pytorch-t2b: the end-to-end flows at both sizes, and the extra conformance seeds.workflow_dispatchcan only run workflows that exist on the default branch, so these pull request runs are the workflows' first runs.pytest (test/config/ test/connector/)includes two BigQuery permission tests that needGCP_BIGQUERY_NO_*_SERVICE_ACCOUNT, which isn't configured here; the same shard fails on other recent PRs.Also run locally on macOS (arm64, Python 3.12), following the same steps as
kumo-pytorch-install: DiskGraph's wheel built from this commit;uv build --package kumo-pytorch(sdistkumo_pytorch-0.1.0a1.tar.gz, then the wheel from it); both wheels installed into a fresh virtual environment outside the workspace, withkumo.pytorchimported from itssite-packages. The README quick start printed its documented output, and the three notebooks reproduced their committed outputs (3 passed, 72 s).Repository checks, run locally from the root:
scripts/check_license_headers.py,scripts/check_python_license_metadata.py(14 manifests),uv lock --check(uv 0.13.7, as pinned),scripts/check_public_references.pyand.github/scripts/workflow-security.cjs: all pass.Open items
packages/experimental/kumo-pytorch/yet; that's a maintainer decision.tokenizers(with its six dependencies above) is a new third-party runtime dependency. It isn't redistributed in any artifact here, soTHIRD-PARTY.txtdoesn't change.kumo-core-gpu.ymluses.Hotfix Context
Not a hotfix.
Checklist
🤖 Generated with Claude Code