Skip to content

[Tests][CI] gqa_decode and eager can fail; route workflow runs on pull requests - #431

Merged
YWHyuk merged 2 commits into
pytorchsim-triton-backendfrom
item9/tests-and-triggers
Oct 23, 2026
Merged

YWHyuk merged 2 commits into
pytorchsim-triton-backendfrom
item9/tests-and-triggers

Conversation

@YWHyuk

@YWHyuk YWHyuk commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Closes #425

Why

  • tests/ops/attention/test_gqa_decode.py printed PASS/FAIL and exited 0 either way.
  • tests/system/test_eager.py printed z and asserted nothing. It is on the route allowlist (scripts/ci/triton_route_passing.txt:278), so the allowlist counted it as passing whatever it computed.
  • .github/workflows/pytorchsim_triton_backend.yml ran only on a push to pytorchsim-triton-backend, so a pull request had no route check before it landed. Its paths filter also left out files the jobs run or hash.

What changed (before -> after)

file before after
tests/ops/attention/test_gqa_decode.py:8-9,202 print PASS/FAIL, rc=0 always test_result("GQADecodeOptimized", out_dev, out_cpu, rtol=0, atol=0.05). Same threshold as before; the only change is that exactly 0.05 now passes (<= instead of <). NaN still fails.
tests/system/test_eager.py:6-7 prints z compares z with x_cpu + x_cpu * y_cpu through test_result
workflow on: push only push + pull_request into pytorchsim-triton-backend, sharing one path list (&route_paths :24 / *route_paths :42)
workflow base (:69) / route always run only on push or dispatch, or on a PR whose head is in this repository, so fork code never reaches the self-hosted runners. route follows through needs: base.
workflow bundle (:238) always skipped on pull_request (it takes up to 4h on the shared runners). Its propose step was already push-only.
workflow paths — adds device/**, tests/**, docker/Dockerfile, scripts/ci/ghcr_manifest_code.sh, scripts/selection_merge.py, third_party/github-releases.json (hashed by scripts/ci/third_party_base_pin.sh:7)

Tests (before -> after)

Container image topk-ptb:pts-base-92028c8, TORCHSIM_TIMING_MODE=0. Parent is 069878a, branch is e205b81.

test run parent branch
tests/system/test_eager.py real – rc=0, "Eager mul + add Test Passed"
test_eager.py wrong device result (z = x + z + x) rc=0 (prints 3s) rc=1, max abs diff 1.0
test_eager.py wrong reference (+ 1) – rc=1
tests/ops/attention/test_gqa_decode.py real, default S=10240 T=4096 – rc=0, max diff 3.8e-05
test_gqa_decode.py --context_length 1024 --tile_size 512 real – rc=0, max diff 1.22e-04
same wrong reference (out_cpu + 1) rc=0, prints "FAIL (diff too large)" rc=1, max abs diff 1.00098

Verification of the workflow change

  • actionlint 1.7.12: rc=0 with no findings on both the parent and the branch file, with the runner labels declared and shellcheck off.
  • YAML parse: yaml.safe_load gives identical push and pull_request path lists.
  • Trigger dry run (glob matcher):
    • A PR into the branch touching tests/** or pytorchsim/** now fires. On the parent, neither fired.
    • A PR into master, or one touching only docs/, does not fire.
    • A push touching any of the six added paths now fires. On the parent, none did.
  • Concurrency: the group is triton-route-${{ github.ref }}, so each PR gets its own group (refs/pull/N/merge).
  • PR inputs: on a PR, inputs.sweep_jobs is empty, which the case at :199 accepts. SOURCE_SHA is the merge commit, the same commit checkout uses.
  • Independent review: a second agent re-ran every pin and the actionlint/YAML checks in its own container and worktree. Verdict: ACCEPT.

Stacking / dependencies

Open issues

  1. .claude/CLAUDE.md:101 still says the workflow "runs when the compiler pin itself moves", and the workflow header at :6 says the same. Both are now incomplete, because the workflow also runs on PRs into the branch. .claude/CLAUDE.md:97 calls docker-image.yml "the PR gate", but that workflow has only workflow_dispatch. That error predates this change. None of these lines were edited here.
  2. PR sweeps now upload triton-route-coverage artifacts. scripts/ci/triton_route_previous.py reads the newest one regardless of event, so a PR run can set the job order of the next push sweep. This affects ordering only, which that script already treats as best effort. previous_bundle.sh reads push runs only.
  3. A same-repo PR that moves the PTB pin builds and pushes a new base image tag, because base has packages: write. docker/Dockerfile.base has no COPY or ADD, so the tag is a hash of exactly what decides the image's contents. A PR therefore cannot overwrite a tag the branch uses with different contents.
  4. test_gqa_decode.py is in neither scripts/ci/triton_route_passing.txt nor the pytorchsim_test.yml matrix, so CI still does not run it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UnJWSTNtd6944XAzy4bhk5

test_gqa_decode.py printed PASS or FAIL and exited 0 either way; it now
compares through _pytorchsim_utils.test_result at the threshold it printed
(atol 0.05, rtol 0). test_eager.py printed z and asserted nothing, though it
is on the route allowlist; it now compares z with x + x * y on the CPU.

Checked in the base image (topk-ptb:pts-base-92028c8), TORCHSIM_TIMING_MODE=0:
- test_eager.py: real run rc=0 (Test Passed). Device result made wrong
  (z = x + z + x): parent rc=0 (prints 3s), this commit rc=1. Reference made
  wrong (+1): rc=1.
- test_gqa_decode.py: real run rc=0 at the default (S 10240, T 4096,
  max diff 3.8e-05) and at S 1024 / T 512. Reference made wrong (+1):
  parent prints "FAIL (diff too large)" and exits 0, this commit exits 1.

Refs #425
…ths the jobs run trigger it

The Triton route workflow ran only on a push to pytorchsim-triton-backend, so
an open pull request had no route check before it landed. It now also runs on
pull_request into that branch, on the same path list (one YAML anchor):
- base and route run only for a head in this repository: the runners are
  self-hosted, so a fork's code never runs on them;
- bundle is skipped on pull_request (up to four hours on the shared runners);
  its propose step was already push-only.

The paths filter missed files the jobs run or hash: tests/** (the sweep),
device/** (the extension the route builds, and a PTS_INPUTS id of the
bundle), docker/Dockerfile (the device build the route mirrors),
third_party/github-releases.json (hashed into the base pin by
third_party_base_pin.sh), scripts/ci/ghcr_manifest_code.sh (both registry
checks), scripts/selection_merge.py (the bundle step).

Checked: actionlint 1.7.12 clean on this file (runner labels declared);
yaml.safe_load gives identical push and pull_request path lists; a glob
dry-run of the trigger: a PR into the branch touching pytorchsim/** or
tests/** fires (parent: no), a PR into master or touching only docs/ does
not; a push touching tests/, device/, docker/Dockerfile,
ghcr_manifest_code.sh, selection_merge.py or github-releases.json fires
(parent: no).

Refs #425
@YWHyuk YWHyuk self-assigned this Oct 23, 2026
@YWHyuk
YWHyuk merged commit 2ff2fb6 into pytorchsim-triton-backend Oct 23, 2026
@YWHyuk
YWHyuk deleted the item9/tests-and-triggers branch October 26, 2026 05:43
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