Skip to content

Commit

Permalink
report validation failures in MLI pipeline through callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ankona committed Aug 2, 2024
1 parent d419465 commit 85a6ee0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion smartsim/_core/mli/infrastructure/control/workermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ def _on_iteration(self) -> None:
request.raw_inputs = tensor_bytes_list

if not self._validate_request(request):
return
exception_handler(
ValueError("Error validating the request"),
request.callback,
"Error validating the request.",
)

timings.append(time.perf_counter() - interm) # timing
interm = time.perf_counter() # timing
Expand Down
6 changes: 3 additions & 3 deletions smartsim/_core/mli/infrastructure/environmentloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class EnvironmentConfigLoader:

def __init__(
self,
featurestore_factory: t.Optional[t.Callable[[str], FeatureStore]] = None,
callback_factory: t.Optional[t.Callable[[bytes], CommChannelBase]] = None,
queue_factory: t.Optional[t.Callable[[str], CommChannelBase]] = None,
featurestore_factory: t.Callable[[str], FeatureStore],
callback_factory: t.Callable[[bytes], CommChannelBase],
queue_factory: t.Callable[[str], CommChannelBase],
) -> None:
"""Initialize the config loader instance with the factories necessary for
creating additional objects.
Expand Down

0 comments on commit 85a6ee0

Please sign in to comment.