Skip to content

Fix: stop calling pypto's removed compile_for_test() - #880

Open
lyfne123 wants to merge 1 commit into
hw-native-sys:mainfrom
lyfne123:fix/pypto-lower-api
Open

Fix: stop calling pypto's removed compile_for_test()#880
lyfne123 wants to merge 1 commit into
hw-native-sys:mainfrom
lyfne123:fix/pypto-lower-api

Conversation

@lyfne123

Copy link
Copy Markdown
Contributor

Summary

  • pypto#2230 replaced the testing-only compile_for_test() surface with the public JITFunction.lower(), which runs the pass pipeline while staying codegen-free, cache-free, and artifact-free — exactly what these three compile-only paths already wanted. The old name is gone, so they now die with AttributeError: 'JITFunction' object has no attribute 'compile_for_test'.
  • Not deferrable: CI builds pypto from an unpinned shallow clone of main (.github/actions/setup-ci-job/action.yml), so every PR picks the removal up immediately, and decode_fwd's --smoke branch is what the sim (a2a3sim) / sim (a5sim) jobs run.
  • Repo-wide there are exactly three call sites plus one comment naming the old API; examples/, tests/ and golden/ never used it.

Verification

Compile-only on a2a3sim — decode_fwd --smoke emits 57 functions, rope_qkv_regen 3, decode_layer_a8w8 45.

Known follow-up, not fixed here

With the smoke path now reaching further than before, decode_layer_a8w8 -p a5sim surfaces a second, pre-existing fault:

ValueError: Backend type already set to Ascend950, cannot change to Ascend910B

main hits the compile_for_test AttributeError first and never gets that far, which is why sim (a5sim) has been masking it. Confirmed by running both revisions locally on a5sim:

revision a5sim result
main AttributeError: ... no attribute 'compile_for_test'
this PR ValueError: Backend type already set to Ascend950 ...

Unrelated to this change and left alone so the scope stays a one-line-per-file API rename. sim (a5sim) is expected to stay red until it is addressed separately.

pypto#2230 replaced the testing-only compile_for_test() surface with the
public JITFunction.lower(), which runs the pass pipeline while staying
codegen-free, cache-free, and artifact-free -- exactly what these three
compile-only paths already wanted. The old name is gone, so they now die
with:

    AttributeError: 'JITFunction' object has no attribute 'compile_for_test'

This is not deferrable. CI builds pypto from an unpinned shallow clone
of main (.github/actions/setup-ci-job/action.yml), so every PR picks the
removal up immediately, and decode_fwd's --smoke branch is what the sim
(a2a3sim) / sim (a5sim) jobs run.

Repo-wide there are exactly three call sites plus one comment that names
the old API; examples/, tests/ and golden/ never used it.

Verified compile-only on a2a3sim: decode_fwd --smoke emits 57 functions,
rope_qkv_regen 3, decode_layer_a8w8 45.

Note for whoever picks up sim (a5sim): with the smoke path reaching
further than before, decode_layer_a8w8 -p a5sim now surfaces a second,
pre-existing fault -- "Backend type already set to Ascend950, cannot
change to Ascend910B". main hits the compile_for_test AttributeError
first and never gets that far. It is unrelated to this change and is
left alone here.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b881294-ce50-477f-9cd4-40a530727f81

📥 Commits

Reviewing files that changed from the base of the PR and between d9b5fef and a296c30.

📒 Files selected for processing (3)
  • models/qwen3/14b/decode_fwd.py
  • models/qwen3/14b/decode_layer_a8w8.py
  • models/qwen3/14b/rope_qkv_regen.py

📝 Walkthrough

Walkthrough

The Qwen3 14B smoke, compile-only, and regeneration paths now call .lower(...) directly instead of compile_for_test(...). A related comment now identifies lowering as the pl.Scalar specialization stage.

Changes

Qwen3 direct lowering

Layer / File(s) Summary
Smoke and compile-only lowering
models/qwen3/14b/decode_fwd.py, models/qwen3/14b/decode_layer_a8w8.py
The smoke and compile-only paths now invoke .lower(...) directly.
Regeneration lowering
models/qwen3/14b/rope_qkv_regen.py
The regeneration script now lowers the JIT function directly, and the comment identifies lowering as the pl.Scalar specialization stage.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

Poem

A rabbit hops through lowering’s gate,
No compile helper makes it wait.
Smoke paths run, regen flows,
Scalars specialize as lowering goes.
Qwen3 builds with lighter toes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the API replacement, affected compile-only paths, verification results, and known follow-up.
Title check ✅ Passed The title clearly identifies the replacement of the removed compile_for_test() API.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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