Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/inferrsi/benchmark/tasks/qwen21-denoise-npu/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def candidate_function(path):
raise CandidateContractError("Candidate must define callable compute")
try:
inspect.signature(function).bind(*(None,) * 6, config={})
except ValueError as exc:
raise CandidateContractError("Candidate compute signature cannot be inspected") from exc
except TypeError as exc:
raise CandidateContractError("compute does not accept the task arguments") from exc
return function
Expand Down
10 changes: 8 additions & 2 deletions tests/test_qwen21_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ def test_standalone_import_guard_blocks_engine_names():
assert guard.find_spec("torch_npu") is None


@pytest.mark.parametrize("source", ["def compute(:\n", "VALUE = 1\n",
"def compute(x):\n return x\n"])
@pytest.mark.parametrize("source", [
"def compute(:\n",
"VALUE = 1\n",
"def compute(x):\n return x\n",
"compute = iter\n",
"def compute(*args, **kwargs):\n pass\ncompute.__wrapped__ = compute\n",
])
def test_candidate_entry_contract_errors_consume_round_without_blocking(
tmp_path, monkeypatch, source,
):
Expand All @@ -98,6 +103,7 @@ def import_candidate(args, output, record):


@pytest.mark.parametrize("phase,explicit_check,expected", [
("candidate_import", False, "infrastructure_failure"),
("candidate_measurement", False, "infrastructure_failure"),
("candidate_correctness", True, "candidate_failure"),
("baseline_correctness", True, "infrastructure_failure"),
Expand Down
Loading