From 41f060b5a09dcb9ab69a7d96314620b2c49388f3 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Mon, 27 Jul 2026 16:06:12 -0700 Subject: [PATCH 1/2] [executorch][llm] Make Gemma Apple test deterministic Pull Request resolved: https://github.com/pytorch/executorch/pull/21403 `MultimodalRunnerTest.testGemma` asserted on generated text while inheriting the default sampling temperature of 0.8. Set the temperature to zero for both generation calls so all four TestInfra configurations use deterministic greedy decoding. This commit was authored with Claude. ghstack-source-id: 407467872 @exported-using-ghexport Differential Revision: [D113786993](https://our.internmc.facebook.com/intern/diff/D113786993/) --- .../apple/ExecuTorchLLM/__tests__/MultimodalRunnerTest.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extension/llm/apple/ExecuTorchLLM/__tests__/MultimodalRunnerTest.swift b/extension/llm/apple/ExecuTorchLLM/__tests__/MultimodalRunnerTest.swift index 1d5af4998d3..d00004082f6 100644 --- a/extension/llm/apple/ExecuTorchLLM/__tests__/MultimodalRunnerTest.swift +++ b/extension/llm/apple/ExecuTorchLLM/__tests__/MultimodalRunnerTest.swift @@ -123,6 +123,7 @@ class MultimodalRunnerTest: XCTestCase { MultimodalInput(String(format: chatTemplate, userPrompt)), ], Config { $0.sequenceLength = sequenceLength + $0.temperature = 0 }) { token in text += token if token == "" { @@ -143,6 +144,7 @@ class MultimodalRunnerTest: XCTestCase { MultimodalInput(String(format: chatTemplate, userPrompt)), ], Config { $0.sequenceLength = sequenceLength + $0.temperature = 0 }) { token in text += token if token == "" { From bf97e26b4bcb225ce79ec681df2874fe1786d781 Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Mon, 27 Jul 2026 16:06:13 -0700 Subject: [PATCH 2/2] [executorch][devtools] Reset profiler state in ETDump tests Pull Request resolved: https://github.com/pytorch/executorch/pull/21410 Reinitialize the global profiler state before each `ETDumpGenTest` while initializing the runtime once per suite. This prevents profile blocks from leaking across XCTest cases, exhausting the fixed block pool, and causing assertion failures or process crashes. This fixes nine TestInfra signals. This commit was authored with Claude. ghstack-source-id: 407467887 @exported-using-ghexport Differential Revision: [D113810097](https://our.internmc.facebook.com/intern/diff/D113810097/) --- runtime/platform/profiler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/platform/profiler.cpp b/runtime/platform/profiler.cpp index 21f68963c78..e141a98d64b 100644 --- a/runtime/platform/profiler.cpp +++ b/runtime/platform/profiler.cpp @@ -182,6 +182,15 @@ void profiling_create_block(const char* name) { } void profiler_init(void) { + prof_header = (prof_header_t*)((uintptr_t)prof_buf + prof_header_offset); + prof_arr = (prof_event_t*)((uintptr_t)prof_buf + prof_events_offset); + mem_allocator_arr = + (prof_allocator_t*)((uintptr_t)prof_buf + prof_mem_alloc_info_offset); + mem_prof_arr = + (mem_prof_event_t*)((uintptr_t)prof_buf + prof_mem_alloc_events_offset); + num_blocks = 0; + prof_stats_dumped = false; + profile_state_tls = {-1, 0u}; profiling_create_block("default"); }