Skip to content

feat(agentic): auto-download official dataset - #489

Open
tianmu-li wants to merge 4 commits into
mlcommons:mainfrom
tianmu-li:feat/agentic_dataset_download
Open

tianmu-li wants to merge 4 commits into
mlcommons:mainfrom
tianmu-li:feat/agentic_dataset_download

Conversation

@tianmu-li

Copy link
Copy Markdown
Collaborator

feat(agentic): auto-download official dataset

What does this PR do?

Add out-of-the-box download support for the official MLPerf Agentic Inference
dataset when the predefined agentic_inference_conversations dataset is
configured without a local path.

The Kimi and Qwen agentic inference configs now use the predefined dataset ID
without a hard-coded dataset path. The example README documents the automatic
download behavior and the fallback for users supplying a custom JSONL path.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor/cleanup

Related issues

Related to #488, which added
the official dataset link and checksum to the Agentic Inference README.

Testing

  • Tests added/updated
  • All tests pass locally
  • Manual testing completed

Checklist

  • Code follows project style
  • Pre-commit hooks pass
  • Documentation updated (if needed)

@tianmu-li
tianmu-li requested review from a team and a lite review from Copilot August 27, 2026 21:56
@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot added the size/normal PR Review Policy: <=500 non-test lines & <=20 files label Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-run, out-of-the-box download + local caching for the official MLPerf Agentic Inference dataset when the predefined agentic_inference_conversations dataset is used without a local path, so example configs can reference the predefined dataset ID directly.

Changes:

  • Implemented download/caching + SHA-256 verification for agentic_inference_conversations in the dataset manager.
  • Updated the Agentic Inference example configs to use the predefined dataset (no hard-coded path).
  • Added a unit test for the download/caching flow and updated the example README to document the behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/inference_endpoint/dataset_manager/agentic_inference_dataset.py Adds automatic download/caching and SHA-256 verification for the official Agentic Inference dataset.
tests/unit/dataset_manager/test_agentic_inference_dataset.py Adds a unit test that exercises the auto-download/cache behavior via monkeypatching.
examples/10_Agentic_Inference/README.md Documents automatic download behavior and how to use a custom JSONL instead.
examples/10_Agentic_Inference/qwen_agentic_benchmark.yaml Switches to the predefined agentic_inference_conversations dataset ID (no path).
examples/10_Agentic_Inference/kimi_agentic_benchmark.yaml Switches to the predefined agentic_inference_conversations dataset ID (no path).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/inference_endpoint/dataset_manager/agentic_inference_dataset.py Outdated
Comment thread src/inference_endpoint/dataset_manager/agentic_inference_dataset.py Outdated
Comment thread src/inference_endpoint/dataset_manager/agentic_inference_dataset.py Outdated
@codecov-commenter

codecov-commenter commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.58879% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@a47510b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...t/dataset_manager/predefined/open_orca/__init__.py 25.00% 6 Missing ⚠️
src/inference_endpoint/dataset_manager/download.py 95.83% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #489   +/-   ##
=======================================
  Coverage        ?   81.40%           
=======================================
  Files           ?      152           
  Lines           ?    20522           
  Branches        ?        0           
=======================================
  Hits            ?    16706           
  Misses          ?     3816           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings August 27, 2026 22:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/inference_endpoint/dataset_manager/agentic_inference_dataset.py:263

  • _verify_sha256() uses path.read_bytes(), which loads the entire dataset into memory. The official Agentic dataset can be large, so this risks high peak RAM usage (and OOM) just to compute the checksum. Stream the file in chunks when hashing.
    def _verify_sha256(cls, path: Path) -> None:
        """Raise ValueError if the cached dataset is not the official artifact."""
        digest = hashlib.sha256(path.read_bytes()).hexdigest()
        if digest != cls.DATASET_SHA256:
            raise ValueError(

@hvagadia hvagadia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this in.

@leopck

leopck commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

probably need to address those comments from copilot but good feature to have

Comment on lines +259 to +266
def _verify_sha256(cls, path: Path) -> None:
"""Raise ValueError if the cached dataset is not the official artifact."""
digest = hashlib.sha256(path.read_bytes()).hexdigest()
if digest != cls.DATASET_SHA256:
raise ValueError(
f"SHA-256 mismatch for {path.name}: "
f"expected {cls.DATASET_SHA256}, got {digest}"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we chunk/paginate this file read and also extract this function to a utility file - this would be useful for other files where we would like to compute the SHA.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centralized MLCommons R2 downloader and sha256 verification from agentic inference, bfcl, and open-orca. It became a decently-sized refactor so please let me know if this is the right direction.

Copilot AI review requested due to automatic review settings September 1, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new download helper uses Path.rglob(artifact_name) which interprets the artifact name as a glob pattern and can select the wrong file or report ambiguity for certain filenames.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/inference_endpoint/dataset_manager/download.py
Copilot AI review requested due to automatic review settings September 1, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new downloader utility executes a fetched shell script but is missing a couple of low-cost hardening checks (commit ref validation, clearer fetch failure context, and symlink filtering) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

src/inference_endpoint/dataset_manager/download.py:90

  • download_r2_artifact() accepts downloader_commit as a free-form string, so callers can pass a mutable ref like main (or a non-SHA path fragment), undermining the “pinned script” guarantee and weakening the trust model for executing the downloaded shell script. Consider validating this argument as a 40-character hex commit SHA before building the URL.
    src/inference_endpoint/dataset_manager/download.py:100
  • If fetching the downloader script fails (DNS, TLS, 404, etc.), the current code will surface a raw requests exception without context about which URL was being fetched. Wrapping it in a RuntimeError with the URL makes CLI failures much easier to diagnose.
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +127 to +131
candidates = [
path
for path in destination_dir.rglob("*")
if path.is_file() and path.name == artifact_name and path != script_path
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/normal PR Review Policy: <=500 non-test lines & <=20 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants