Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"parse_framework_to_irs",
]
)
except ModuleNotFoundError:
except ModuleNotFoundError as exc:
# Allow importing this package for IR-only workflows (docs autogen, etc.)
pass
# Only suppress when nemo_evaluator itself is missing; re-raise if a
# transitive dependency (pydantic, structlog, …) is absent — that is a
# broken installation, not an IR-only workflow.
if exc.name is None or not exc.name.startswith("nemo_evaluator"):
raise
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from typing import Optional

import yaml
from nemo_evaluator.core.input import get_framework_evaluations

from nemo_evaluator_launcher.common.container_metadata.intermediate_repr import (
HarnessIntermediateRepresentation,
Expand Down Expand Up @@ -943,6 +942,8 @@ def parse_framework_to_irs(
temp_file_path = temp_file.name

try:
from nemo_evaluator.core.input import get_framework_evaluations

include_internal = (
importlib.util.find_spec("nemo_evaluator_internal") is not None
or importlib.util.find_spec("nemo_evaluator_launcher_internal")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,11 +1014,20 @@ def _create_slurm_sbatch_script(
aux_extra_env_names.extend(endpoint_vars)

s += "# evaluation client\n"
# When evaluation_gpu_visible is true, expose GPUs to the eval container.
# Required for benchmarks that compile/execute CUDA code (e.g. compute-eval).
eval_gpu_visible = cfg.execution.get("evaluation_gpu_visible", False)
extra_eval_env_names: list[str] = []
if eval_gpu_visible:
s += "export NVIDIA_VISIBLE_DEVICES=all\n"
extra_eval_env_names.append("NVIDIA_VISIBLE_DEVICES")
s += "srun --mpi pmix --overlap "
s += '--nodelist "${PRIMARY_NODE}" --nodes 1 --ntasks 1 '
s += "--container-image {} ".format(eval_image)
# Combine eval env vars with auxiliary endpoint env vars
all_eval_env_names = sorted(set(list(eval_env_vars.keys()) + aux_extra_env_names))
all_eval_env_names = sorted(
set(list(eval_env_vars.keys()) + aux_extra_env_names + extra_eval_env_names)
)
if all_eval_env_names:
s += "--container-env {} ".format(",".join(all_eval_env_names))
if not cfg.execution.get("mounts", {}).get("mount_home", True):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ def test_create_task_irs(self, mock_extract):
class TestParseFrameworkToIrs:
"""Test parsing framework.yml to IRs."""

@patch(
"nemo_evaluator_launcher.common.container_metadata.loading.get_framework_evaluations"
)
@patch("nemo_evaluator.core.input.get_framework_evaluations")
def test_parse_framework_to_irs_success(self, mock_get_evaluations):
"""Test successful parsing of framework.yml."""
framework_content = """
Expand All @@ -237,9 +235,7 @@ def test_parse_framework_to_irs_success(self, mock_get_evaluations):
assert harness_ir.name == "test-harness" # Original name preserved
assert len(task_irs) > 0

@patch(
"nemo_evaluator_launcher.common.container_metadata.loading.get_framework_evaluations"
)
@patch("nemo_evaluator.core.input.get_framework_evaluations")
def test_parse_framework_to_irs_preserves_case(self, mock_get_evaluations):
"""Test that framework name case is preserved."""
framework_content = """
Expand Down Expand Up @@ -274,9 +270,7 @@ def test_parse_framework_to_irs_preserves_name(self):
"""
# This should not raise an error - no validation in loading.py
# We'll mock get_framework_evaluations to avoid actual parsing
with patch(
"nemo_evaluator_launcher.common.container_metadata.loading.get_framework_evaluations"
) as mock_get:
with patch("nemo_evaluator.core.input.get_framework_evaluations") as mock_get:
mock_get.return_value = ("test-harness-123", {}, {})
harness_ir, task_irs = parse_framework_to_irs(
framework_content, "test:latest", None
Expand Down
Loading