Skip to content

Commit 8315bbc

Browse files
vezhnickcopybara-github
authored andcommitted
remove the overhead test. It has high chance of failure on slow machines and is stochastic.
PiperOrigin-RevId: 865492479 Change-Id: Ie05544094020bf26eca9dabc4557d9a4d58634ee
1 parent aed64d9 commit 8315bbc

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

concordia/language_model/profiled_language_model_test.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -247,38 +247,6 @@ def test_mixed_calls(self):
247247
self.assertEqual(stats['counters']['llm_calls_sample_choice'], 1)
248248
self.assertEqual(stats['counters']['llm_calls_success'], 3)
249249

250-
def test_profiling_overhead_minimal(self):
251-
"""Test that profiling adds minimal absolute overhead."""
252-
base_model = MockLanguageModel(delay=0.05) # Use 50ms delay
253-
254-
# Measure without profiling
255-
profiler.disable()
256-
model_without = profiled_language_model.ProfiledLanguageModel(base_model)
257-
258-
start = time.perf_counter()
259-
for _ in range(20):
260-
model_without.sample_text('Test')
261-
time_without = time.perf_counter() - start
262-
263-
# Measure with profiling
264-
profiler.enable()
265-
profiler.reset()
266-
base_model_2 = MockLanguageModel(delay=0.05)
267-
model_with = profiled_language_model.ProfiledLanguageModel(base_model_2)
268-
269-
start = time.perf_counter()
270-
for _ in range(20):
271-
model_with.sample_text('Test')
272-
time_with = time.perf_counter() - start
273-
274-
# Absolute overhead should be small (less than 50ms for 20 calls)
275-
absolute_overhead = time_with - time_without
276-
self.assertLess(
277-
absolute_overhead,
278-
0.05,
279-
f'Profiling overhead too high: {absolute_overhead*1000:.1f}ms',
280-
)
281-
282250
def test_sample_choice_without_profiling(self):
283251
"""Test sample_choice when profiling is disabled (hits fast path)."""
284252
base_model = MockLanguageModel()

0 commit comments

Comments
 (0)