Skip to content

[None][fix] namespace cnn_dailymail calibration dataset id#16247

Closed
lonexreb wants to merge 2 commits into
NVIDIA:mainfrom
lonexreb:fix/cnn-dailymail-namespace
Closed

[None][fix] namespace cnn_dailymail calibration dataset id#16247
lonexreb wants to merge 2 commits into
NVIDIA:mainfrom
lonexreb:fix/cnn-dailymail-namespace

Conversation

@lonexreb

@lonexreb lonexreb commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Revives the stale, closed-unmerged PR #16124 (issue #15802).

load_calib_dataset("cnn_dailymail") passes the bare repo id to datasets.load_dataset. Newer huggingface_hub requires a namespace/name id and rejects the bare cnn_dailymail with HfUriError: Repository id must be ..., breaking INT8/SmoothQuant calibration.

Change

Rewrite the bare cnn_dailymail id to the relocated canonical abisee/cnn_dailymail before calling load_dataset (in tensorrt_llm/models/convert_utils.py). Other dataset ids are untouched.

Test

New CPU-only unit test in tests/unittest/others/test_calib_dataset_namespace.py (mocks load_dataset, no network): the bare id becomes abisee/cnn_dailymail; other ids (e.g. lambada) pass through unchanged.

Summary by CodeRabbit

  • Bug Fixes

    • Improved calibration dataset loading by using the correct namespaced identifier for CNN/DailyMail.
    • Preserved existing behavior for other dataset names.
  • Tests

    • Added coverage to verify CNN/DailyMail name conversion and unchanged handling of other datasets.

The bare 'cnn_dailymail' repo id was relocated to 'abisee/cnn_dailymail';
newer huggingface_hub rejects un-namespaced ids, so load_calib_dataset
failed with HfUriError. Rewrite the bare id before load_dataset.

Revives closed PR NVIDIA#16124 (issue NVIDIA#15802).

Signed-off-by: lonexreb <reach2shubhankar@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

load_calib_dataset now maps the bare cnn_dailymail identifier to abisee/cnn_dailymail. Unit tests verify this mapping and confirm that other dataset identifiers pass through unchanged.

Changes

Calibration Dataset Namespace Handling

Layer / File(s) Summary
Dataset identifier rewriting and validation
tensorrt_llm/models/convert_utils.py, tests/unittest/others/test_calib_dataset_namespace.py
load_calib_dataset rewrites cnn_dailymail to abisee/cnn_dailymail; tests verify the rewrite and unchanged forwarding of lambada.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change and uses the required ticket/type format.
Description check ✅ Passed The description clearly explains the bug, fix, and tests, though it omits the template's explicit Test Coverage and PR Checklist sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unittest/others/test_calib_dataset_namespace.py`:
- Around line 32-38: Add a test case alongside
test_other_dataset_ids_are_passed_through for
load_calib_dataset("ccdv/cnn_dailymail"), mocking convert_utils.load_dataset and
asserting it receives the qualified identifier unchanged; retain the existing
bare-identifier mapping behavior separately.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6b3bb42b-ac6f-4792-9c49-1ad3a184cae6

📥 Commits

Reviewing files that changed from the base of the PR and between edf8f6f and f10c5c0.

📒 Files selected for processing (2)
  • tensorrt_llm/models/convert_utils.py
  • tests/unittest/others/test_calib_dataset_namespace.py

Comment on lines +32 to +38
def test_other_dataset_ids_are_passed_through() -> None:
with mock.patch.object(
convert_utils, "load_dataset", return_value={"text": ["x"]}
) as load_dataset:
load_calib_dataset("lambada")

assert load_dataset.call_args.args[0] == "lambada"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover the qualified CNN/DailyMail identifier as a pass-through case.

lambada verifies generic pass-through behavior, but ccdv/cnn_dailymail is the important boundary case: it must not be rewritten because only the bare identifier should map to abisee/cnn_dailymail.

Proposed test extension
-def test_other_dataset_ids_are_passed_through() -> None:
+@pytest.mark.parametrize("dataset_name", ["lambada", "ccdv/cnn_dailymail"])
+def test_other_dataset_ids_are_passed_through(dataset_name: str) -> None:
...
-        load_calib_dataset("lambada")
+        load_calib_dataset(dataset_name)
...
-    assert load_dataset.call_args.args[0] == "lambada"
+    assert load_dataset.call_args.args[0] == dataset_name

As per path instructions, important edge cases should be covered; no QA-list update is needed for this unit-only change.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def test_other_dataset_ids_are_passed_through() -> None:
with mock.patch.object(
convert_utils, "load_dataset", return_value={"text": ["x"]}
) as load_dataset:
load_calib_dataset("lambada")
assert load_dataset.call_args.args[0] == "lambada"
`@pytest.mark.parametrize`("dataset_name", ["lambada", "ccdv/cnn_dailymail"])
def test_other_dataset_ids_are_passed_through(dataset_name: str) -> None:
with mock.patch.object(
convert_utils, "load_dataset", return_value={"text": ["x"]}
) as load_dataset:
load_calib_dataset(dataset_name)
assert load_dataset.call_args.args[0] == dataset_name
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/others/test_calib_dataset_namespace.py` around lines 32 - 38,
Add a test case alongside test_other_dataset_ids_are_passed_through for
load_calib_dataset("ccdv/cnn_dailymail"), mocking convert_utils.load_dataset and
asserting it receives the qualified identifier unchanged; retain the existing
bare-identifier mapping behavior separately.

Source: Path instructions

Ensure the already-qualified id is not rewritten (only the bare
cnn_dailymail maps to abisee/cnn_dailymail).

Signed-off-by: lonexreb <reach2shubhankar@gmail.com>
@lonexreb

Copy link
Copy Markdown
Contributor Author

Addressed in ee0ce56: parametrized the pass-through test to also cover ccdv/cnn_dailymail (the already-qualified id must not be rewritten).

@karljang
karljang requested review from a team, BowenFu and brnguyen2 and removed request for a team, BowenFu and brnguyen2 July 14, 2026 13:53
@karljang

Copy link
Copy Markdown
Collaborator

@lonexreb ,
Thank you for the contribution. I'm closing this PR because it targets the legacy TensorRT backend path, which is planned for deprecation. New feature development should target the PyTorch backend instead. If the same issue affects either of those paths, we'd welcome a PR addressing it there.
Thank you again for your time and effort.

@karljang karljang closed this Jul 14, 2026
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.

2 participants