-
Notifications
You must be signed in to change notification settings - Fork 0
Training data pipeline: disk-backed memmap rounds, background producer, batched tf.data input #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zachtheyek
wants to merge
13
commits into
master
Choose a base branch
from
feature/training-data-pipeline
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f3cb92a
Add pytest scaffolding: conftest fixtures, markers, synthetic data fa…
zachtheyek fa71424
Add CI test workflow: pytest on PRs + master pushes (py3.10/3.12, TF-…
zachtheyek 3a0e3e3
Document the test suite in CLAUDE.md, CONTRIBUTING.md, and repo-conte…
zachtheyek 9b379eb
Apply code-review findings: shared integration fixtures, CI hdf5plugi…
zachtheyek bebbae1
Add round_data module (memmap round datasets, producer) + ManagedProcess
zachtheyek 0525169
Rewrite data generation: batched tasks writing straight into round me…
zachtheyek 3a84ac1
Train on disk-backed rounds: batched tf.data input + producer scheduling
zachtheyek 0cc7328
Add round-data config fields, CLI flags, and disk-budget validation
zachtheyek caf07ef
Add unit tests for round data, batched generation, datasets, processes
zachtheyek 3f0b701
Apply self-review findings: resilient drainer, stale message reference
zachtheyek b114183
Start the RoundDataProducer via spawn (fork inherited a deadlocked lock)
zachtheyek 291334f
Producer logging via a spawn-context relay queue; real spawn e2e test
zachtheyek 2bfa118
Apply review: flush in finally, clarifying notes
zachtheyek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # Unit test suite (pytest) | ||
| name: Tests | ||
|
|
||
| # Run on every PR and on pushes to master | ||
| on: | ||
| push: | ||
| branches: ["master"] | ||
| pull_request: | ||
| branches: ["**"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| # Let both Python versions report rather than cancelling the sibling on first failure | ||
| fail-fast: false | ||
| matrix: | ||
| # The two supported runtimes: conda env (3.10) and NGC container (3.12) | ||
| python-version: ["3.10", "3.12"] | ||
|
|
||
| steps: | ||
| # Pull repo contents into GitHub Actions runner | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| # Install the matrix Python version, with built-in pip caching keyed on the | ||
| # dependency pins (invalidates when requirements-container.txt changes) | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: "pip" | ||
| # Include the workflow itself so the inline pins below also invalidate the cache | ||
| cache-dependency-path: | | ||
| requirements-container.txt | ||
| .github/workflows/tests.yml | ||
|
|
||
| # Mirror the NGC container's dependency surface on a CPU-only runner: | ||
| # tensorflow-cpu stands in for the container's GPU TF 2.17 build, the pinned | ||
| # extras come from requirements-container.txt, and h5py/hdf5plugin/pandas/ | ||
| # psutil/pytest are installed explicitly because the NGC base image ships | ||
| # them (so the requirements file intentionally omits them; hdf5plugin is | ||
| # pinned explicitly in environment.yml too — don't rely on setigen pulling | ||
| # it transitively) | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install "tensorflow-cpu==2.17.*" -r requirements-container.txt h5py hdf5plugin pandas psutil pytest | ||
|
|
||
| # GPU- and cluster-marked tests need physical GPUs / cluster-resident data; | ||
| # everything else (including slow CPU TF graph tests) runs here | ||
| - name: Run test suite | ||
| run: pytest -m "not gpu and not cluster" -q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good design — keeping this stdlib-only so
utils/print_cli_help.pydoesn't need numpy.One note: the U20 label size calculation (
n_samples * 20 * 4) is correct for numpy's UCS-4 encoding on disk, but could drift ifnp.savechanges encoding or if labels grow beyond U20. A brief inline comment noting the assumption (e.g.# numpy U20 on-disk: 20 UCS-4 codepoints × 4 bytes each) would help future maintainers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption is already annotated inline on that line: labels_bytes = n_samples * 20 * 4 # numpy "U20" = 20 UCS-4 code points per label — so skipping an additional comment to avoid duplication. If labels ever outgrow U20, the dtype literal and this estimate live one grep apart.