|
29 | 29 | import gradio as gr |
30 | 30 | from dotenv import load_dotenv |
31 | 31 |
|
32 | | -try: |
33 | | - # Support both package and script execution contexts (match Fuser/fuser_ui.py pattern) |
34 | | - if __package__ is None or __package__ == "": |
35 | | - PACKAGE_ROOT = Path(__file__).resolve().parent |
36 | | - REPO_ROOT = PACKAGE_ROOT.parent |
37 | | - if str(REPO_ROOT) not in sys.path: |
38 | | - sys.path.insert(0, str(REPO_ROOT)) |
39 | | - from Fuser.pipeline import run_pipeline |
40 | | - from Fuser.auto_agent import AutoKernelRouter |
41 | | - from Fuser.code_extractor import extract_single_python_file |
42 | | - else: |
43 | | - from .pipeline import run_pipeline |
44 | | - from .auto_agent import AutoKernelRouter |
45 | | - from .code_extractor import extract_single_python_file |
46 | | -except Exception: |
47 | | - raise |
| 32 | +from Fuser.pipeline import run_pipeline |
| 33 | +from Fuser.auto_agent import AutoKernelRouter |
| 34 | +from Fuser.code_extractor import extract_single_python_file |
48 | 35 | from triton_kernel_agent.providers.models import ( |
49 | 36 | get_model_provider, |
50 | 37 | MODEL_NAME_TO_CONFIG, |
@@ -416,9 +403,21 @@ def run_pipeline_ui( |
416 | 403 | class PipelineUI: |
417 | 404 | def __init__(self) -> None: |
418 | 405 | load_dotenv() |
419 | | - self.problem_choices = _list_kernelbench_problems( |
420 | | - Path.cwd() / "external" / "KernelBench" / "KernelBench" |
421 | | - ) |
| 406 | + candidate_roots = [ |
| 407 | + Path.cwd() / "external" / "KernelBench" / "KernelBench", |
| 408 | + Path.cwd() / "KernelBench" / "KernelBench", |
| 409 | + Path.cwd().parent / "KernelBench" / "KernelBench", |
| 410 | + ] |
| 411 | + seen: set[str] = set() |
| 412 | + collected: list[tuple[str, str]] = [] |
| 413 | + for base in candidate_roots: |
| 414 | + print(base, file=sys.stderr) |
| 415 | + for label, abspath in _list_kernelbench_problems(base): |
| 416 | + if abspath not in seen: |
| 417 | + collected.append((label, abspath)) |
| 418 | + seen.add(abspath) |
| 419 | + self.problem_choices = collected |
| 420 | + |
422 | 421 | control_flow_path = ( |
423 | 422 | Path(__file__).resolve().parent.parent.parent |
424 | 423 | / "external" |
|
0 commit comments