Skip to content

Aggregate: optimizer build, TRW-S, lazy costs, and split-dim seed - #519

Draft
AlbedoWang wants to merge 5 commits into
kaijian/moe_variancefrom
kaijian/final_optimize
Draft

Aggregate: optimizer build, TRW-S, lazy costs, and split-dim seed#519
AlbedoWang wants to merge 5 commits into
kaijian/moe_variancefrom
kaijian/final_optimize

Conversation

@AlbedoWang

@AlbedoWang AlbedoWang commented Jul 23, 2026

Copy link
Copy Markdown

Aggregate only. Do not review or merge this combined diff.

Review and merge the stack in order: #520 -> #521 -> #522 -> #523.

Review stack

  1. Speed up sharding optimizer construction #520: algorithm-preserving optimizer construction, compact cluster links, invalid-edge pruning and serialization.
  2. Add LP relaxation and eager TRW-S solvers #521: LP relaxation and eager full-cost TRW-S.
  3. Build TRW-S costs lazily without PuLP #522: lazy/no-PuLP cost construction for TRW-S.
  4. Add corrected split-dimension seed search #523: corrected split-dimension seed search and per-dimension PR514 local_map projection.

This Draft keeps the complete top-of-stack diff and profiling context in one place. Its head mirrors #523. The four stacked PRs are the merge targets.

Final-tree policy

The stack was rebuilt from this PR's final implementation rather than replaying PR484/PR511/PR513 wholesale. This preserves the selected main+PR511 propagation behavior and excludes abandoned PR484 annotation/DP/min-sum paths.

Compared with the previous aggregate head, implementation files are unchanged except for the direct-LP objective fix. Additional differences remove machine-local configuration and unrelated artifacts, update tests for node-level cluster links, and add a fast-build equivalence regression.

PR514 remains the source of truth for 3+D MoE local_map, flattened EP groups, efsdp boundary placements, and backward-gradient duality.

Validation

  • Changed-file pre-commit passes whitespace, AST, conflict, large-file, EOF, Black, flake8, isort and mypy.
  • Full repository suite: 528 passed, 1 xfailed, 4 xpassed.
  • Foundation related suites: 33 passed.
  • LP/eager-TRW-S suites: 7 passed.
  • Lazy/no-PuLP suites: 8 passed.
  • Split/local-map suites: 3 passed.

The five new failures from the previous aggregate CI are resolved: LP constraint feasibility, export JSON cluster links, both repeated-subgraph dtype constraints, and direct split-seed LP objective initialization.

Corrected MoE profiles

Profiles use fake tensors and a fake process group; they measure search latency and host RSS, not distributed execution. Each result is one deterministic run; variance is unavailable.

  • 2D (8,8) uses direct unseeded lazy TRW-S, not split-dim: 33.05s versus 37.02s full-cost TRW-S, with identical objective 45680.5744 and placement.
  • 3D (2,4,8) corrected split + lazy TRW-S: 111.15s, objective 44260.3021, +1.698% versus unrestricted full/lazy 43521.3868. The unrestricted solution lies inside radius 2; the delta is compute 0, communication +675.915, transition +63.
  • 4D (8,2,2,2) corrected split + lazy TRW-S: 201.41s, objective 47952.1351, peak RSS 3.44 GiB. Unrestricted eager and lazy searches exceeded 20 minutes, so no objective gap or speedup is claimed. No 4D sampling experiment was run.

Authored with Claude.

Inherited base checks

PR514 currently has the same unrelated repo-wide mypy failure in autoparallel/tools/overlap_simulator/run.py:404 and the same TorchTitan upstream config-registry failure. The stack does not include unrelated fixes for either path.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 23, 2026
@AlbedoWang
AlbedoWang force-pushed the kaijian/final_optimize branch 2 times, most recently from b5ebbeb to 6023876 Compare July 24, 2026 06:09
@AlbedoWang
AlbedoWang changed the base branch from main to kaijian/moe_variance July 24, 2026 06:09
@AlbedoWang
AlbedoWang force-pushed the kaijian/final_optimize branch from 6023876 to 3f897d0 Compare July 27, 2026 03:03
@AlbedoWang
AlbedoWang force-pushed the kaijian/final_optimize branch from 3f897d0 to 0d9ee3d Compare July 27, 2026 03:12
@AlbedoWang AlbedoWang changed the title Lazy approx build + align stack to cleanup (torch-2.14) Aggregate: optimizer build, TRW-S, lazy costs, and split-dim seed Jul 27, 2026
@AlbedoWang
AlbedoWang force-pushed the kaijian/final_optimize branch 2 times, most recently from e2b379f to bfbe4fb Compare July 28, 2026 02:33
Preserve ILP behavior while skipping duplicate redistribution work, compacting cluster links, and pruning invalid decision edges.

Authored with Claude.
Keep ILP as the default while supporting integral LP extraction and lower-bound certificates on the same optimizer problem.

Authored with Claude.
Build a pairwise factor graph from the existing optimizer costs and constraints, then solve it with TRW-S and constrained local-search polish.

Authored with Claude.
Skip PuLP and eager edge-cost materialization for the approximate solver, derive constraint topology directly, and compute memoized factor costs on demand.

Authored with Claude.
Solve each mesh dimension independently, preserve its fabric topology, and project local_map contracts onto the active dimension before restricting the final search.

Authored with Claude.
@AlbedoWang
AlbedoWang force-pushed the kaijian/final_optimize branch from bfbe4fb to b374f7f Compare July 28, 2026 03:23
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