davidcastagnetoa/skills

dynamic_batching

Agrupar peticiones de inferencia en batches cuando la cola supera un umbral

First seen Mar 6, 2026

Installation

$ npx skills add davidcastagnetoa/skills --skill dynamic_batching

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from davidcastagnetoa/skills · top by installs.

npx skills add davidcastagnetoa/skills

Browse all from davidcastagnetoa/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,557 B
  • docs SUMMARY.md 99 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

dynamic_batching

Agrupamiento dinámico de múltiples peticiones de inferencia en un solo batch GPU para maximizar throughput. Cuando llegan varias peticiones simultáneamente, se procesan juntas en vez de una por una.

When to use

Usar en el workerpoolagent cuando hay carga sostenida (>10 peticiones/segundo). En baja carga, procesar individualmente para mínima latencia.

Instructions

  1. Implementar colector de batch con timeout:

``python batch = [] while len(batch) < maxbatchsize: try: item = await queue.get(timeout=maxwaitms / 1000) batch.append(item) except asyncio.TimeoutError: break ``

  1. Configurar maxbatchsize=8 y maxwaitms=50.
  2. Concatenar inputs: batch_tensor = torch.stack([item.tensor for item in batch]).
  3. Ejecutar inferencia en batch: results = model(batch_tensor).
  4. Distribuir resultados: cada item recibe su resultado individual.
  5. Monitorizar batch_size promedio: si siempre es 1, el batching no aporta valor.
  6. Ajustar maxbatchsize según VRAM disponible.

Notes

  • Triton Inference Server implementa dynamic batching automáticamente; preferir Triton si está disponible.
  • El batch size máximo depende de la VRAM: ArcFace batch=8 consume ~2GB.
  • El maxwaitms añade latencia; balance entre throughput (batch grande) y latencia (batch pequeño).