Repository navigation
Conversation
Collaborator
|
Closing as part of clearing this pre-hygiene queue; see #298 (comment) for the note on the updated review process. Thank you again. |
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.
What & why
Each
ExpertPool::preparescans the cached slots separately for every requested expert, constructing the same gate binding key again inside that loop. A fully cached request still pays this demand-by-slot cost on every layer and decode step.Build the requested gate-key index once and scan the published slots once. Keep the existing projection-consistency checks and protect every hit before choosing a replacement. The mappings remain in expert order, duplicate demand is still collapsed, and cache misses use the existing empty/LRU policy. Reserve the snapshot vector's known size as part of the same lookup path.
Area
edge0-infer/)How was it tested?
Base
bc2dc409d420097b4e864d511901180d7c2c6bac; Linux, GCC 14.2, CMake 4.4.5, CPU preset.prepare+await_readycalls. Median time per call: 285.1 microseconds before, 57.5 microseconds after (4.96x). This measures that cached CPU operation, not end-to-end model throughput; timing is environment-dependent.mul_mat_idcomparison with resident weights.ctest --preset cpu -L "L0|L1" --output-on-failure -j 4: 97 passed, 3 Vulkan tests skipped, 4 existing failures. The failures are the previously reproducedmoe_test_app_generationtemporary-file environment issue,moe_test_platform_memoryLinux expectation, and the extreme-float cases inmoe_test_ordered_json/moe_test_template_tools.moe_test_weights_compute,moe_test_weights_group_compute,moe_test_edge0_35b_slots, andmoe_test_edge0_35b_slots_failure. The tiny random-weight model was generated from the three source text files after their registered SHA-256 hashes passed. Its slot checks compare all cache/read modes and resident execution, with and without LoRA, across three prompts; tokens/logits remain bitwise equal. Failure checks verify writer draining, isolation and healthy reload.edge0-infer bench --model TINY/tiny-a --tokens tests/fixtures/answers/tiny-base-cpu-flash-split/chat-intro/tokens.json --device cpu --threads 2 --prefill-threads 2 --warmup 2 --ntok 8 --runs 2 --model-option routing=actual. Selected summary fields below are from the random-weight tiny fixture, not a 35B measurement or a before/after throughput comparison:{"type":"summary","runs":2,"input_count":17,"prefill_seconds":0.027988131,"decode_seconds":0.047301014,"decode_forwards":16,"decode_tokens_per_second":338.2591333031465,"cpu_threads":2,"cpu_prefill_threads":2}git diff --checkpassed. GPU/device execution and the real 35B model were not available.Checklist