Skip to content

Fix the gpt-oss example on huggingface_hub>=1.32: require trackio>=0.38.1 - #2669

Closed
h-guo18 wants to merge 1 commit into
mainfrom
haoguo/gpt-oss-trackio
Closed

h-guo18 wants to merge 1 commit into
mainfrom
haoguo/gpt-oss-trackio

Conversation

@h-guo18

@h-guo18 h-guo18 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: Bug fix

Replaces the stale trackio<0.21 cap in examples/gpt-oss/requirements.txt with trackio>=0.38.1. This fixes the trtllm (gpt-oss) example test, which feeds the required example-pr-required-check.

Root cause. datasets 5.1.0 was released on 2026-10-05 and requires huggingface_hub>=1.31. Installing the example's requirements now upgrades hub in the TRT-LLM image from 1.16.1 to 1.33.0. trackio<0.21 resolves to 0.20.2, which imports CommitOperationAdd from huggingface_hub.hf_api, and hub 1.32.0 stopped exporting it there. trl imports trackio when it writes the model card at the first checkpoint, so sft.py crashes even with --report_to none:

ImportError: cannot import name 'CommitOperationAdd' from 'huggingface_hub.hf_api'

Main's nightly example run on 2026-10-06 fails the same way.

Why a floor instead of the cap. The cap came from #1390. At that time the example still supported transformers 4.x (hub < 1.0), and newer trackio required hub >= 1.0. Since #1746 the example requires transformers>=5.3, which itself requires huggingface_hub>=1.3, so the cap no longer protects anything. 0.38.1 is the first trackio release that imports CommitOperationAdd from the top-level package.

Why not pin datasets<5.1. #2666 does that for the tf_min unit env. Here it would only make CI pass, because the image ships hub 1.16.1. A fresh pip install -r examples/gpt-oss/requirements.txt still resolves hub 1.33.0 with trackio 0.20.2 and hits the same error.

Usage

No API change.

Testing

  • Ran the CI job's steps (pip install -e ".[hf,dev-test]", the example requirements, then pytest tests/examples/gpt-oss) in nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc22. It matches the CI image (rc20) on transformers, datasets, accelerate and peft.
    • Before: test_gpt_oss_sft_toy fails. It resolves datasets 5.1.0, hub 1.33.0 and trackio 0.20.2, the same as CI.
    • After: it passes with trackio 0.40.0. The other 2 tests are skipped without --run-release, as in CI.
  • The example configs default to report_to: trackio. With that setting and trackio_space_id: null, sft.py trains, logs to the local trackio store, writes the model card and saves the model.
  • Imports in clean venvs:
    • trackio 0.20.2 imports with hub 1.31.0 and fails with 1.32.0 and 1.33.0.
    • With hub 1.33.0, trackio 0.38.0 fails, while 0.38.1 and 0.40.0 import.

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A (existing dependency, new version bound)
  • Did you write any new necessary tests?: N/A (covered by the existing test_gpt_oss_sft_toy)
  • Did you update Changelog?: N/A (example requirements only)
  • Did you get Claude approval on this PR?: N/A

Additional Information

This is a companion to #2666, which fixes the tf_min unit job for the same datasets release. Open PRs pick up the fix once they merge main, for example #2589.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when setting up the GPT-OSS example in newer Hugging Face Hub environments. This helps avoid setup issues related to changes in the Hub’s available interfaces.

…38.1

The trtllm (gpt-oss) example test has failed since datasets 5.1.0 was
released on 2026-10-05, on PRs and on main's nightly run. Installing the
example's requirements upgrades datasets to 5.1.0, which needs
huggingface_hub>=1.31, so pip moves hub from the image's 1.16.1 to 1.33.0.
trackio<0.21 resolves to 0.20.2, which imports CommitOperationAdd from
huggingface_hub.hf_api, and hub 1.32.0 stopped exporting it there. trl
imports trackio when it writes the model card at the first checkpoint, so
sft.py crashes even with --report_to none.

The <0.21 cap came from #1390, when the example still ran on transformers
4.x and newer trackio needed huggingface_hub>=1.0. Since #1746 the example
requires transformers>=5.3, which itself requires huggingface_hub>=1.3, so
the cap no longer protects anything. 0.38.1 is the first trackio release
that imports CommitOperationAdd from the top-level package.

Pinning datasets<5.1 instead would only fix CI, because the image ships hub
1.16.1. A fresh install still resolves huggingface_hub 1.33.0 with trackio
0.20.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
@h-guo18
h-guo18 requested a review from a team as a code owner October 6, 2026 08:20
@h-guo18
h-guo18 requested a review from kevalmorabia97 October 6, 2026 08:20
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: b82cf9df-0d7e-4c25-9759-6e831ebec089
📥 Commits

Reviewing files that changed from the base of the PR and between 01e3a30 and c9147c6.

📒 Files selected for processing (1)
  • examples/gpt-oss/requirements.txt

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The GPT-OSS example now requires trackio>=0.38.1 instead of trackio<0.21. A comment notes an import incompatibility between older Trackio versions and huggingface_hub>=1.32.

Changes

GPT-OSS dependency update

Layer / File(s) Summary
Trackio version constraint
examples/gpt-oss/requirements.txt
The requirement changes to trackio>=0.38.1. A comment notes the CommitOperationAdd import incompatibility with huggingface_hub>=1.32.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to c9147

No actionable merge-blocking risk is established for this requirement update; normal checks can proceed.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating the gpt-oss example to require a compatible Trackio version for newer huggingface_hub releases.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Security Anti-Patterns ✅ Passed The PR changes only examples/gpt-oss/requirements.txt. It updates the existing trackio constraint from <0.21 to >=0.38.1; it adds no new PIP dependency and changes no Python code. The diff int…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.19%. Comparing base (01e3a30) to head (c9147c6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2669   +/-   ##
=======================================
  Coverage   69.19%   69.19%           
=======================================
  Files         620      620           
  Lines       69654    69654           
=======================================
  Hits        48197    48197           
  Misses      21457    21457           
Flag Coverage Δ
examples-gpt-oss 13.45% <ø> (-0.02%) ⬇️
examples-hf_ptq 22.87% <ø> (-0.04%) ⬇️
examples-llm_eval 17.41% <ø> (ø)
unit 58.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@kevalmorabia97

Copy link
Copy Markdown
Collaborator

@h-guo18 Please see if #2649 fixed this

@h-guo18

h-guo18 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

fixed in #2649 , closing this PR

@h-guo18 h-guo18 closed this Oct 6, 2026
@kevalmorabia97
kevalmorabia97 deleted the haoguo/gpt-oss-trackio branch October 6, 2026 08:53
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