Skip to content

Jiayu/gavelfgdexperiment - #10

Open
Turquoise-T wants to merge 5 commits into
mainfrom
jiayu/gavelfgdexperiment
Open

Jiayu/gavelfgdexperiment#10
Turquoise-T wants to merge 5 commits into
mainfrom
jiayu/gavelfgdexperiment

Conversation

@Turquoise-T

@Turquoise-T Turquoise-T commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Title: feat: FGD paper improvements with Gavel
integration

Description:

Summary

This PR implements FGD paper's scoring algorithm
improvements and integrates them with the Gavel
scheduler.

Key Features

  • Paper-based sigmoid scoring: score = int(100 /
    (1 + exp(delta))) for quantized tie-breaking
  • 85% popularity threshold: Filter to top task
    types covering 85% of workload (corrected from
    initial 60%)
  • Buddy-aware tie-breaking: Prefer allocations
    leaving power-of-2 free GPUs on nodes
  • Dynamic penalty weighting: Adjusts
    fragmentation penalty based on cluster
    utilization

Experiment Suites

  • phase_fgd_improved_v2: 180 experiments
    comparing strided vs fgd_vanilla vs fgd_improved
    on Cluster H (5592 GPUs)
    • 2 policies × 3 placements × 15 load levels ×
      2 seeds
    • Unified "fgd_improved" config combining
      paper+buddy+dynamic penalty
  • phase_gavelfgd_improved: 42 experiments for
    Gavel+FGD integration
  • phase_gavelfgd_all_improvements: 56 experiments
    with full feature comparison

Results

  • 4.7% JCT reduction at 310 jobs/hour with full
    improvements
  • 3.6% JCT reduction with paper scoring + buddy
    tie-breaking

Add fragmentation penalty to MaxMinFairness LP to discourage allocation
to GPU types with high fragmentation. This creates a feedback loop from
FGD placement to LP allocation decisions.

Changes:
- Add fgd_frag_penalty_weight parameter to Scheduler
- Track per-GPU-type fragmentation EMA in scheduler
- Add set_fragmentation_context() to MaxMinFairness policy
- Modify LP objective: max(min(throughput)) - lambda * frag_penalty

When fgd_frag_penalty_weight=0 (default), behavior is unchanged.
- Fix missing `from time import time` in set_queue.py (runtime NameError)
- Fix trailing comma bug in throughput_estimator.py (wrong data type)
- Remove 9 dead functions from utils.py and unused imports
- Remove orphaned lease.py (never imported)
- Remove dead Job.from_proto() method
- Consolidate _solve_with_fallback into policy.py base module
- Remove unused imports across fgd.py, alibaba_trace_parser.py,
  job_id_pair.py, run_evaluation.py, run_standalone.py
- Consolidate duplicate build_workload_from_distribution and
  _weighted_choice into alibaba_trace_parser.py
- Remove demo functions and __main__ block from fgd.py
- Remove dead get_round_fragmentation() from fgd_placement.py

Made-with: Cursor
Implements FGD paper's scoring improvements and adds experiment suites:

## FGD Improvements (src/fgd/fgd.py)
- **Paper scoring**: Sigmoid-based scoring `int(100/(1+exp(delta)))` with
  integer quantization for tie-breaking (use_paper_scoring)
- **60% popularity threshold**: Filter workload to top 60% most popular
  task types as per paper's GetTypicalPods (popularity_threshold)
- **Buddy-aware tie-breaking**: Prefer allocations leaving 2^n free GPUs
  on nodes for better future packing (use_buddy_tiebreak)
- **Per-cluster fragmentation**: Option to compute fragmentation delta
  across all nodes instead of single node (use_cluster_fragmentation)

## Gavel+FGD Integration (src/scheduler/)
- Added parameters to scheduler.py and fgd_placement.py to expose all
  FGD options through the Gavel scheduler interface
- Dynamic fragmentation penalty weight already integrated

## Experiments
- **fgd_improved**: 80 experiments comparing strided, fgd_vanilla,
  fgd_paper, fgd_buddy, fgd_cluster (8 loads x 5 methods x 2 seeds)
- **gavelfgd_improved**: 42 experiments comparing gavel, gavelfgd,
  gavelfgd_improved (7 loads x 3 configs x 2 seeds)
- **gavelfgd_all_improvements**: 56 experiments comparing gavel,
  gavelfgd_vanilla, gavelfgd_paper, gavelfgd_full with dynamic penalty
  (7 loads x 4 configs x 2 seeds)

## Results
- gavelfgd_full (with dynamic penalty): 4.7% JCT improvement at 310 jph
- gavelfgd_paper (paper+buddy): 3.6% improvement at 310 jph
- FGD placement over strided: 2-4% improvement at high loads
@Turquoise-T
Turquoise-T requested a review from clubzip March 7, 2026 21:45
- Update default threshold in fgd.py filter_by_popularity_threshold()
- Update comments in fgd_placement.py
- Update all experiment configs to use 85% threshold
- Add new fgd_improved_v2 experiment config with unified improvements
  (paper scoring + buddy tiebreak + dynamic penalty)
- Add submit_fgd_improved_v2.sbatch for running experiments

@clubzip clubzip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the meeting, the paper uses a 95% popularity threshold. Is there a reason you used 85% instead? I think there might have been some miscommunication.

Since I don’t want to block this PR, I’ll approve for now. It would be great if you could double-check this part before merging.

GavelFGD+ combines four improvements over base GavelFGD:
- Paper-accurate FGD sigmoid scoring
- 95% popularity threshold (raised from 85%)
- Buddy tiebreak for equal-score placement options
- Placement-Opportunity-Aware (POA) LP bonus (mu=0.10)

The POA bonus replaces the earlier LP fragmentation penalty.
The key insight: LP penalties on allocation cannot fix placement-caused
fragmentation. POA instead rewards allocation to GPU types where jobs
can currently be placed (measured by fit-fraction per demand size),
steering the LP toward types with open node capacity rather than away
from historically fragmented ones.

Results on Alibaba cluster (7 load levels, 2 seeds each):
- At 85% utilization: GavelFGD+ reduces frag rate by 76.7% over
  GavelFGD (2.01% -> 0.47%) and JCT by 2.1% (22275s -> 21810s)
- At moderate utilization (<72%): neutral (POA signal undifferentiated)
- Effect is load-dependent by design: POA vanishes when fit fractions
  are uniformly high (low load), activates when they diverge (high load)

New files:
- experiments/combined/configs/phase_gavelfgd_combined.json
- experiments/combined/slurm/submit_gavelfgd_combined.sbatch
- experiments/combined/plot_gavelfgd_combined.py
- experiments/combined/results/gavelfgd_combined/ (42 experiment results)
- experiments/combined/results/figures/gavelfgd_combined_*.png (3 figures)
- docs/paper-evaluation-section.md (rewritten for GavelFGD+)

Co-Authored-By: Claude Sonnet 4.6 <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.

2 participants