fix(offloading): device-only strategy should not incur a network cost#57
Merged
Merged
Conversation
device_only_evaluation() was charging layer_data_size / avg_speed for a fully-local inference, even though no intermediate data is transmitted in that case. This unfairly penalized the device-only strategy relative to edge_only (which correctly uses a zero network cost). Also hoists the itertools import in mixed_computation_evaluation() out of the hot-path method to module top-level. Closes #48
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.
Summary
device_only_evaluation()was adding a network cost (layer_data_size / avg_speed) even though a fully-local inference transmits no intermediate data. This distorted the comparison againstedge_only/splitstrategies. Nownetwork_costis0for the device-only candidate, consistent withedge_only.import itertoolsout of the hot-pathmixed_computation_evaluation()method to module top-level.Closes #48
Test plan
test_device_only_evaluation_has_no_network_costintests/test_offloading_algo/test_offloading_algo.py, verified it fails before the fix and passes after.uv run pytest tests/test_offloading_algo/ -q/fast-tests) — 177 passed, 1 skipped