You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cached decoding example discarded receiver-side routing outputs from ElasticBuffer.dispatch. It returned cached_handle.topk_idx, which stores sender-side global expert selections, and always returned None for weights.
Changes
Forward current topk_weights during cached dispatch.
Return actual recv_topk_idx and recv_topk_weights outputs.
Repro
Executed exact README code block against a contract-faithful fake buffer that returns distinct sender and receiver metadata.
Before this change:
AssertionError: returned source top-k indices instead of received top-k indices; did not forward and return top-k weights
After this change:
README cached decode example preserves dispatch outputs
This distinction matters in multi-rank use because sender token count and global expert IDs can differ from receiver token count and receiver-local expert IDs.
Thanks for catching this. Agreed, the topk_weights docstring is contradictory. I will keep this PR focused on the README fix and address the docstring in a follow-up.
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
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.
Summary
Cached decoding example discarded receiver-side routing outputs from
ElasticBuffer.dispatch. It returnedcached_handle.topk_idx, which stores sender-side global expert selections, and always returnedNonefor weights.Changes
topk_weightsduring cached dispatch.recv_topk_idxandrecv_topk_weightsoutputs.Repro
Executed exact README code block against a contract-faithful fake buffer that returns distinct sender and receiver metadata.
Before this change:
After this change:
This distinction matters in multi-rank use because sender token count and global expert IDs can differ from receiver token count and receiver-local expert IDs.
Testing
uv run --isolated --with yapf==0.40.2 --with ruff==0.6.5 --with clang-format==15.0.7 -- bash ./format.shcached_recv_topk_idxwith receiver output and exercises cached weight forwarding.GPU suite not run. Change only corrects README example; no runtime code changed.
Did this cause any problems?
Docs-only change. Revert this commit to restore previous example.