How awslabs/fmbench-orchestrator works
Main Components and Their Roles
• Orchestrator CLI/Initialization:
– Represented by the “main.py” entry point.
– Responsible for reading command-line parameters and loading the orchestrator configuration files (config files in the “configs” folder), custom datasets (in “byo_dataset”), and prompt templates (in “custom_prompt_templates”).
– This component then triggers the other modules.
• Configuration Management:
– Shows the logical layer that handles the various YAML configuration files, including instance types, benchmark parameters, and mappings (like ami mapping and infra config).
• Instance / Cloud Resource Manager:
– Illustrate the component that “launches and manages” EC2 (and indirectly SageMaker/Bedrock) instances. This module uses AWS APIs to instantiate and later terminate compute resources.
• Benchmark Execution Module:
– Represent the FMbench execution environment that deploys benchmarking experiments (possibly on the launched instances) using configurations (from FMbench config files). This module inherits logic from both the “main.py” and scripts in the “analytics” folder.
– Also indicate that this part supports multiple experiments per instance, including sequential runs (e.g., testing different configurations on the same instance).
• Upload / File Synchronization Layer:
– Show that for each experiment run, custom files (datasets from “byo_dataset”, prompt templates, custom config modifications) are uploaded from the orchestrator to the target instance. This is essential for experiments that require custom input.
• Results Collection and Analytics:
– Represent this as a module visualized in two parts: one that collects results from the cloud instances (via the instance’s “Results Collection” process) and another that conducts analysis (leveraging the “analytics” scripts and notebooks like sagemaker_metrics_plot.py, pricing.yml, etc.).
– Demonstrate that results are stored locally on the orchestrator EC2 instance and then processed to generate reports (including heatmaps and performance tables).
Relationships and Data Flow
• Once instances are active, the orchestrator instructs them to run the benchmark experiments (using FMbench configuration files passed along).
• Finally, the flow moves to instance termination once processing is complete.
Architectural Patterns and Design Principles
• Separation of Concerns: Use distinct sections to clearly show responsibilities for initialization/configuration, resource provisioning, experimental execution, and analytics.
• Parallel/Sequential Experiment Handling: Illustrate with grouped or iterative blocks that multiple FMbench config files can be deployed on the same instance.
Relevant Technologies, Frameworks, or Libraries
• Python as the primary language (main.py, utils.py, globals.py).
• YAML and JSON for configuration/data (configs, byo_dataset).
• AWS Infrastructure (EC2 instances, IAM roles, SageMaker endpoints, AWS AMI mapping).
• FMbench, which is the benchmarking tool that actually performs LLM evaluation.
• The plotting and analytics libraries which are invoked in analytics (e.g., notebooks and scripts for visualizing cost/performance and latency).