Agent Skillsbenchflow-ai/skillsbench › fragmentation-aware-packing

fragmentation-aware-packing

GitHub

用于在多种可行放置方案中选择能保留有用剩余容量的方案,适用于装箱、GPU共享及多资源调度。通过计算边际碎片化评分,避免产生难以利用的零散容量,提升未来任务的匹配成功率。

tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing/SKILL.md benchflow-ai/skillsbench

Trigger Scenarios

存在多个可行放置方案且需考虑未来资源可用性 涉及GPU共享或加速器放置决策 需要优化多资源调度以减少碎片化

Install

npx skills add benchflow-ai/skillsbench --skill fragmentation-aware-packing -g -y
More Options

Non-standard path

npx skills add https://github.com/benchflow-ai/skillsbench/tree/main/tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing -g -y

Use without installing

npx skills use benchflow-ai/skillsbench@fragmentation-aware-packing

指定 Agent (Claude Code)

npx skills add benchflow-ai/skillsbench --skill fragmentation-aware-packing -a claude-code -g -y

安装 repo 全部 skill

npx skills add benchflow-ai/skillsbench --all -g -y

预览 repo 内 skill

npx skills add benchflow-ai/skillsbench --list

SKILL.md

Frontmatter
{
    "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.
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:

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:

weighted_marginal_score =
  fragmentation_weight * marginal_fragmentation
+ other_weight_1 * delta_other_component_1
+ other_weight_2 * delta_other_component_2
+ deterministic_tie_break

Version History

  • 9a1f4dd Current 2026-07-24 16:37

Same Skill Collection

.agents/skills/skill-creator/SKILL.md
.agents/skills/skillsbench/SKILL.md
.agents/skills/task-creator/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/ebcdic-overpunch-decoding/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gl-posting-codes/SKILL.md
tasks-extra/cobol-gl-batch-reconcile/environment/skills/gnucobol-mainframe-batch/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/attention-variants-from-papers/SKILL.md
tasks-extra/diff-transformer_impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pdf/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/pubchem-database/SKILL.md
tasks-extra/find-topk-similiar-chemicals/environment/skills/rdkit/SKILL.md
tasks-extra/gh-repo-analytics/environment/skills/gh-cli/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/multi-resource-allocation-validation/SKILL.md
tasks-extra/gpu-cluster-online-scheduling/environment/skills/online-resource-scheduling/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/mhc-algorithm/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/modal-gpu/SKILL.md
tasks-extra/mhc-layer-impl/environment/skills/nanogpt-training/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/nda-clause-taxonomy/SKILL.md
tasks-extra/nda-playbook-review/environment/skills/xlsx-parsing/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-count-in-video/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-video-understanding/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/gpt-multimodal/SKILL.md
tasks-extra/pedestrian-traffic-counting/environment/skills/video-frame-extraction/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/audiobook/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/elevenlabs-tts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/gtts/SKILL.md
tasks-extra/pg-essay-to-audiobook/environment/skills/openai-tts/SKILL.md
tasks-extra/scheduling-email-assistant/environment/skills/gmail-skill/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/automatic-speech-recognition/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/multimodal-fusion/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/speaker-clustering/SKILL.md
tasks-extra/speaker-diarization-subtitles/environment/skills/voice-activity-detection/SKILL.md
tasks-extra/taxonomy-tree-merge/environment/skills/hierarchical-taxonomy-clustering/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/ffmpeg-video-editing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/filler-word-processing/SKILL.md
tasks-extra/video-filler-word-remover/environment/skills/whisper-transcription/SKILL.md
tasks-extra/video-tutorial-indexer/environment/skills/speech-to-text/SKILL.md
tasks/3d-scan-calc/environment/skills/mesh-analysis/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/ada-plan-view-accessibility/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/architectural-dxf-extraction/SKILL.md
tasks/ada-bathroom-plan-repair/environment/skills/geometric-layout-repair/SKILL.md
tasks/adaptive-cruise-control/environment/skills/csv-processing/SKILL.md
tasks/adaptive-cruise-control/environment/skills/pid-controller/SKILL.md
tasks/adaptive-cruise-control/environment/skills/simulation-metrics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/vehicle-dynamics/SKILL.md
tasks/adaptive-cruise-control/environment/skills/yaml-config/SKILL.md
tasks/azure-bgp-oscillation-route-leak/environment/skills/azure-bgp/SKILL.md
tasks/bike-rebalance/environment/skills/geospatial-routing-data/SKILL.md

Metadata

Files
0
Version
9a1f4dd
Hash
867f0d3f
Indexed
2026-07-24 16:37

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-07 21:45
浙ICP备14020137号-1 $방문자$