Repository navigation
Write a join's partner label with the frame, one time per anchor - #182
Merged
shreyashankar merged 6 commits intoOct 3, 2026
Merged
Conversation
Every pair of one anchor has the same partner label directly after the frame, so the label is now part of the frame. Each pair writes only its partner document and the answer cue. The token sequence is the same, so the answers do not change. The joined-row classification, the join cost, and the speed of light estimate count the label the same way.
…nto claude/join-label-in-anchor-kv
shreyashankar
added this pull request to stack #183
October 3, 2026 00:11
…nto claude/join-label-in-anchor-kv
…nto claude/join-label-in-anchor-kv # Conflicts: # docs/content/docs/architecture/planning.mdx
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.
This PR is on top of fsdatalab/quail#178.
Problem
Each join request has this order of tokens:
The partner label is the same for every pair of one anchor. In quail-b it is the 6 tokens
"\n\nDOCUMENT {1}:\n". Quail kept the preamble, the anchor, and the frame in KV, but it wrote the label again for each pair. For example, on LEP-6 (Qwen3 4B fp8, sf 0.5), it wrote the label for each of 1,043,064 pairs: 6.26M tokens, which is 72% of the LEP-6 KV regret.Solution
JoinStage.runtime_spec()puts the first partner's label in the frame. Quail writes the frame one time for each anchor, so it now writes the label one time for each anchor. Each pair writes only its partner document and the answer cue.planner/joins.py), the classification cost of joined rows (planner/classify.py), and the speed of light estimate (planner/estimate.py) count the label one time for each anchor.execution.mdx,planning.mdx) describe the new frame.Impact
IMDB-13, IMDB-15, BIO-6, and LEP-6, Quail only, Qwen3 4B fp8, sf 0.5, one H100. Before:
f15c5ca(/results/benchmarks/quailb/20261002T061804Z-a6ccc1fe, scored with quail-b4298e7a). After:3807348(/results/benchmarks/quailb/20261002T235411Z-07638ba6).The four queries take 956.2 s, compared with 1,051.3 s before (9.0% less).
Prediction and result. Before the run, the prediction was:
Testing
ruff,check_long_strings.py,vulture, andpytestpass (211 passed, 4 skipped).test_a_join_writes_its_first_partner_label_with_the_framechecks that the frame holds the first label and that the tokens after the anchor do not change.test_classify.pyare lower (0.071 s to 0.063 s, 0.413 s to 0.410 s), and the fresh tokens of a joined-row classification intest_classify_stream.pydecrease from 19 to 16.🤖 Generated with Claude Code
https://claude.ai/code/session_01BGcUxUrkntTY43pDwWgfK5
Generated by Claude Code
Generated by Claude Code