Repository navigation
ADR-054: lean indexer processes and a polite background summarizer (B-062, B-013) - #89
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054]
OpenBLAS sizes its per-thread buffers when the library loads, so the faiss.omp_set_num_threads(1) call in core came too late (B-062). A new leaf module, blas_threads, defaults the variable to 1 with setdefault, and core and every entry module import it first. A subprocess test checks the variable's value at the moment numpy and faiss are first looked up, for each entry point. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054 src/MCPServer.py src/blas_threads.py src/core.py src/hybrid_retriever.py src/incremental_indexer.py src/model_host.py]
The worker's initializer now drops its CPU priority before it loads torch: os.nice(10) on POSIX, SetPriorityClass(BELOW_NORMAL) on Windows (B-013). The model host keeps normal priority because its one thread also embeds search queries. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054 src/summarizer.py]
Prints PrivateUsage on Windows or VmSize/VmRSS on Linux after each import step, per OPENBLAS_NUM_THREADS setting, and times flat FAISS search with --search, so B-062 can be re-measured with one command. Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054]
Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054]
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> [ADR-054]
Co-Authored-By: Claude <noreply@anthropic.com> [ADR-054]
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> [ADR-054]
…cess-footprint [ADR-054]
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.
Implements ADR-054 (backlog B-062, B-013).
What changes
OPENBLAS_NUM_THREADSdefaults to 1 in every process, before numpy or faiss load (B-062).src/blas_threads.py, sets it withsetdefault, so an explicit value still wins.core.py,MCPServer.py,incremental_indexer.py,hybrid_retriever.pyandmodel_host.py. Child processes inherit it.os.nice(10)on POSIX andBELOW_NORMAL_PRIORITY_CLASSon Windows, in the pool initializer and before torch loads. If that fails, the failure is logged and the worker runs at normal priority.transformersimports were investigated and not built (§4). On transformers 4.53.3,AutoTokenizerloads torch anyway.tools/footprint_probe.pymeasures memory per import and flat-search timing.Tests
monkeypatch.setattr(os, "nice", ..., raising=False), so they also run on Windows, which has noos.nice.tools/listJSON is identical to the base's.After merging: run
pip install -e .again, becausesrc/blas_threads.pyis a new module and the live servers importsrc/.Still open (left in the ADR)
tools/footprint_probe.py.🤖 Generated with Claude Code