Skip to content

Commit b357267

Browse files
author
Kaiming Cheng
committed
Fix: Use provided test_code if available, instead of always generating the test code with LLM
1 parent ec4e471 commit b357267

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

triton_kernel_agent/agent.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,12 @@ def generate_kernel(
441441
self.logger.info("Starting kernel generation")
442442
self.logger.info(f"Problem: {problem_description[:100]}...")
443443

444-
# Always generate test code using LLM (even if test is provided as reference)
445-
generated_test_code = self._generate_test(problem_description, test_code)
446-
self.logger.info(
447-
"Generated test code using LLM" + (" with reference" if test_code else "")
448-
)
449-
450-
# Use the generated test code in standardized format
451-
test_code = generated_test_code
444+
# Use provided test code if available, otherwise generate it
445+
if test_code:
446+
self.logger.info("Using provided test code")
447+
else:
448+
test_code = self._generate_test(problem_description, None)
449+
self.logger.info("Generated test code using LLM")
452450

453451
# Log inputs
454452
import time

0 commit comments

Comments
 (0)