Skip to content

fix: use ceil for minimum num_files_train (rule 3.1.2)#796

Merged
FileSystemGuy merged 1 commit into
review-base/pre-ceil-fixfrom
fix/rule-3.1.2-ceil-num-files-train
Jul 15, 2026
Merged

fix: use ceil for minimum num_files_train (rule 3.1.2)#796
FileSystemGuy merged 1 commit into
review-base/pre-ceil-fixfrom
fix/rule-3.1.2-ceil-num-files-train

Conversation

@FileSystemGuy

Copy link
Copy Markdown
Contributor

Summary

  • Rule 3.1.2's memory-derived minimum (5 × host_memory / record_length / samples_per_file) is a float. Datagen and the runtime verifier were truncating to floor via // and int(), so a dataset sized to the floor passed at runtime but the post-submission checker re-derived the threshold as a float and rejected the same dataset by a single file.
  • The submission-checker error message also int()-truncated the float, producing a confusing "4710038 < 4710038".
  • Fix: use math.ceil for min_num_files_by_bytes and min_num_files_by_samples in rules/utils.py, and for min_total_files in the 3.1.2 check. All three sites (datasize/dry-run, runtime verifier, submission checker) now agree.

Note

This is a retroactive review PR. Commit f9d414d was already pushed to main (bypassing the PR requirement). The base of this PR (review-base/pre-ceil-fix) points at 90bc58e, the parent of the fix, so the diff is viewable for review.

Test plan

  • uv run pytest tests — 2913 passed
  • uv run pytest mlpstorage_py/tests — 853 passed
  • uv run pytest vdb_benchmark/tests — 174 passed
  • uv run pytest kv_cache_benchmark/tests — 238 passed

…3.1.2

The memory-derived minimum (5x host memory / record_length / samples_per_file)
is a float. Datagen and the runtime verifier truncated to floor via `//` and
`int()`, so a dataset sized to the floor passed at runtime. Rule 3.1.2 in the
submission checker then re-derived the threshold as a float and rejected the
same dataset by a single file, with a confusing "N < N" message because the
error also `int()`-truncated the float for display.

Compute both min_num_files_by_bytes and min_num_files_by_samples with
math.ceil in rules/utils.py so datasize/dry-run and the runtime verifier
report the ceil. Compute min_total_files with math.ceil in the 3.1.2 check
so the comparison is int-vs-int and the violation message shows the true
required count.
@FileSystemGuy
FileSystemGuy requested a review from a team as a code owner July 15, 2026 18:36
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@FileSystemGuy
FileSystemGuy merged commit bcc1124 into review-base/pre-ceil-fix Jul 15, 2026
5 checks passed
@FileSystemGuy
FileSystemGuy deleted the fix/rule-3.1.2-ceil-num-files-train branch July 15, 2026 18:36
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.

1 participant