Skip to main content

fragmentation-aware-packing

Choose placements that preserve useful residual capacity. Use for bin packing, GPU sharing, accelerator placement, and multi-resource scheduling where stranded capacity hurts future fit.

설치로 이동

소스 정보

저장소
benchflow-ai/skillsbench
최근 소스 활동
2026년 5월 30일 04:55
감지된 SKILL.md 언어
영어
스타
1,816
포크
368

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
fragmentation-aware-packing
description
Choose placements that preserve useful residual capacity. Use for bin packing, GPU sharing, accelerator placement, and multi-resource scheduling where stranded capacity hurts future fit.
# Fragmentation-Aware Packing Use this skill when several feasible placements exist and the choice affects future capacity. ## Core Idea A placement is not good just because it fits. Good placements preserve useful residual capacity. With fractional GPUs, this often means packing small compatible jobs together while preserving whole or scarce GPU slots. The same idea applies to any slots, bins, or resources with discrete capacities. ## Marginal Fragmentation For each feasible placement, compute a local before/after estimate: 1. Measure current free capacity by resource type and slot. 2. Copy the target machine or bin state. 3. Compute `fragmentation_before`. 4. Apply the candidate placement. 5. Compute `fragmentation_after`. 6. Set `marginal_fragmentation = fragmentation_after - fragmentation_before`. ```text best = None for placement in feasible_placements: target_before = copy(target_state) fragmentation_before = estimate_fragmentation(target_before, workload_types) target_after = apply(placement, target_before) fragmentation_after = estimate_fragmentation(target_after, workload_types) marginal_fragmentation = fragmentation_after - fragmentation_before score = weighted_action_score( marginal_fragmentation=marginal_fragmentation, other_component_deltas=estimate_other_deltas(placement) ) best = lower_score(best, placement, score) choose best ``` Respect hard feasibility first. Use `marginal_fragmentation` as an input to the weighted action score, not as the only decision rule. ## Estimating Fragmentation When workload shape probabilities are available, such as `workload_types` from `cluster_config.json`, use them to estimate which free capacity is likely to be useful: ```text fragmentation = 0 for workload_type in workload_types_from_cluster_config: if workload_type.gpu_type is incompatible with target.gpu_type: continue can_fit = target.cpu_free >= workload_type.cpu_units and target.memory_free >= workload_type.memory_units and any(slot.free_gpu_units >= workload_type.gpu_units for slot in target.gpu_slots) compatible_free_gpu = sum(slot.free_gpu_units for slot in target.gpu_slots) if not can_fit: fragmentation += workload_type.probability * compatible_free_gpu else: small_fragments = sum( slot.free_gpu_units for slot in target.gpu_slots if 0 < slot.free_gpu_units < workload_type.gpu_units ) fragmentation += workload_type.probability * small_fragments ``` ## Intuitive Example If two 50-unit GPU jobs can share one 100-unit GPU slot, placing both on the same slot leaves another full slot free. Placing them on two separate slots creates two 50-unit leftovers, which may be harder for future 75- or 100-unit jobs to use. The same pattern appears outside GPUs: two small tasks may belong in one bin so another bin remains available for a large task. When scores are close, use stable tie-breaks such as urgency, priority, smaller harmless leftovers, and deterministic target order. ## Weighted Objective Context Fragmentation is one objective component. A placement with slightly worse fragmentation may still be better if it substantially improves another weighted component, such as waiting, lateness, resource activation, or unserved-work cost. Conversely, a placement with excellent fragmentation may be bad if it causes a large cost elsewhere. Use the before/after fragmentation estimate as one delta in a general score: ```text weighted_marginal_score = fragmentation_weight * marginal_fragmentation + other_weight_1 * delta_other_component_1 + other_weight_2 * delta_other_component_2 + deterministic_tie_break ```
GitHub에서 보기