Repository navigation
Studio: train the system column of an Alpaca dataset - #14392
Conversation
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5cc31c5be
ℹ️ 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".
|
|
||
| def _format_alpaca(examples): | ||
| texts = [] | ||
| systems = examples.get("system") or [None] * len(examples["instruction"]) |
There was a problem hiding this comment.
Avoid truth-testing formatted system batches
When an Alpaca Dataset is saved with NumPy formatting and reloaded through the supported local load_from_disk path in studio/backend/core/training/worker.py:3371-3377, the batched map supplies system as an ndarray. For the normal multi-row batch, this or attempts to coerce the whole array to a boolean and raises the NumPy "truth value is ambiguous" error before the per-row fallback runs, so training a previously valid dataset now fails during formatting. Choose the fallback only when the column is missing or None, rather than boolean-coercing the batch container.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b6dc8c9: the fallback now checks for a missing column instead of truth-testing the batch, with a numpy-formatted dataset test.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Review + reproduction evidencePinned review: I reproduced the Train page flow on the merge base
Conclusion: real, fixed. Waiting on upstream CI for the final head. |
…nstead of clearing them (#1913) ## Problem `tests/test_fused_forward_fp16_scaler.py::test_fused_forward_fp16_uses_accelerator_scaler` (added in #1906) fails in the unsloth repo's `Core zoo (HF=default + TRL=default)` job, which runs this suite with `-n 4 --dist loadfile`. It fails on unrelated PRs there, for example unslothai/unsloth#14392 and unslothai/unsloth#14350: ``` tests/test_fused_forward_fp16_scaler.py:45: in test_fused_forward_fp16_uses_accelerator_scaler assert fi.install_for_class(LlamaForCausalLM) E AssertionError: assert False ``` It passes on its own. It fails whenever `tests/test_fused_forward_install.py` ran earlier in the same worker: ``` $ pytest tests/test_fused_forward_install.py tests/test_fused_forward_fp16_scaler.py FAILED tests/test_fused_forward_fp16_scaler.py::test_fused_forward_fp16_uses_accelerator_scaler 1 failed, 34 passed, 11 skipped ``` That file's `fresh_install` fixture clears `_PATCHED`, `_UNMATCHED`, `_FAILED` and `_CANONICAL_FORWARDS` before and after every test. A class patched before the file ran keeps its rewritten `forward` but loses its `_PATCHED` entry. The next `install_for_class` on it then reads non-stock source and declines. Which file lands on which worker decides whether this shows up, so it looks intermittent. ## Fix Test only. The fixture still gives each test empty registries. It now snapshots the four registries first and puts their contents back afterwards, instead of clearing them on the way out. ## Verification Run on CPU (torch 2.10.0+cpu, transformers 5.17.0 as the `Core zoo` job uses, and 5.18.0), with `UNSLOTH_IS_PRESENT=1` and unsloth main on the path: - `pytest tests/test_fused_forward_install.py tests/test_fused_forward_fp16_scaler.py` - before: 1 failed, 34 passed, 11 skipped - after: 35 passed, 11 skipped - `tests/test_fused_forward_fp16_scaler.py` alone: 2 passed, before and after.

An Alpaca dataset with a per-row system prompt (system, instruction, input, output, the layout LLaMA-Factory documents) is detected as Alpaca with no mapping needed, but the system text never reaches a training row. Every row gets the fixed "Below is an instruction..." preamble instead, so the persona, rules or tool list kept in that column are silently lost, and nothing in the preview or the run warns about it.
A non-empty text system cell now takes the place of the default preamble in that row. For models without their own chat template, this is the same layout Studio saves as the Alpaca chat template, which puts a system message in place of the preamble at inference. Rows with no system column, a blank one, or a non-text value are formatted exactly as before. Only a column named exactly "system" is read, the same rule the ShareGPT and ChatML path follows since #12614. Mapped Alpaca columns and chat data converted to Alpaca keep their current layout, where system text goes into the Input section.