FPT-Agent: An LLM Agent for Mixed Precision Optimization with Numerical Feedback
Mixed precision tuning can reduce the execution time and memory footprint of scientific programs, but selecting an effective floating point format requires both numerical analysis and knowledge of the target hardware. In practice, numerical formats must be coordinated with data layout, precision conversions, and the available execution units. We present FPT-Agent, a large language model (LLM) agent framework for end-to-end automatic mixed precision tuning of C/C++ and CUDA programs. The framework combines LLVM program analysis, hardware capability detection, and numerical validation tools. An LLM planner uses this information and persistent agent memory to choose numerical diagnostics, request calibration inputs, and propose precision configurations. The planner uses compilation, accuracy, and performance results as feedback to update its decisions, with storage, computation, and accumulation formats modeled separately. When hardware optimization is enabled, the planner jointly explores precision assignments and compatible CPU SIMD, CUDA SIMT, and Tensor Core implementations. For each candidate, compiler transformations generate the corresponding programs for supported regions and data structures. A deterministic execution pipeline enforces compatibility and resource constraints, accepting a transformed program only after it satisfies the prescribed accuracy requirements and demonstrates a measured improvement in runtime or memory use over the original.
Authors
- Xiaofan Chen (ORCID: https://orcid.org/0000-0003-1628-9649)
- Erin Carson (ORCID: https://orcid.org/0000-0001-9469-7467)
- Xinye Chen
Publication Details
- Journal
- HAL
- Published
- 2026-12-01
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- preprint