Skip to content

[Native][SGLang] Zero padded ReplaySSM forward outputs - #3718

Open
ZLkanyo009 wants to merge 2 commits into
mainfrom
lingzha/replayssm-pad-rows-followup
Open

ZLkanyo009 wants to merge 2 commits into
mainfrom
lingzha/replayssm-pad-rows-followup

Conversation

@ZLkanyo009

Copy link
Copy Markdown
Contributor

Motivation

ReplaySSM returns on slot < 0 before writing the output, so padded rows can retain uninitialized or stale values. Complete the separate follow-up promised in #3552, including its test environment leak and stale enablement docstring.

Technical Details

Write positive zero inside the GDN serial, GDN UT and KDA forward kernels before returning for a padded row. These branches precede checkpoint, record and cursor access. Live-row computation is unchanged.

Use pytest's monkeypatch fixture to restore the verify test's environment override, including on failure. Describe the actual enablement policy: off uses batched verify; unset follows speculative steps or the configured algorithm.

Test Plan

Run python3 -m pytest --noconftest tests/test_replayssm_pad_rows.py -q on a GPU. The added suite covers mixed/all-pad batches, uniform/ragged/empty sequences, partial V tiles, positive-zero outputs, output red zones, exact live-row agreement, all checkpoint/record/cursor comparisons, and graph replay with two changed query inputs.

Use the actual kernels and wrappers in Triton's CPU interpreter for FP32 semantics and mutation checks. Inject a failure after setting the test environment to check restoration. Check formatting, compilation and that the non-pad production AST is unchanged.

Test Result

  • At 9f2a5bcc769854c3257d1146ad1fd0f261afb9a1, 33/33 GPU cases passed, zero failures/skips: 30 BF16 eager cases and three changed-input graph cases on MI308X/gfx942, Torch 2.10.0/ROCm 7.2.4 and Triton 3.8.0. Pytest completed in 10.32 seconds; this is test runtime, not a performance result. The owned processes exited and GPU memory returned to its allocation baseline.
  • 30 FP32 CPU interpreter cases passed; all five deliberate mutations were rejected. The interpreter substitutes architecture helpers and dynamically resolves the existing tl.exp alias. These results were recorded at 7da7389e9; final 9f2a5bcc7 only moves the no-GPU collection skip before GPU-stack imports, with identical kernel and interpreted test-helper ASTs.
  • Four injected-failure environment-restoration cases passed. Black, focused Ruff, compilation and diff whitespace checks passed.

These are shared-kernel correctness checks. The full SGLang verification test, model accuracy, distributed execution and model performance were not run for this follow-up. #3552's earlier CI results retain their original head attribution.

Submission Checklist

cc @valarLip

@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every eligible PR before approval:

  • ✅ Pre Checkin: Black, Ruff, catalog schema validation, non-GPU unit tests

Heavy model tests:

  • ✅ Gate checks are published on every PR so required checks do not stay missing
  • ✅ Expensive jobs run only after the PR is approved, or when a matching ci:* label is present
  • ✅ Pre Checkin must pass before approved heavy jobs continue
  • ✅ Without a matching label, expensive jobs also require a relevant path
  • ✅ A matching ci:* label is an explicit request and can open the gate even when paths would otherwise skip it

Path scope:

  • Native ATOM, vLLM, and SGLang use ignore lists: docs/markdown and unrelated plugin or Mesh paths are skipped
  • ATOMesh uses an include list: Mesh code, ATOMesh scripts/workflows/catalogs, OpenAI entrypoints, and Slurm helpers
  • Relevant path alone does not start expensive jobs; approval still opens the automatic path-scoped gate
Label Tests
ci:full Run all heavy PR model tests: native ATOM, vLLM, SGLang, and ATOMesh
ci:atom Run native ATOM model accuracy tests
ci:vllm Run ATOM vLLM OOT model accuracy tests
ci:sglang Run ATOM SGLang model accuracy tests
ci:mesh Run ATOMesh accuracy/benchmark gates for Mesh-related changes

Without a matching ci:* label, heavy jobs are skipped when the path is not relevant or the PR is not approved.
Add labels via the sidebar or gh pr edit 3718 --add-label <label>

@valar-cop valar-cop 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.

some changes needed..

gpu run of test_sglang_gdn_replayssm_verify.py at head?

ci green.

This branch has not been deployed

No deployments
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