From 70cb9cf1c2f5e89ef4bb68f867a3130867fd130c Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Mon, 9 Mar 2026 09:26:29 -0700 Subject: [PATCH] Separate profiler output for image token generation PiperOrigin-RevId: 880895239 --- gemma/gemma.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gemma/gemma.cc b/gemma/gemma.cc index af2c447..72bad8f 100644 --- a/gemma/gemma.cc +++ b/gemma/gemma.cc @@ -740,6 +740,10 @@ void GenerateImageTokensT(const ModelConfig& config, // Weights are for the full PaliGemma model, not just the ViT part. PrefillVit(config, weights, prefill_runtime_config, image, image_tokens, prefill_activations, env); + + // No-op if the profiler is disabled. Printing now ensures that the + // `PrintResults` after prefill does not include the image token part. + env.ctx.profiler.PrintResults(); } // NOLINTNEXTLINE(google-readability-namespace-comments)