Skip to content

doc(runtime): describe when tesseract-jax hits the VJP cache - #941

Merged
jpbrodrick89 merged 2 commits into
pasteurlabs:mainfrom
singhharsh1708:docs/vjp-cache-mechanism
Nov 17, 2026
Merged

jpbrodrick89 merged 2 commits into
pasteurlabs:mainfrom
singhharsh1708:docs/vjp-cache-mechanism

Conversation

@singhharsh1708

@singhharsh1708 singhharsh1708 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The set_jax_vjp_cache_size docstring said tesseract-jax goes through custom_vjp and fwd, and that the cache hits under jax.jacrev. tesseract-jax binds its own primitive: under jax.grad and jax.value_and_grad it calls apply and then vector_jacobian_product on the same inputs, which is why the cache hits. The docstring now names the case where the cache does not help: under jax.jit, JAX drops apply when nothing the jitted function returns depends on its outputs (e.g. jax.grad of a loss linear in them). The comment in jax_vjp that repeated the jacrev claim is corrected too.

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.30%. Comparing base (dd0dd19) to head (61d7f4e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #941      +/-   ##
==========================================
+ Coverage   87.29%   87.30%   +0.01%     
==========================================
  Files          57       57              
  Lines        7855     7855              
  Branches     1213     1213              
==========================================
+ Hits         6857     6858       +1     
+ Misses        715      714       -1     
  Partials      283      283              

☔ View full report in Codecov by Harness.
📢 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.

@PasteurBot

PasteurBot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Benchmarks use a no-op Tesseract to measure pure framework overhead.

🚀 0 faster, ⚠️ 0 slower, ✅ 18 unchanged

✅ No significant performance changes detected.

Full results
Benchmark Baseline Current Change Spread Status
api/apply_0 0.629ms 0.624ms -0.7% 4.6% ✅
api/apply_1,000,000 0.636ms 0.628ms -1.2% 4.4% ✅
http/apply_0 3.308ms 3.357ms +1.5% 4.6% ✅
http/apply_1,000,000 110.056ms 112.079ms +1.8% 3.0% ✅
http-shmem/apply_0 4.407ms 4.497ms +2.0% 3.1% ✅
http-shmem/apply_1,000,000 10.252ms 10.993ms +7.2% 7.2% ✅
roundtrip/base64_0 0.090ms 0.088ms -2.2% 4.6% ✅
roundtrip/base64_1,000,000 9.473ms 9.195ms -2.9% 7.5% ✅
roundtrip/base64+lz4_0 0.095ms 0.094ms -1.0% 3.7% ✅
roundtrip/base64+lz4_1,000,000 38.994ms 38.590ms -1.0% 1.4% ✅
roundtrip/binref_0 0.520ms 0.522ms +0.4% 4.4% ✅
roundtrip/binref_1,000,000 2.663ms 2.722ms +2.2% 7.1% ✅
roundtrip/json_0 0.081ms 0.079ms -2.0% 3.4% ✅
roundtrip/json_1,000,000 243.745ms 244.582ms +0.3% 1.3% ✅
subprocess/apply_0 1.971ms 2.160ms +9.6% 10.2% ✅
subprocess/apply_1,000,000 93.303ms 93.466ms +0.2% 1.7% ✅
subprocess-shmem/apply_0 2.542ms 2.593ms +2.0% 7.1% ✅
subprocess-shmem/apply_1,000,000 7.865ms 8.006ms +1.8% 6.8% ✅

Ran 3 baseline and 3 current passes, alternating between the two. A benchmark is flagged only if every current pass differs from every baseline pass by more than 10% in the same direction. Times are the median over passes of each pass's median. Spread is the range of the per-pass medians on the noisier side, relative to its median.

@jpbrodrick89 jpbrodrick89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good improvements except for the small nit comment above, thanks @singhharsh1708 !

@singhharsh1708
singhharsh1708 force-pushed the docs/vjp-cache-mechanism branch from 23b17e1 to 0224ac8 Compare November 17, 2026 06:07
@jpbrodrick89
jpbrodrick89 added this pull request to the merge queue Nov 17, 2026
Merged via the queue into pasteurlabs:main with commit 458a24a Nov 17, 2026
26 checks passed
@pasteurlabs pasteurlabs locked and limited conversation to collaborators Nov 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants