Skip to content

test(ricursive): cover Transformers 4 default-cache rollback - #3752

Merged
Qubitium merged 2 commits into
ModelCloud:mainfrom
Qubitium:fix/ripple-tf4-default-cache
Nov 10, 2026
Merged

Qubitium merged 2 commits into
ModelCloud:mainfrom
Qubitium:fix/ripple-tf4-default-cache

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to the Hugging Face review in ricursiveAI/Ripple-65B-Preview#11.

The native modeling fix keeps a plain, crop-compatible default DynamicCache on Transformers 4 and the configured hybrid cache on Transformers 5. It is in the same HF PR at commit 2f007aabfcedd0f8763d86d08f9aa0afbc344cea.

This PR syncs the regression coverage:

  • Pin RIPPLE_REVISION to the fixed native revision.
  • Assert the Transformers 4 default cache is full and can be cropped after passing the sliding window; keep the hybrid assertion on Transformers 5.
  • Add the reported prompt-lookup reproduction. It reuses the cache returned by a direct forward after the sliding-window limit and compares assisted decoding with plain greedy generation.
  • Document the version-aware default.

Verification with a tiny model (four sliding layers + one full layer, sliding_window=8):

  • Transformers 5.22.1: 27/27 in tests/test_ricursive_modeling_contracts.py.
  • Transformers 4.57.6: 27/27.

Transformers 4.57 builds hybrid sliding layers from
DynamicCache(config=...), but those layers cannot be cropped after passing
the window. Reusing a cache returned by a direct forward in assisted
decoding then raises "Cannot crop a DynamicSlidingWindowLayer".

The native fix keeps a plain full cache on Transformers 4. Pin the reviewed
revision to that commit, assert the 4.x default can be cropped, and add the
reported prompt-lookup reproduction as a regression. The test reuses the
cache from a direct forward; constructing an explicit full cache would hide
the defect.
@Qubitium
Qubitium marked this pull request as ready for review November 10, 2026 05:12
@Qubitium
Qubitium merged commit 1c50395 into ModelCloud:main Nov 10, 2026
1 check failed
ZX-ModelCloud added a commit that referenced this pull request Nov 10, 2026
main's ruff-check fails on this file at 1c50395 (introduced by #3752):
`C408 Unnecessary dict() call`. Rewrite the call kwargs as a plain literal
so the lint gate can pass. No behavioural change; the file's 27 tests pass.
Qubitium pushed a commit that referenced this pull request Nov 10, 2026
…3756)

* test(contracts): align fused-bias oracles and GLM-5.3 MTP ownership

Update stale test contracts that no longer match shipped behavior after
bias was fused into the FP32 epilogue and after the checkpoint-only MTP
block became visible in the module tree. Neither change is a kernel
regression.

ROCm/NVIDIA bias epilogue:
- The visible output is round(matmul + bias), not round(matmul) + bias,
  on the fused GEMV/GEMM paths and on the split addmm path. Update the
  ROCm GEMM/GEMV and Ada GEMM/GEMV oracles to add bias to the FP32
  partial sum and round once.
- Apply the same fused epilogue to the independent FP64 adjudication
  oracle, and keep FP32 arithmetic error separate from output rounding:
  a visible difference is accepted only when the FP32 and FP64 fused
  values straddle the rounding boundary.
- Assert the fused GEMV dispatch so a fallback cannot silently pass.

GLM-5.3 MTP ownership:
- The checkpoint-only layer 45 MTP block owns enorm, hnorm, eh_proj and
  shared_head.norm beyond the target-layer schema. Declare them as dense
  `:!` owners in Glm5NextQModel.module_tree and in the registry fixture.
- The resolved layer list is 46 (45 target + 1 MTP) with 41 owners.
  The test now derives the MTP count instead of hard-coding only target
  layers, and checks every declared dense owner resolves through
  ModulePlan.find() with an explicit exclusion tag.

AWQ GEMV gating:
- Device-family rejection used out_features=64, which AwqGEMVFastLinear
  rejects for shape reasons. Use a legal shape per kernel and assert the
  error is the device family, then add a separate test for the illegal
  width rejection on a supported device.

Reference pages with diagrams and measured numbers:
docs/rocm-rdna4.md and docs/glm-integrated-mtp.md.

* style(tests): rewrite kwargs dict as a literal

main's ruff-check fails on this file at 1c50395 (introduced by #3752):
`C408 Unnecessary dict() call`. Rewrite the call kwargs as a plain literal
so the lint gate can pass. No behavioural change; the file's 27 tests pass.
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