Skip to content

Conversation

@JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Dec 2, 2025


Context:
After bump jax to 0.7.0 and 0.7.1, some doctests are affected. We fix them here

Description of the Change:

  1. transform.py the expected output tracing info need to be adjusted as the hashable version
  2. condition.py contains some dynamic shape functionalities, which should be skipped for now, until the patch PR is merged.

Benefits:
Documentation Tests should be back to normal and almost always green now (except for the mysterious qmc.py which we have no clue yet)

Possible Drawbacks:
N/A

Related GitHub Issues:
[sc-105091]

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.43%. Comparing base (a436e93) to head (592a8b9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8724   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files         588      588           
  Lines       62640    62640           
=======================================
  Hits        62286    62286           
  Misses        354      354           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JerryChen97 JerryChen97 marked this pull request as draft December 2, 2025 17:17
@JerryChen97 JerryChen97 marked this pull request as ready for review December 2, 2025 17:28
@JerryChen97
Copy link
Contributor Author

JerryChen97 commented Dec 2, 2025

The biggest problem here is I cannot reproduce the fail locally by running the tested code (run sybil will reveal the same error but no helpful infi) @andrijapau so its hard to determine what happened and how to fix it

@JerryChen97

This comment was marked as outdated.

@JerryChen97
Copy link
Contributor Author

https://github.com/PennyLaneAI/pennylane/actions/runs/19910786447/job/57078698810?pr=8724

=================================== FAILURES ===================================
________________________ condition.py line=457 column=1 ________________________

Example at /home/runner/work/pennylane/pennylane/pennylane/ops/op_math/condition.py, line 457, column 1 did not evaluate as expected:
Exception raised:
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/doctest.py", line 1355, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest /home/runner/work/pennylane/pennylane/pennylane/ops/op_math/condition.py[0]>", line 1, in <module>
        jnp.allclose(ansatz_true, jnp.cos(1.4))
      File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/jax/_src/numpy/lax_numpy.py", line 3652, in allclose
        return reductions.all(isclose(a, b, rtol, atol, equal_nan))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError
    --------------------
    For simplicity, JAX has removed its internal frames from the traceback of the following exception. Set JAX_TRACEBACK_FILTERING=off to include these.

condition.py:457: SybilFailure
________________________ condition.py line=459 column=1 ________________________

Example at /home/runner/work/pennylane/pennylane/pennylane/ops/op_math/condition.py, line 459, column 1 did not evaluate as expected:
Exception raised:
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/doctest.py", line 1355, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest /home/runner/work/pennylane/pennylane/pennylane/ops/op_math/condition.py[0]>", line 1, in <module>
        jnp.allclose(ansatz_false, jnp.cos(1.6))
      File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/jax/_src/numpy/lax_numpy.py", line 3652, in allclose
        return reductions.all(isclose(a, b, rtol, atol, equal_nan))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError
    --------------------
    For simplicity, JAX has removed its internal frames from the traceback of the following exception. Set JAX_TRACEBACK_FILTERING=off to include these.

condition.py:459: SybilFailure

The problem is I couldn't even locally reproduce these; in a standalone script things work very well. Moving them into the same python code then there's no issue anymore. So I guess somehow Sybil + Jax0.7.x have some scope issues here?
@andrijapau @albi3ro

@JerryChen97 JerryChen97 requested a review from albi3ro December 3, 2025 23:03
@JerryChen97 JerryChen97 enabled auto-merge December 3, 2025 23:08
@JerryChen97 JerryChen97 self-assigned this Dec 3, 2025
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.

4 participants