Repository navigation
CI: pass workflow_dispatch inputs to shell through env - #18969
Merged
Merged
Conversation
kaggle-collect max_age_hours sat inside a shell script beside the Kaggle token; docker-publish unsloth_zoo_ref and startup-profile repeats had the same shape. Route them through env and validate max_age_hours as a number. Add a test that fails on any string input or free-text event field interpolated into a run: block.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
danielhanchen
added a commit
that referenced
this pull request
Nov 23, 2026
…VFP4 nested kernel, Kaggle input via env) (#19027) ## Summary Four tests are red on `main` and fail on every PR whose staging run includes them (seen on #18918, #18925 and #19000). Each was reproduced on `main` before fixing. In all four the code under test is right and the test is not. | Failing test (shard) | Introduced by | Cause | Fix | |---|---|---|---| | `test_diffusion_ddp_effective_precision.py::test_real_gloo_two_ranks[fp8,*]` (`(Python 3.13, diffusion)`) | #18967 | The verdicts are right (`SAME`, `REFUSED ...`), but gloo prints `[Gloo] Rank N is connected to 1 peer ranks ...` on the child's stdout first, and the test required the output to start with the verdict. | Read the verdict from the child's last line. | | `test_diffusion_base_precision.py::test_resolve_auto_uses_klein_variant_size` and `test_auto_sizes_flux2_klein_9b_off_its_own_weights[*]` (`(Python 3.13, diffusion)`): `'nf4' == 'fp8'` | #18967 | Near the 8-bit band (20 GB free against the 18.2 GB dense 9B), Auto's fp8 pick also checks host RAM through `_auto_swap_host_ram_ok`, because that load holds the bf16 base on the host. The tests fake the GPU but read the runner's real RAM, so a 16 GB CI runner gets `nf4` (correctly) and a large dev box gets `fp8`. | An autouse fixture pins host RAM high, like the file's existing `_not_rocm` pin, since these cases simulate GPU tiers. New `test_klein_9b_near_the_8bit_band_falls_back_to_nf4_on_a_small_host` pins the small-host fallback explicitly. | | `tests/test_nvfp4_qat_backward_skip.py::test_cpu_forward_kernel_is_restored_on_exit` (`Repo tests (CPU, rest)`): `there's already a kernel registered from python overriding nvfp4_qat_linear_v2's behavior for CPU` | #18864 | The test enters `_cpu_forward_kernel(op)` inside the module-scoped `op` fixture, which has already registered that kernel. torch 2.10 refuses a second Python registration for the same op, key and namespace, so the test fails on every run. | The `op` fixture is per test, and the restore test takes the bare op (new `raw_op` fixture), so it checks a real register-then-restore from a clean state. | | `tests/kaggle/test_fire_and_forget.py::test_every_gate_budget_covers_the_reaper_window` (`Repo tests (CPU, rest-2)`): `the collector's default age ceiling is not readable from the workflow` | #18969 | #18969 correctly moved the dispatch input out of the script into `MAX_AGE_HOURS: ${{ inputs.max_age_hours \|\| '3' }}`, and the test's regex only knew the inline form. | Read the default from either form, and when it is an env var, assert that variable is what reaches `--max-age-hours`. | Only tests change. ## Testing - The four files: all red on `main`. With this change, 98 passed / 6 skipped (the two diffusion files) and 125 passed (the NVFP4 and Kaggle files); `tests/kaggle/` as a whole: 1081 passed. - Sabotage, each guard still catches what it is for: - **gloo:** making `check_effective_precision` a no-op fails the `REFUSED` case. - **klein:** removing the host RAM gate from `_resolve_base_precision` fails the new small-host test. Forcing a 16 GB runner over the whole file fails the same 5 cases CI did, plus the new one. - **NVFP4:** keeping the test library alive instead of destroying it fails the restore test. - **Kaggle:** a workflow default of `9` fails (it no longer matches `collect.DEFAULT_MAX_AGE_HOURS`), and so does not passing `$MAX_AGE_HOURS` to `--max-age-hours` (`MAX_AGE_HOURS never reaches --max-age-hours`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kaggle-collect.ymlpasted the free-textmax_age_hoursdispatch input straight into itsrun:script inside single quotes, in the same step that hasKAGGLE_API_TOKENin its environment, so a value like'; cmd; 'would run as shell. Only people with write access can dispatch the workflow, but it is cheap to close.The input now goes through
env:, is checked against^[0-9]+([.][0-9]+)?$, and is passed as"$MAX_AGE_HOURS". Scheduled runs use the default (3) as before, and valid dispatches behave the same; a non-number already failed the script's float argument.The same pattern is moved to
env:indocker-publish.yml(unsloth_zoo_ref) andstartup-profile-ci.yml(repeats). Neither has secrets in that step.Test:
tests/security/test_workflow_free_text_inputs_not_in_shell.pyparses every workflow and fails on a string-typed input or a free-text event field (PR title / body,head_ref, label name, comment,client_payload) inside${{ }}in arun:block.