Skip to content

Solution: Advanced Overlap Optimization with Adaptive Penalty#38

Open
willpartcl wants to merge 3 commits intomainfrom
solution/placement-optimization
Open

Solution: Advanced Overlap Optimization with Adaptive Penalty#38
willpartcl wants to merge 3 commits intomainfrom
solution/placement-optimization

Conversation

@willpartcl
Copy link
Contributor

Summary

Implemented the overlap_repulsion_loss() function with advanced optimization techniques to minimize cell overlaps in VLSI placement.

Key Features

  • Vectorized overlap detection: Efficient pairwise overlap calculation using PyTorch broadcasting
  • log(1+x²) penalty: Numerically stable penalty function with strong gradients
  • Adaptive lambda scaling: Overlap penalty increases from 1x to 5x during training to escape local minima
  • Cosine annealing LR: Learning rate scheduler for better convergence
  • Early stopping: Terminates when all overlaps are eliminated

Results (Tests 1-9)

Metric Value
Average Overlap 0.0135 (1.35%)
Average Wirelength 0.5424
Tests Passed 5/9 (0.0000 overlap)
Runtime 520s (~9 minutes)

Test Details

  • ✓ Test 1: 22 cells - 0.0000 overlap
  • ✓ Test 2: 28 cells - 0.0000 overlap
  • ✓ Test 3: 32 cells - 0.0000 overlap
  • ✓ Test 4: 53 cells - 0.0000 overlap
  • ✗ Test 5: 79 cells - 0.0380 overlap (3/79 cells)
  • ✗ Test 6: 105 cells - 0.0381 overlap (4/105 cells)
  • ✗ Test 7: 155 cells - 0.0258 overlap (4/155 cells)
  • ✓ Test 8: 157 cells - 0.0000 overlap
  • ✗ Test 9: 208 cells - 0.0192 overlap (4/208 cells)

Known Limitations

Tests 10-12 (2k-100k cells) are computationally infeasible with the current O(N²) pairwise approach. These require spatial data structures (quadtrees, R-trees) for practical performance.

Next Steps

Working on spatial acceleration structures to handle large-scale designs efficiently.

🤖 Generated with Claude Code

willpartcl and others added 3 commits January 26, 2026 19:05
Implementation details:
- Vectorized overlap detection using ReLU-based pairwise calculation
- log(1+x^2) penalty function for numerical stability and strong gradients
- Adaptive lambda scaling (1x to 5x over training) to escape local minima
- Cosine annealing learning rate scheduler
- Early stopping when all overlaps eliminated
- Increased to 5000 epochs with lr=0.1 for better convergence

Results on tests 1-9:
- Average Overlap: 0.0135 (1.35%)
- Average Wirelength: 0.5424
- 5/9 tests passed (0.0000 overlap)
- Runtime: 520s (~9 minutes)

Note: Tests 10-12 (2k-100k cells) require spatial data structures
for O(N^2) to scale. Current pairwise approach is computationally
infeasible for designs >1000 cells.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Small designs (<50 cells): 5000 epochs
- Medium designs (50-150 cells): 3000 epochs
- Large designs (150-500 cells): 2000 epochs
- Very large (500-2000 cells): 1000 epochs
- Huge (>2000 cells): 500 epochs

This makes runtime more reasonable for large designs, though
O(N²) pairwise approach still struggles with 1000+ cells.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Tests 1-9 results:
- Average Overlap: 0.0135 (1.35%)
- Average Wirelength: 0.5424
- Runtime: 520s
- 5/9 tests with 0.0000 overlap

Tests 10-12 (2k-100k cells) not included due to O(N²)
computational complexity. Requires spatial data structures
for production-scale optimization.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant