feat(agentic): auto-download official dataset - #489
Conversation
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
There was a problem hiding this comment.
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_conversationsin 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.
| 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}" | ||
| ) |
| 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, | ||
| ) |
| 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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()usespath.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
left a comment
There was a problem hiding this comment.
Thanks for getting this in.
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_conversationsdataset isconfigured 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
Related issues
Related to #488, which added
the official dataset link and checksum to the Agentic Inference README.
Testing
Checklist