Skip to content

Estimate flex_local_map alternative costs automatically - #525

Draft
AlbedoWang wants to merge 2 commits into
flex-local-mapfrom
flex-local-map-auto-cost
Draft

Estimate flex_local_map alternative costs automatically#525
AlbedoWang wants to merge 2 commits into
flex-local-mapfrom
flex-local-map-auto-cost

Conversation

@AlbedoWang

Copy link
Copy Markdown

Summary

This PR stacks on #518 and adds automatic analytical cost estimation for
flex_local_map alternatives that do not provide a cost_hint.

  • Trace each alternative body with its declared placement-local tensor shapes.
  • Export and normalize its joint graph through the same AutoParallel path.
  • Reuse the existing per-op FLOPs/roofline and unified collective latency models.
  • Add dynamic-shape support needed by the DeepSeek V3 MoE EP/no-EP alternatives.

An explicit finite, non-negative cost_hint continues to override automatic
estimation for that alternative. auto_cost=False preserves the zero-default
behavior from #518.

Stack

Validation

Executed in the repository's autop-ci-py312 conda environment:

PYTHONPATH=$PWD conda run -n autop-ci-py312 \
  python -m pytest -q tests/test_optimize_placement.py

PYTHONPATH=$PWD conda run -n autop-ci-py312 \
  python -m pytest -q tests/test_placement_options_utils.py

Results:

  • tests/test_optimize_placement.py: 49 passed
  • tests/test_placement_options_utils.py: 30 passed

These are analytical-model checks rather than hardware performance measurements.
No latency, throughput, memory, speedup, or measured model-accuracy claim is made.

Authored with Claude.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant