Repository navigation
fix(compile): never compile TabICL graphs inside a request after warmup (#47) - #67
Merged
Merged
Conversation
…up (#47) Call shapes warmup didn't cover compiled 1-7 graphs inside the requests that hit them (5-25 s on an A100, ~4x on prod's A40s), holding the device so other models' calls waited; on prod a 5,000 x 500 TabICL fit compiled 3 graphs on every call. After warmup, calls no compiled graph fits now run eagerly (torch.compiler stance eager_on_recompile). A100: first 20,000 x 100 fit 12.5 -> 3.0 s; first 1,000-row regression predict 1.8 -> 0.14 s. TABCTX_COMPILE_AFTER_WARMUP=1 restores in-request compiling. prod_bench --log-calls saves every call's timings_ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67 +/- ##
==========================================
- Coverage 80.42% 80.21% -0.22%
==========================================
Files 45 45
Lines 3454 3483 +29
==========================================
+ Hits 2778 2794 +16
- Misses 676 689 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
A process-wide stance set at the end of one TabICL backend's warmup would leave the next device's warmup (an in-process engine over several GPUs, TABCTX_WORKER_PROCESSES=0) running eagerly, never compiling its graphs. serve/factory.finish_warmup now flips it after all of a process's shards are built (worker processes after their one shard), and only where the compiled blocks were installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in CI - The stance test now checks behaviour: after the flip, a cached graph still runs, a new shape and a call from another thread run eagerly with correct results, and no graph is compiled. - The settings and finish_warmup tests move to test_serve_factory, which runs without torch (test_tabicl_compile is skipped there). - Docs: the stance is process-wide (every torch.compile in the process); one overhead figure (~1.3x, A100). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Devbox, 2×A100, prod-like Ray Serve with a worker process per GPU ( Not one of the run's 606 calls compiled a graph (
Review follow-ups:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After warmup, call shapes that warmup didn't cover compiled 1–7 new graphs inside the request that hit them. The
timings_msbreakdowns from 0.14.0 identified these shapes:A compile costs 5–25 s on an A100 and about 4× that on prod's A40s. While it runs it holds the device, so other models' calls wait too. On prod, a 5,000 × 500 TabICL fit compiled 3 graphs on every call (25.8 s, then 25.7 s on the repeat).
Fix
After warmup, a call that no compiled graph fits runs eagerly instead of compiling one. This uses
torch.compiler.set_stance("eager_on_recompile"), which is process-wide and called once per worker at the end of warmup (tabicl_compile.stop_compiling_new_graphs).TABCTX_COMPILE_AFTER_WARMUP=1restores the old behaviour.Measured on the devbox (A100, serving config)
Eager costs about 30% on the families warmup misses, compared with a graph that was already compiled. The alternative is a compile stall several times larger, and per worker. I tried widening warmup to cover those families (20,000 × 4 tables, 1,100-row predicts); it didn't cover them, because the stride family depends on the column count too, so I reverted it.
Also:
prod_bench.py --log-callssaves every call with itstimings_ms.Tests: unit tests for the stance and the setting.
pytest tests/unit: 567 passed. A devbox mixed-load run with worker processes is in progress, and I'll add its numbers here.🤖 Generated with Claude Code