Skip to content

fix(offloading): device-only strategy should not incur a network cost#57

Merged
lbedogni merged 1 commit into
mainfrom
fix/sciot-048-offloading-device-only-network-cost
Jul 13, 2026
Merged

fix(offloading): device-only strategy should not incur a network cost#57
lbedogni merged 1 commit into
mainfrom
fix/sciot-048-offloading-device-only-network-cost

Conversation

@ff225

@ff225 ff225 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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 against edge_only/split strategies. Now network_cost is 0 for the device-only candidate, consistent with edge_only.
  • Moves import itertools out of the hot-path mixed_computation_evaluation() method to module top-level.

Closes #48

Test plan

  • Added test_device_only_evaluation_has_no_network_cost in tests/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 test suite (/fast-tests) — 177 passed, 1 skipped

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
@lbedogni lbedogni merged commit 4d063b4 into main Jul 13, 2026
3 checks passed
@lbedogni lbedogni deleted the fix/sciot-048-offloading-device-only-network-cost branch July 13, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

offloading_algo.py: fix device_only network cost + move itertools import

2 participants