Fragmentation Aware Packing logo

Fragmentation Aware Packing

OrganizationPopular
benchflow-ai
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.

Overview

Publisherbenchflow-ai
Repositoryskillsbench
Skill namefragmentation-aware-packing
Stars
1.8K
Forks
367
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by benchflow-ai on GitHub. Read the source before you install it.

Installation

Install the Fragmentation Aware Packing AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git /tmp/skillsbench
mkdir -p .claude/skills
cp -r /tmp/skillsbench/tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing .claude/skills/fragmentation-aware-packing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fragmentation Aware Packing in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fragmentation Aware Packing on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fragmentation Aware Packing is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Frequently asked questions

What does the Fragmentation Aware Packing AI skill do?

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.

Why use Fragmentation Aware Packing on TypingMind?

Because you install it once and use it with any model. Fragmentation Aware Packing is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fragmentation Aware Packing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/benchflow-ai/skillsbench/tree/main/tasks-extra/gpu-cluster-online-scheduling/environment/skills/fragmentation-aware-packing. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Fragmentation Aware Packing?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fragmentation Aware Packing?

As many as you like. As long as a model supports skills, you can use Fragmentation Aware Packing with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fragmentation Aware Packing AI skill free?

Yes. It is published on GitHub by benchflow-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