Skip to content

Show native AnchorTable batching in the PyTorch quick start - #398

Merged
bberger62 merged 1 commit into
mainfrom
codex/batch-api-guidance
Nov 19, 2026
Merged

bberger62 merged 1 commit into
mainfrom
codex/batch-api-guidance

Conversation

@bberger62

@bberger62 bberger62 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The quick start used Python requests with DiskGraph, so copying it into a training loop or benchmark bypassed native AnchorTable iteration. It now materializes a Parquet AnchorTable and iterates model batches by split. The guides explain when to use Python requests, including the case where a task was itself materialized from them.

This is the pre-freeze docs and examples change. The full API split is the stacked draft #399.

Change map

File-by-file change map.

Testing Done

  • 13 affected documentation checks passed with --require-imports, including the quick start and relative links.
  • Ran the quick start with an observer and confirmed a batch came from the native typed model iterator.
  • git diff --check passed.

Checklist

  • Public API compatibility checked
  • Documentation and example updated
  • Existing runnable examples validated

@copy-pr-bot

copy-pr-bot Bot commented Nov 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@bberger62
bberger62 temporarily deployed to gha-kumo-workflow-tests November 18, 2026 20:56 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The documentation now presents Parquet AnchorTable materialization and split-based model batching as the DiskGraph workflow for training, evaluation, offline scoring, and benchmarks. It describes Python SampleRequest objects as suitable for small examples and notes that request-backed tasks do not use native AnchorTable iteration. The engine guide also documents native sequence history reading, event-component merging, and length-aware batch planning.

Merge Risk: Minimal · up to ec20d

This change updates the quick start and guides to show Parquet AnchorTable batching and explains when Python requests apply. It has no runtime effect, and no concrete problems were found, so it is safe to merge.

Architecture risk: Low · up to ec20d

The change affects 1 system.

Changed systems: packages/experimental

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/experimental (library) was modified; 5 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/experimental/kumo-pytorch/README.md: The introduction now describes the Parquet AnchorTable pattern as applicable to training, evaluation, offline scoring, and loader benchmarks, replacing the description of building one batch for two users.
  • observed — Modified behavior in packages/experimental/kumo-pytorch/README.md: The inline tuple of two SampleRequest objects is replaced by writing an anchors Parquet file and constructing an AnchorTable with user_id as the entity ID, as_of as the prediction time, and sample_id and split columns.
  • observed — Modified behavior in packages/experimental/kumo-pytorch/README.md: Materialization now receives the anchor table and fits on the train split; batch retrieval selects that split and requests model output format instead of passing the request tuple to materialization and batch retrieval.
  • observed — Modified behavior in packages/experimental/kumo-pytorch/README.md: A new note documents using Python SampleRequest objects for quick checks, tests, and small runtime-supplied request sets, stating that they bypass native AnchorTable iteration even with DiskGraph, and links to anchor-selection guidance.
Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Change Map Design Review Warning Summary: The change map (comment 6991424163, marker <!-- kumo-pr-change-map -->) identifies a real, proven problem. Its core design is sound. Its table is incomplete and one row hides a factual … 1. In 05-training-batches.md, restore requests to the task.batches argument description. Use: "task.batches takes requests (request-backed batches) or split (materialized anchors), which are mutually exclusive, plus batch_size, …
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR changes 5 files, which is below the threshold of 40. The changed-file inventory from git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists fiv…
Public Resource Access Passed The check applies only to external resource references added or modified by this PR. I compared the reviewed range (refs/coderabbit/pre-merge-check/base to head) across five changed files under packag…
Full details: Pr Size

Explanation

The PR changes 5 files, which is below the threshold of 40. The changed-file inventory from git diff --name-status refs/coderabbit/pre-merge-check/base refs/coderabbit/pre-merge-check/head lists five modified (M) files, all under packages/experimental/kumo-pytorch/: - README.md - docs/02-contracts.md - docs/04-engines-and-data.md - docs/05-training-batches.md - docs/07-model-input-shapes.md No files were added, deleted, or renamed. The check ignores line counts, so the +26/-7 and related line totals do not affect the result. The check passes because the file count does not exceed 40.

Full details: Public Resource Access

Explanation

The check applies only to external resource references added or modified by this PR. I compared the reviewed range (refs/coderabbit/pre-merge-check/base to head) across five changed files under packages/experimental/kumo-pytorch. The added lines contain no external URLs, package or install sources (pip/npm/git+), container images, dataset or model downloads, or other external locations. The only added link syntax is four relative Markdown links that target files or anchors in the same repository: - docs/04-engines-and-data.md#anchor-tables - 05-training-batches.md#training-on-the-diskgraph-engine (two occurrences) - #training-on-the-diskgraph-engine These are intra-repository references, not external resources. The other added path, data / "anchors.parquet", is a local file that the example writes at runtime. It is not a public resource reference. No external reference was removed or changed, so no base-only reference applies. Because the check finds no added or modified external reference, it passes. I did not test anonymous access to the repository itself. The relative links depend on the repository being publicly readable, but that is a repository-wide condition, not an added external reference.

Full details: Change Map Design Review

Explanation

