Repository navigation
fix: prepare sparse post-processing for lazy parallel embedding - #750
jipeng6036-del wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughOnnxTextModel now calls a post-processing preparation hook before parallel document processing. BM42 and MiniCOIL add model-specific preparation that loads tokenizer-related state under the conditions described in their implementations. A parameterized regression test checks that lazy models remain unloaded during parallel embedding and that their embedding counts, indices, and values match serial results. Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The changed path prepares sparse post-processing state before parallel work, and the regression test checks lazy loading and serial-parallel output parity. No actionable merge-blocking risk is established. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The new preparation phase fixes the successful lazy-parallel path, but an interrupted MiniCOIL preparation can leave an instance unable to recover on retry. No new security boundary bypass was identified. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Hey @jipeng6036-del Thanks, but no need to fix it, I have added a fix to #640 |
All Submissions:
Summary
With
lazy_load=Trueand parallel sparse embedding, workers return raw ONNX output but the parent post-processes it without loading model-specific assets. BM42 then has no tokenizer or inverted vocabulary, and miniCOIL has no vocabulary resolver or encoder.Prepare only those post-processing assets in the parent before consuming worker output. The parent still does not create an ONNX session. Both models reuse the same preparation after ordinary model loading.
Fixes #749.
Validation
uv run --no-project --with-editable . --with pytest --with ruff pytest -q tests/test_sparse_embeddings.py -k 'parallel_processing or lazy_parallel_sparse_post_processing'— 4 passed on Windows/Python 3.13, including real BM42 and miniCOIL model runs.uv run --no-project --with-editable . --with 'ruff==0.3.4' ruff check fastembed/sparse/bm42.py fastembed/sparse/minicoil.py fastembed/text/onnx_text_model.py tests/test_sparse_embeddings.py— passed (repository pre-commit Ruff version).git diff --check— passed.The full test suite was not run locally.
AI assistance
Codex prepared the change and ran the checks above. The PR author is responsible for the contribution and review replies.