Skip to content

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

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

feat(agentic): auto-download official dataset#489
tianmu-li wants to merge 2 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 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}"
)
Comment on lines +293 to +305
result = subprocess.run(
[
"bash",
str(script_path.resolve()),
"-d",
str(cache_dir),
cls.R2_DATASET_URI,
],
stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE,
text=True,
check=False,
)
Comment on lines +283 to +289
downloader_url = (
"https://raw.githubusercontent.com/mlcommons/r2-downloader/"
f"{cls.R2_DOWNLOADER_COMMIT}/mlc-r2-downloader.sh"
)
response = requests.get(downloader_url, timeout=30)
response.raise_for_status()
script_path.write_bytes(response.content)
@codecov-commenter

codecov-commenter commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@a47510b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #489   +/-   ##
=======================================
  Coverage        ?   81.31%           
=======================================
  Files           ?      151           
  Lines           ?    20515           
  Branches        ?        0           
=======================================
  Hits            ?    16681           
  Misses          ?     3834           
  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.

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.

4 participants