OpenAI Enhances ChatGPT Performance with Automated System
The rapid evolution of agentic development has rendered traditional performance engineering methods inadequate. To address this challenge, OpenAI has created the Performance Factory, an autonomous system that leverages the capabilities of Codex to swiftly identify and rectify performance regressions.
The Performance Factory operates in the cloud, automating the investigation and resolution of performance issues, which helps OpenAI maintain alignment with its ambitious roadmap.
Within the Performance Factory, engineers establish workflows for recurring tasks and provide instructions for Codex agents to execute. A key component is the Regression Workflow, which activates when a performance alert is triggered. An agent investigates the slowdown, documents its findings, and proposes a fix for an engineer’s review. After deployment, another agent verifies whether performance has returned to normal. This workflow has automated the entire regression-fixing process, tracking over 1,700 investigations and identifying more than 600 root causes in just over three months, averaging 17 automated investigations daily.
The Transition to Automation
OpenAI’s journey from manual investigations to automated workflows illustrates a significant evolution in their performance engineering approach. The process can be summarized in several stages:
- Pre-Codex: Engineers manually analyzed metrics, logs, and code to investigate slowdowns, which was time-consuming and required extensive knowledge of the system.
- Codex as a Partner: With Codex, engineers could query performance issues and collaborate with the AI to investigate, making the process more accessible.
- Reusable Skills: OpenAI developed a shared skill called `perf-forensics`, allowing Codex to autonomously investigate slowdowns by identifying when issues began and which requests were affected.
- The Human Proxy: Engineers acted as intermediaries, pasting alerts into Codex for investigation and returning findings to their communication channels.
- Automated Investigations: Alerts initiated automatic Codex sessions, but engineers still needed to develop fixes and verify their effectiveness.
- The Factory: The Performance Factory was established to manage end-to-end performance workflows, tracking tasks and assigning agents as needed.
Components of the Performance Factory
The Performance Factory consists of four main components:
- Task Service: Engineers define workflows through configuration files and prompts for agents, detailing task states and transitions.
- Dispatch Loop: This component periodically checks which tasks are ready for the next step and assigns agents accordingly.
- Codex in the Cloud: An internal API allows agents to execute tasks in a cloud environment, accessing necessary tools and resources.
- Subscriptions: Tasks can subscribe to events, allowing agents to resume work automatically when conditions change.
The Regression Workflow
The first workflow implemented in the Performance Factory is the Regression Workflow, designed to manage performance regressions through stages such as investigation, root cause identification, fix proposal, and resolution.
When a performance alert is triggered, the Regression Workflow opens a task that agents progress through. The task records its status and findings, allowing for seamless transitions between agents and engineers. Engineers can monitor the workflow through Slack or the UI, providing context and reviewing proposed changes.
Root Cause Analysis and Fix Implementation
The initial step in the workflow involves identifying the root cause of the regression. The agent analyzes metrics, deployment history, and relevant code to determine when and where the issue occurred.
To enhance accuracy, an adversarial review process was introduced, where a separate Codex session challenges the proposed diagnosis. This review process has improved the accuracy of root cause identification significantly.
Once a diagnosis is confirmed, Codex proposes a fix, which is then reviewed by an engineer. Each task includes a report summarizing the regression, its impact, and the proposed solution, facilitating a smooth handoff.
After the fix is deployed, an agent verifies whether performance has returned to baseline levels. If performance improves, the task is marked as resolved; if not, the agent documents the outcome and reopens the investigation.
Lessons Learned
Building and operating the Performance Factory has provided valuable insights into developing agent workflows in production. Key lessons include the importance of protecting engineers’ attention by streamlining information and ensuring that agents can handle multiple regressions efficiently.
OpenAI continues to refine the Performance Factory, aiming to enhance the efficiency and accuracy of performance engineering workflows.
Source: OpenAI News