Summary: The change map (comment 6991424163, marker &lt;!-- kumo-pr-change-map --&gt;) identifies a real, proven problem. Its core design is sound. Its table is incomplete and one row hides a factual API error the PR introduces. Evidence that supports the core design (proven): - task.py lines 291–292 and 351–371: split= without requests reads through _anchor_batches. It uses native batches only when the anchor object exposes that method. - anchors.py (RequestAnchors, line 539 onward): this class has no batches or iteration_anchors method. preparation.py lines 322–326 builds RequestAnchors for request-materialized tasks. These tasks therefore fall back to the Python path. - native_anchors.py lines 1016–1018: iteration_anchors returns the native anchor object, so the native iterator applies to AnchorTable-materialized DiskGraph tasks. So the stated failure (the quick start taught the bypass path) is real. The Parquet AnchorTable change is the right abstraction layer for a docs-only fix. Proven defect the change map does not report (05-training-batches.md): - The diff removes "(or explicit requests)" from the task.batches argument list. The change map row only says "Link up front ... distinguish the in-memory examples." - task.py lines 199–202 show requests is still the first positional parameter. Lines 50–51 show requests and split are mutually exclusive. - The PR's own 04-engines-and-data.md still documents task.batches(requests=...). The PR now contradicts itself. Omitted or misleading material behavior: - 04 rewrites the sequence section. It now says the native iterator "reads histories and merges event components" and "plans batches ... reuse per-anchor lengths across epochs." It removes the statement that these were "separate work." The change map's row gives a routing rationale ("routing conditions needed to choose and verify a path"). That rationale does not justify new sequence-behavior claims. These claims are not tied to the stated failure. The change map does not identify them as separate, optional refinements. - The 04 text says native routing applies only to "eligible contracts," and that "some contracts still use Python assembly." The change map omits this limit. Its "production pattern" framing implies general applicability. - The new SampleRequest note (request tasks bypass native iteration even with DiskGraph) appears in the README and 04 diffs. The README row in the change map omits it. Verification gap (uncertain, not a defect): The "13 affected documentation checks" are not named. The observer-confirmed native batch is not a committed test. The change map cannot show that these checks would catch the 05 API misstatement. Verdict: The change map is not a sound record of the change. It omits a proven API misstatement. It also presents unscoped sequence-behavior edits as part of the routing fix.

Resolution

  1. In 05-training-batches.md, restore requests to the task.batches argument description. Use: "task.batches takes requests (request-backed batches) or split (materialized anchors), which are mutually exclusive, plus batch_size, shuffle, seed, epoch, rank and world_size." Then add this row to the change map. 2. Split the 04-engines-and-data.md sequence-section rewrite (native history reading, event merging, length-aware planning) into a separate change or PR. Or add a row that names it as a separate behavior claim. Give it its own verification, such as the native length-planning and native anchor handoff tests. Do not describe it as routing-related. 3. Add to the README and 04 rows: the SampleRequest bypass note. Add the caveat that native routing applies only to eligible contracts. The caveat is "Benchmarks of that iterator should verify the execution route." 4. Name the 13 documentation checks. State which check covers the task.batches signature and the requests/split exclusivity. 5. Re-run this check after the corrected change map is posted.
Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cce65ce and ec20df7.

Files selected for processing: 5

  • packages/experimental/kumo-pytorch/README.md
  • packages/experimental/kumo-pytorch/docs/02-contracts.md
  • packages/experimental/kumo-pytorch/docs/04-engines-and-data.md
  • packages/experimental/kumo-pytorch/docs/05-training-batches.md
  • packages/experimental/kumo-pytorch/docs/07-model-input-shapes.md

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@bberger62

Copy link
Copy Markdown
Contributor Author

Change map

The quick start demonstrated request batching as the first DiskGraph example. Update the published example and nearby guidance to distinguish population loading from Python requests. The change is complete when the example delivers a native typed batch and the affected guide checks pass.

File Function / scope What changed Why
packages/experimental/kumo-pytorch/README.md Quick start Write and bind Parquet anchors, fit on train, and iterate model batches by split. Make the production pattern the copyable first example.
packages/experimental/kumo-pytorch/docs/02-contracts.md Introduction Label the request examples as inspection and link to DiskGraph training. Make the scope of the tutorial explicit.
packages/experimental/kumo-pytorch/docs/04-engines-and-data.md Anchor tables Explain when both forms use request batching and describe native sequence delivery and length planning. Give readers the routing conditions needed to choose and verify a path.
packages/experimental/kumo-pytorch/docs/05-training-batches.md Introduction and batching options Link up front to Parquet AnchorTable training and distinguish the in-memory examples. Lead production callers to the appropriate example.
packages/experimental/kumo-pytorch/docs/07-model-input-shapes.md Introduction Identify Python requests as a way to inspect input shapes. Direct training and benchmarks to the population recipe.

Verified with 13 affected documentation checks, an observed native typed model batch from the quick start, and git diff --check.

@bberger62

Copy link
Copy Markdown
Contributor Author

/ok to test ec20df7

@bberger62
bberger62 merged commit 4403029 into main Nov 19, 2026
130 of 132 checks passed
@bberger62
bberger62 deleted the codex/batch-api-guidance branch November 19, 2026 18:38

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — ec20df71 Deployed Nov 18, 2026 by bberger62 via import #2612
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.

2 participants