Skip to content

Add offline time-window indices for Yambda - #907

Open
JacoCheung wants to merge 1 commit into
mlcommons:masterfrom
JacoCheung:junzhang/ts_indices_preprocessing
Open

JacoCheung wants to merge 1 commit into
mlcommons:masterfrom
JacoCheung:junzhang/ts_indices_preprocessing

Conversation

@JacoCheung

@JacoCheung JacoCheung commented Sep 18, 2026

Copy link
Copy Markdown

Summary

Yambda streaming training scans the full anchor timestamp array for each time window. This adds opt-in offline indices so window selection uses read-only mmap slices and training sample counts use offset differences when no user holdout is configured.

With get_dataset.use_offline_ts_indices = True in the Yambda gin configuration, dataset initialization automatically bucketizes anchors by time window and builds the indices and offsets on the first run, after the corresponding positions cache is ready. Generation uses bounded chunks, preserves ascending anchor order within each window, and reuses the positions-cache lock to avoid duplicate work across ranks. Completed files are reused. The two files are stored alongside their source positions and timestamps in cache_dir, with filenames that include history settings and window duration. Separate caches therefore keep separate TS files. The option defaults to False and is passed from get_dataset to the dataset constructor.

The benchmark README documents the gin setting, automatic first-run bucketization, cache reuse, and prebuilding files for read-only data mounts under Dataset/Environment → Training data order.

Validation

  • Python 3.10 syntax, static checks, and shell syntax checks passed.
  • Real gin bindings propagated through the dataset factory and constructor: enabled mode built and reused the two arrays, disabled mode retained online filtering, and the former environment variable affected neither mode.
  • Two independent caches with identical settings and different timestamps produced and loaded separate, correct indices; warm reuse preserved both files.
  • Small-cache smoke checks covered concurrent cold starts, build-once behavior, warm reuse, partial-output recovery, and disabled mode.
  • Window selection and stable time sorting matched timestamp filtering; counts used only offsets without a holdout and matched filtered training windows with a holdout.

The workflow smoke checks used a small Parquet fixture with accelerator imports stubbed. Full GPU training was not run.

@JacoCheung
JacoCheung requested review from a team as code owners September 18, 2026 01:29
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot:
Thank you very much for your submission; we really appreciate it. Before we can accept your contribution,
we ask that you sign the MLCommons CLA (Apache 2). Please submit your GitHub ID to our onboarding form to initiate
authorization. If you are from a MLCommons member organization, we will request that you be added to the CLA.
If you are not from a member organization, we will email you a CLA to sign. For any questions, please contact
support@mlcommons.org.
0 out of 1 committers have signed the MLCommons CLA.
@JacoCheung
You can retrigger this bot by commenting recheck in this Pull Request

@JacoCheung
JacoCheung force-pushed the junzhang/ts_indices_preprocessing branch 2 times, most recently from 634bae3 to 06b1848 Compare September 18, 2026 02:30
@chriscai-amd

Copy link
Copy Markdown
Contributor

thanks for creating the PR, could we add a new subsection in the Direction section(seciton 2) in the benchmark README (https://github.com/mlcommons/training/tree/master/recommendation#readme) so people now how to use the use_offline_ts_indices feature?

@JacoCheung
JacoCheung force-pushed the junzhang/ts_indices_preprocessing branch 2 times, most recently from 6e75f5b to 8058429 Compare September 18, 2026 03:19
Build stable indices and offsets during cache preparation when enabled. Reuse read-only slices for streaming windows and offsets for sample counts, with serialized construction across ranks.
@JacoCheung
JacoCheung force-pushed the junzhang/ts_indices_preprocessing branch from 8058429 to 09612ef Compare September 18, 2026 03:46
@JacoCheung

Copy link
Copy Markdown
Author

thanks for creating the PR, could we add a new subsection in the Direction section(seciton 2) in the benchmark README (https://github.com/mlcommons/training/tree/master/recommendation#readme) so people now how to use the use_offline_ts_indices feature?

Could you check section training-data-order which I think reads more smoothly.

@chriscai-amd

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