Amazon Web Services (AWS) has introduced a new open-source toolkit designed to help organizations fine-tuning large language models (LLMs) comply with the European Union’s AI Act. The Fine-Tuning FLOPs Meter, integrated with Amazon SageMaker AI, provides automated tracking of computational resources used during the fine-tuning process, addressing a key requirement of the impending EU regulations.
According to details received by The Chenab Times, the EU AI Act, with enforcement slated to begin in August 2026, places new obligations on entities that modify pre-existing AI models. If the fine-tuning process involves substantial computational resources, organizations could be reclassified from model users to model providers, incurring responsibilities such as maintaining technical documentation and adhering to specific content policies. The European Commission’s guidelines use training compute, measured in floating-point operations (FLOPs), as an indicative criterion for determining when such reclassification might occur.
Navigating EU AI Act Compliance with FLOPs Tracking
The EU AI Act’s provisions for general-purpose AI (GPAI) models are designed to ensure transparency and safety. For organizations fine-tuning LLMs, understanding whether their modifications trigger new regulatory responsibilities is crucial. The European Commission’s guidelines, published in July 2025, outline indicative criteria, notably the amount of compute used in the modification process, often referred to as the “one-third rule.” This rule suggests that if the compute spent on fine-tuning exceeds one-third of the compute used for the original model’s training, the entity may be considered a GPAI model provider.
These guidelines establish specific FLOPs thresholds. If the pretraining compute of the base model is known and exceeds 10^23 FLOPs, the threshold is 30% of that pretraining compute. If the pretraining compute is unknown or below 10^23 FLOPs, a default threshold of 3.3 x 10^22 FLOPs is applied. For models with systemic risk and pretraining compute of 10^25 FLOPs or more, a threshold of 3.3 x 10^24 FLOPs is used if the base compute is unknown.
The challenge for many organizations lies in accurately calculating these FLOPs, especially since pretraining compute figures are rarely published. Manual tracking can be complex, involving different formulas for various fine-tuning methods like Low-Rank Adaptation (LoRA) or full fine-tuning. Furthermore, maintaining an audit trail for regulatory review adds significant operational overhead.
Amazon SageMaker’s Solution: The Fine-Tuning FLOPs Meter
The Fine-Tuning FLOPs Meter toolkit aims to automate this compliance tracking. Integrated into Amazon SageMaker AI training jobs, it operates as a Hugging Face TrainerCallback. With a simple configuration flag, it automatically measures FLOPs during the fine-tuning lifecycle, employing both architecture-based analytics and hardware-based GPU monitoring through NVIDIA Management Library (NVML).
The toolkit offers three stages of support. Initially, an optional pre-training estimation utility can help predict FLOPs across different training methods before a job commences. The core functionality is runtime tracking, which calculates FLOPs in real-time. Finally, a post-training audit trail automatically stores comprehensive compliance metrics in JSON format, which can be persisted to Amazon S3 or Amazon DynamoDB.
The toolkit employs enhanced formulas to accurately estimate FLOPs for various fine-tuning approaches, including full fine-tuning, LoRA, and Spectrum. For instance, the general formula for parameter-efficient methods is F_ft = (4 × N_total + 2 × N_trainable) × tokens_processed, where N_total represents the total number of parameters and N_trainable signifies the number of trainable parameters. For full fine-tuning, where N_total equals N_trainable, this simplifies to 6 × N × D, aligning with the Commission’s guidelines.
Technical Implementation and Walkthrough
Setting up the FLOPs Meter requires certain prerequisites, including appropriate AWS Identity and Access Management (IAM) roles and potentially a SageMaker Studio domain. The toolkit integrates seamlessly with SageMaker Training jobs by incorporating a single line, compute_flops: true, into the recipe configuration. When a training job is launched, a custom TrainerCallback initializes the FLOPsMeterCallback, which then captures model parameter counts, starts GPU monitoring, and counts non-padding tokens at each training step.
Upon completion of training, the callback computes both analytical and hardware FLOPs. It then determines the applicable threshold based on whether pretraining FLOPs were provided and generates a flops_meter.json file. This file contains critical information such as the calculated FLOPs, the threshold type used (e.g., default, 30% of pretraining), and a flag indicating whether the job exceeded the threshold. This output is automatically uploaded to Amazon S3 and stored in DynamoDB, establishing a persistent audit trail.
A walkthrough example using meta-llama/Llama-3.2-3B-Instruct demonstrates the process. Since exact pretraining FLOPs for this model are not publicly available, the toolkit defaults to the 3.3 x 10^22 FLOPs threshold. The generated flops_meter.json file allows users to review their compliance metrics, with Flops_architecture serving as the primary metric and Flops_hardware providing a conservative upper bound.
Addressing Threshold Exceedance and Production Scaling
If the exceeds_30pct flag in the flops_meter.json file is true, it indicates that the job’s compute exceeds the indicative threshold set by the Commission’s guidelines. The guidelines emphasize that this scenario necessitates a case-by-case assessment to determine if the organization becomes a GPAI model provider. Considerations may include obligations outlined in Article 53(1) of the AI Act for GPAI model providers, such as providing technical documentation and implementing a copyright policy. Organizations are advised to consult legal counsel specialized in EU AI regulation.
The toolkit is designed to scale to production workloads. For example, fine-tuning Llama-3.2-3B on a large dataset using LoRA generally results in FLOPs well below the default threshold. However, full fine-tuning on similar datasets can bring compute closer to the threshold, highlighting the importance of accurate tracking.
The Fine-Tuning FLOPs Meter is available as part of the Amazon SageMaker Generative AI recipes repository on GitHub. Users are provided with instructions to clone the repository, enable FLOPs tracking in their configuration files, and launch training jobs on Amazon SageMaker AI. Clean-up instructions are also provided to help users avoid ongoing charges by deleting created resources.

The Chenab Times News Desk

