Multimodal Inference Capacity and GPU Cluster Provisioning Simulation Script
Generate an automated capacity forecasting and discrete-event GPU simulation script for multimodal diffusion workloads.
Use this template when planning infrastructure scale for text-to-image generation endpoints under fluctuating prompt concurrency. It produces a production-ready Python simulation and capacity planning script.
Role: Principal MLOps Data Scientist with 12+ years optimizing high-throughput distributed diffusion inference clusters.
Context
- Cluster Infrastructure: {{inference_cluster_config}}
- Historical Ingestion Metrics: {{historical_prompt_traffic_log}}
- Sampling Profiles: {{diffusion_step_parameters}}
- Target Thresholds: {{peak_sla_latency_target}}
- Forecasting Window: {{forecast_horizon_weeks}}
- Demand Trajectory: {{target_concurrency_growth_rate}}
Task
Develop an enterprise-grade Python predictive modeling and discrete-event simulation script that forecasts GPU node exhaustion, cold-start queuing bottlenecks, and dynamic autoscaling thresholds for text-to-image and multimodal generation endpoints over {{forecast_horizon_weeks}}.
Method
- Ingest {{historical_prompt_traffic_log}} to fit a non-homogeneous Poisson process capturing prompt arrival spikes and diurnal seasonality.
- Parameterize GPU memory allocation, KV-cache behavior, and step execution time across hardware nodes defined in {{inference_cluster_config}}.
- Model prompt complexity variances (aspect ratios, batch sizes, guidance scales) using the distribution in {{diffusion_step_parameters}}.
- Apply compound growth over {{forecast_horizon_weeks}} based on {{target_concurrency_growth_rate}}.
- Run a Monte Carlo discrete-event simulation tracking queue formation, GPU VRAM fragmentation, and TTFT (time-to-first-token/tile).
- Compute SLA violation likelihood against {{peak_sla_latency_target}} across P50, P95, and P99 intervals.
- Generate dynamic autoscaler rules providing optimal scale-out triggers that minimize under-provisioned dropouts and idle compute costs.
- Export summary capacity tables, confidence intervals, and JSON configuration payloads for orchestrator deployment.
Constraints
- Code MUST be written in executable, modular Python 3.11+ using standard scientific libraries (NumPy, SciPy, SimPy, Pandas).
- The script MUST output parameterized CLI arguments and include structured docstrings for all mathematical formulations.
- MUST NOT use stubbed mock algorithms or truncated placeholder functions.
- Hardcode fallback thresholds if empirical distributions fail convergence checks.
Output format
Executable Python script organized into:
- Configuration and Data Ingestion Classes
- Statistical Arrival and Workload Engine
- Discrete-Event Simulation Pipeline
- Capacity Reporting & SLA Violation Forecaster
- CLI Interface and Main Execution Block (150-250 lines total code structure)
Self-review
- Confirm that all formulas account for variable denoising step latencies in {{diffusion_step_parameters}}.
- Verify that the simulation monitors both GPU compute saturation and VRAM ceiling limits from {{inference_cluster_config}}.
- Check that P95/P99 latency calculations strictly reflect the constraints in {{peak_sla_latency_target}}.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.