Skip to content

Run the SFT assistant-mask suite on PRs (version-compat bundle guard red on main) - #18827

Merged
danielhanchen merged 2 commits into
mainfrom
fix/version-compat-core-zoo-suite
Nov 22, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/version-compat-core-zoo-suite

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

workflow-trigger lint is red on main and on every open PR since #18809:

tests/studio/test_version_compat_bundle.py::test_every_suite_still_runs_on_a_pull_request
AssertionError: these version-compat suites are not run by any pull_request job:
['tests/version_compat/test_sft_assistant_mask_fallback_trainer.py']

#18809 added tests/version_compat/test_sft_assistant_mask_fallback_trainer.py, which drives the real UnslothSFTTrainer through TRL's assistant-only-loss path and so needs torch, TRL and unsloth. The guard is right: nothing runs it on a PR. Naming it in version-compat-ci.yml's pinned-symbol-matrix bundle would not help, because that job installs only pytest and the suite would just skip. The consolidated-zoo full sweep does not reach it either: that step runs from the zoo checkout, so its tests/ is the zoo's.

Fix

  • New HARD GATE step in the consolidated (Core) job, which installs the real stack across all three transformers / TRL combos, running the suite by path from this checkout.
  • RUN_BY_CORE in the bundle guard lists suites covered that way, and test_suites_left_to_the_core_job_run_there checks the claim instead of trusting it: consolidated-tests-ci.yml must trigger on pull_request, the consolidated job must not be gated to schedule or dispatch, and one of its steps must name the file without a working-directory (a step run from another checkout collects that repo's tests).
  • test_the_core_job_check_is_not_vacuous mutates the parsed workflow three ways (path replaced by a directory sweep, step moved under the zoo checkout, job gated on schedule) and asserts each is reported.

Testing

  • tests/version_compat/test_sft_assistant_mask_fallback_trainer.py with real torch, TRL 1.15 and transformers 5.17 on CPU: 1 passed.
  • tests/studio/test_version_compat_bundle.py: 9 passed; the unmodified guard from main still fails on the same file.
  • Every suite workflow-trigger-lint.yml runs, plus the suites that read consolidated-tests-ci.yml: no new failures (one pre-existing local-only failure from this host's cache environment variables, green in CI).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T02:57:14.971006Z e5f8fa6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59b370eb35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +110 to +114
for step in job.get("steps") or []:
body = str(step.get("run", ""))
if not re.search(r"-m pytest\b[^\n]*\stests/(?:\s|\\|$)", body):
continue
ignored = re.findall(r"--ignore(?:-glob)?=['\"]?([^\s'\"\\]+)", body)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Verify the sweep runs in this repository before exempting the suite

The inspected consolidated-zoo sweep runs with working-directory: ${{ runner.temp }}/unsloth-zoo in .github/workflows/consolidated-tests-ci.yml:2137, so its relative tests/ argument collects the separate unsloth-zoo checkout, not this repository's tests/version_compat/test_sft_assistant_mask_fallback_trainer.py. This helper nevertheless reports coverage because it only checks the command text and ignore flags. Exempting the suite therefore silences the existing coverage failure without actually running the SFT regression test on PRs. Wire the suite into an install-bearing PR job in this repository and validate the sweep's working directory before treating it as coverage.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, that sweep runs with working-directory: ${{ runner.temp }}/unsloth-zoo, so it collects the zoo's tests and the exemption was hollow. Fixed in e5f8fa6: the suite now runs by path in a step of the consolidated (Core) job, which has the real torch / TRL / unsloth stack, and the guard only counts a step with no working-directory. A mutation test covers the directory sweep, the moved working directory and a schedule-only gate.

@danielhanchen danielhanchen changed the title Version-compat bundle guard: count the SFT mask suite that Core zoo already runs Run the SFT assistant-mask suite on PRs (version-compat bundle guard red on main) Nov 22, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e5f8fa69ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8deec04 into main Nov 22, 2026
@danielhanchen
danielhanchen deleted the fix/version-compat-core-zoo-suite branch November 22, 2026 03:35
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.

1 participant