nemo-evaluator-launcher 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nemo-evaluator-launcher might be problematic. Click here for more details.

@@ -20,8 +20,6 @@ from typing import Any, List, Optional
20
20
 
21
21
  from simple_parsing import field
22
22
 
23
- from nemo_evaluator_launcher.api.functional import export_results
24
-
25
23
 
26
24
  @dataclass
27
25
  class ExportCmd:
@@ -77,6 +75,9 @@ class ExportCmd:
77
75
 
78
76
  def execute(self) -> None:
79
77
  """Execute export."""
78
+ # Import heavy dependencies only when needed
79
+ from nemo_evaluator_launcher.api.functional import export_results
80
+
80
81
  config: dict[str, Any] = {
81
82
  "copy_logs": self.copy_logs,
82
83
  "only_required": self.only_required,
@@ -13,13 +13,10 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- import json
17
16
  from dataclasses import dataclass
18
17
 
19
18
  from simple_parsing import field
20
19
 
21
- from nemo_evaluator_launcher.api.functional import kill_job_or_invocation
22
-
23
20
 
24
21
  @dataclass
25
22
  class Cmd:
@@ -34,6 +31,11 @@ class Cmd:
34
31
 
35
32
  def execute(self) -> None:
36
33
  """Execute the kill command."""
34
+ # Import heavy dependencies only when needed
35
+ import json
36
+
37
+ from nemo_evaluator_launcher.api.functional import kill_job_or_invocation
38
+
37
39
  result = kill_job_or_invocation(self.id)
38
40
  # Output as JSON
39
41
  print(json.dumps(result, indent=2))
@@ -20,11 +20,6 @@ from typing import Optional
20
20
 
21
21
  from simple_parsing import field
22
22
 
23
- from nemo_evaluator_launcher.api.functional import (
24
- get_invocation_benchmarks,
25
- list_all_invocations_summary,
26
- )
27
-
28
23
 
29
24
  @dataclass
30
25
  class Cmd:
@@ -41,6 +36,12 @@ class Cmd:
41
36
  )
42
37
 
43
38
  def execute(self) -> None:
39
+ # Import heavy dependencies only when needed
40
+ from nemo_evaluator_launcher.api.functional import (
41
+ get_invocation_benchmarks,
42
+ list_all_invocations_summary,
43
+ )
44
+
44
45
  rows = list_all_invocations_summary()
45
46
 
46
47
  if self.executor:
@@ -13,14 +13,11 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- import json
17
16
  from collections import defaultdict
18
17
  from dataclasses import dataclass
19
18
 
20
19
  from simple_parsing import field
21
20
 
22
- from nemo_evaluator_launcher.api.functional import get_tasks_list
23
-
24
21
 
25
22
  @dataclass
26
23
  class Cmd:
@@ -33,6 +30,11 @@ class Cmd:
33
30
  )
34
31
 
35
32
  def execute(self) -> None:
33
+ # Import heavy dependencies only when needed
34
+ import json
35
+
36
+ from nemo_evaluator_launcher.api.functional import get_tasks_list
37
+
36
38
  # TODO(dfridman): modify `get_tasks_list` to return a list of dicts in the first place
37
39
  data = get_tasks_list()
38
40
  headers = ["task", "endpoint_type", "harness", "container"]
@@ -17,12 +17,8 @@ import pathlib
17
17
  import time
18
18
  from dataclasses import dataclass
19
19
 
20
- import yaml
21
- from omegaconf import OmegaConf
22
20
  from simple_parsing import field
23
21
 
24
- from nemo_evaluator_launcher.api.functional import RunConfig, run_eval
25
-
26
22
 
27
23
  @dataclass
28
24
  class Cmd:
@@ -65,6 +61,12 @@ class Cmd:
65
61
  )
66
62
 
67
63
  def execute(self) -> None:
64
+ # Import heavy dependencies only when needed
65
+ import yaml
66
+ from omegaconf import OmegaConf
67
+
68
+ from nemo_evaluator_launcher.api.functional import RunConfig, run_eval
69
+
68
70
  # Load configuration either from Hydra or from a run config file
69
71
  if self.run_config_file:
70
72
  # Validate that run config file is not used with other config options
@@ -13,13 +13,10 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- import json
17
16
  from dataclasses import dataclass
18
17
 
19
18
  from simple_parsing import field
20
19
 
21
- from nemo_evaluator_launcher.api.functional import get_status
22
-
23
20
 
24
21
  @dataclass
25
22
  class Cmd:
@@ -36,6 +33,11 @@ class Cmd:
36
33
  )
37
34
 
38
35
  def execute(self) -> None:
36
+ # Import heavy dependencies only when needed
37
+ import json
38
+
39
+ from nemo_evaluator_launcher.api.functional import get_status
40
+
39
41
  res = get_status(self.job_ids)
40
42
  if self.json:
41
43
  # Remove progress field from JSON output as it's a WIP feature
@@ -23,13 +23,6 @@ import subprocess
23
23
  import time
24
24
  from typing import Any, List, Union
25
25
 
26
- from leptonai.api.v1.types.affinity import LeptonResourceAffinity
27
- from leptonai.api.v1.types.common import LeptonVisibility, Metadata
28
- from leptonai.api.v1.types.deployment import EnvVar, LeptonContainer, Mount
29
- from leptonai.api.v1.types.job import LeptonJob, LeptonJobUserSpec
30
-
31
- # Import lepton dependencies
32
- from leptonai.api.v2.client import APIClient
33
26
  from omegaconf import DictConfig
34
27
 
35
28
  from nemo_evaluator_launcher.common.logging_utils import logger
@@ -92,6 +85,18 @@ def _create_lepton_job_api(
92
85
  ) -> tuple[bool, str]:
93
86
  """Create Lepton job using API client (preferred method)."""
94
87
  try:
88
+ # Import leptonai dependencies locally
89
+ from leptonai.api.v1.types.affinity import LeptonResourceAffinity
90
+ from leptonai.api.v1.types.common import LeptonVisibility, Metadata
91
+ from leptonai.api.v1.types.deployment import (
92
+ EnvValue,
93
+ EnvVar,
94
+ LeptonContainer,
95
+ Mount,
96
+ )
97
+ from leptonai.api.v1.types.job import LeptonJob, LeptonJobUserSpec
98
+ from leptonai.api.v2.client import APIClient
99
+
95
100
  client = APIClient()
96
101
 
97
102
  # Prepare environment variables (support both direct values and secret references)
@@ -99,12 +104,8 @@ def _create_lepton_job_api(
99
104
  if env_vars:
100
105
  for key, value in env_vars.items():
101
106
  # Handle both regular dicts and OmegaConf objects
102
- from omegaconf import DictConfig
103
-
104
107
  if isinstance(value, (dict, DictConfig)) and "value_from" in value:
105
108
  # Secret reference: {value_from: {secret_name_ref: "secret_name"}}
106
- from leptonai.api.v1.types.deployment import EnvValue
107
-
108
109
  # Convert OmegaConf to dict if needed
109
110
  value_dict = dict(value) if isinstance(value, DictConfig) else value
110
111
  env_var = EnvVar(
@@ -203,6 +204,9 @@ def get_lepton_job_status(job_name_or_id: str) -> dict[Any, Any] | None:
203
204
  def _get_lepton_job_status_api(job_name_or_id: str) -> dict[Any, Any] | None:
204
205
  """Get job status using API client (preferred method)."""
205
206
  try:
207
+ # Import leptonai dependencies locally
208
+ from leptonai.api.v2.client import APIClient
209
+
206
210
  client = APIClient()
207
211
 
208
212
  # Try to get job by ID first, then by name
@@ -16,7 +16,7 @@
16
16
  # Below is the _next_ version that will be published, not the currently published one.
17
17
  MAJOR = 0
18
18
  MINOR = 1
19
- PATCH = 1
19
+ PATCH = 3
20
20
  PRE_RELEASE = ""
21
21
 
22
22
  # Use the following formatting: (major, minor, patch, pre-release)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nemo-evaluator-launcher
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Launcher for the evaluations provided by NeMo Evaluator containers with different runtime backends
5
5
  Author: NVIDIA
6
6
  Author-email: nemo-toolkit@nvidia.com
@@ -1,18 +1,17 @@
1
1
  nemo_evaluator_launcher/__init__.py,sha256=2F703fttLaIyMHoVD54rptHMXt4AWnplHDrwWJ3e3PM,1930
2
- nemo_evaluator_launcher/package_info.py,sha256=ge5Px1iAlNRX0GGWoCf58FwsJrEYBkZc1DqeCTYgur4,1580
2
+ nemo_evaluator_launcher/package_info.py,sha256=lrWzqGTnj5Ku3da50z9mSP5wrcg8d802682b4nWVsh8,1580
3
3
  nemo_evaluator_launcher/api/__init__.py,sha256=U9q_MJK2vRsFaymanhyy0nD1SNAZQZC8oY45RXPX7ac,1024
4
4
  nemo_evaluator_launcher/api/functional.py,sha256=DbsM2nwSdUZFtP5Se4aACg4K8EHF0b2xsXX_VgItP8w,26711
5
5
  nemo_evaluator_launcher/api/types.py,sha256=RXr_QoKdhejj1T9-HybSjd4KTxJmSv0bE0uLUFtF7Zc,3269
6
6
  nemo_evaluator_launcher/api/utils.py,sha256=q5HArRj7PKgBfeH3bOX8q1U97yMyQQp72yRRA5JP9PE,818
7
7
  nemo_evaluator_launcher/cli/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
8
- nemo_evaluator_launcher/cli/export.py,sha256=lROUm4mTM67an0M9OrgoJB3txhebgyi6c9YjqCOJ5cU,5672
9
- nemo_evaluator_launcher/cli/info.py,sha256=HUWQiVTyxVWDDkvcT-leosus3aa8Nq0Xl77xSTLqPss,3958
10
- nemo_evaluator_launcher/cli/kill.py,sha256=AzqD5WachyI1mVIa1D1PgtR0yRo2VQcKSxATOE8OrPQ,1253
11
- nemo_evaluator_launcher/cli/ls_runs.py,sha256=Ttgj7QR1iUmWwB_QGZwcnu1Z9wMJ2BenZMjFhqD9jwM,3788
12
- nemo_evaluator_launcher/cli/ls_tasks.py,sha256=TMj78z4ree6uVuwTI2jEDMRuUc-A0tRq2RB-wfHBwds,5223
8
+ nemo_evaluator_launcher/cli/export.py,sha256=32DwyG6oM3MZQh0otY2T6BYZTp2aMPOzvUmyEFVKAp8,5733
9
+ nemo_evaluator_launcher/cli/kill.py,sha256=C-4PWmMu8mIITo92o5AHxtq_s-8Cckbp7wAlG0I_ylw,1323
10
+ nemo_evaluator_launcher/cli/ls_runs.py,sha256=5QGUofeKK6tNtQnUF5wJ5YBZ5TL7RRueKlPkvA1wclY,3873
11
+ nemo_evaluator_launcher/cli/ls_tasks.py,sha256=Pd2lBQOQBNHBWrjk4tZg0SQ9Ul9F2Ak-zOyh-G9x-DY,5293
13
12
  nemo_evaluator_launcher/cli/main.py,sha256=JgzHsfalEg1aK_v0h2EuzTIG14JgxLzfixmguW4Zkfg,4976
14
- nemo_evaluator_launcher/cli/run.py,sha256=X5UIdLy7mIpU-lQm6qBHqPX4IesIUriXg6uNYMz5HI8,5270
15
- nemo_evaluator_launcher/cli/status.py,sha256=AY8AKIKcBqKgkeRItnzB5Jh5jQS4GvtsVnieL4zASlQ,4138
13
+ nemo_evaluator_launcher/cli/run.py,sha256=_5ZBHZ5t8FVC3v33gQz8WQigfH5yjNbn2Dl4W1Md34Q,5348
14
+ nemo_evaluator_launcher/cli/status.py,sha256=TGjAP1dWHj-KD_Fa54QN3FFCpWJIBQAhzmpypE4X-Y0,4208
16
15
  nemo_evaluator_launcher/cli/version.py,sha256=puMwIvkmfD3HESjftdTSP6T3Nc8J4cbz8uXWHJcTemY,2030
17
16
  nemo_evaluator_launcher/common/__init__.py,sha256=6-xb4KpG8-lZbWBI42c_Gax-Sq0kMSW8UG0Vn8dOBlo,744
18
17
  nemo_evaluator_launcher/common/execdb.py,sha256=ZSMClC2kl6KI28tnHCEtNbbFZ2tLKcSbFeUenbb4E6Q,6547
@@ -34,7 +33,7 @@ nemo_evaluator_launcher/executors/registry.py,sha256=8QXSrsJyHeNi8iSttJ8KWQLXmZv
34
33
  nemo_evaluator_launcher/executors/lepton/__init__.py,sha256=F_7yuBaYQ6WWTcptADdkL3AIZ_jXJQHGgKag-Hm7BbQ,698
35
34
  nemo_evaluator_launcher/executors/lepton/deployment_helpers.py,sha256=m4HLFt9J03PMaPXyrrokBv4Zfpf8hVFsQXYBmPJElA8,20956
36
35
  nemo_evaluator_launcher/executors/lepton/executor.py,sha256=cYcPJhh19Wvj29suYy95yOGhZuYeLxGlxuJgjHmgNwc,37298
37
- nemo_evaluator_launcher/executors/lepton/job_helpers.py,sha256=4LA7R9VisQpCTVMCFxIe6uE5YW-OowwSLmUFgJg-4j4,13423
36
+ nemo_evaluator_launcher/executors/lepton/job_helpers.py,sha256=6baTxcygfP1oFgAJ7I9EL4xRlcJDWqbqzZoE1CRrwSk,13528
38
37
  nemo_evaluator_launcher/executors/local/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
39
38
  nemo_evaluator_launcher/executors/local/executor.py,sha256=ctiyi2rMi01lzTInFdtUdetXU0JTPlT3E-acFjgWdjA,17802
40
39
  nemo_evaluator_launcher/executors/local/run.template.sh,sha256=ta55-WukiVXO2hyqqt0JCEjW23JrF41DYG0dBT1tdJA,3320
@@ -49,9 +48,9 @@ nemo_evaluator_launcher/exporters/registry.py,sha256=XsPTv_SBAFjcErO6BJ3OHqs3EvX
49
48
  nemo_evaluator_launcher/exporters/utils.py,sha256=uXH4b-Hk7_FQyLOjMRB0b3zK-Ksb2rGlSdc-oECfGHI,24756
50
49
  nemo_evaluator_launcher/exporters/wandb.py,sha256=xdaPNw0QM0jZo20UERbViy_vFT-HgbLYzTgmWaev_kk,13430
51
50
  nemo_evaluator_launcher/resources/mapping.toml,sha256=uOg4Y-gDXXskbbba2vuwJ5FLJ3W0kSZz7Fap_nJnFQc,11322
52
- nemo_evaluator_launcher-0.1.1.dist-info/licenses/LICENSE,sha256=DyGb0fqHPZAsd_uXHA0DGcOCqsvrNsImuLC0Ts4s1zI,23413
53
- nemo_evaluator_launcher-0.1.1.dist-info/METADATA,sha256=O_KXwNWNpchWPgyNyZavb_kKYC7gPK8-b1b3axlztf8,28714
54
- nemo_evaluator_launcher-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- nemo_evaluator_launcher-0.1.1.dist-info/entry_points.txt,sha256=64z1T5GKSB9PW1fCENQuor6X6eqH1rcfg0NQGfKrEy8,130
56
- nemo_evaluator_launcher-0.1.1.dist-info/top_level.txt,sha256=5PvawNm9TXKqPRjZita1xPOtFiMOipcoRf50FI1iY3s,24
57
- nemo_evaluator_launcher-0.1.1.dist-info/RECORD,,
51
+ nemo_evaluator_launcher-0.1.3.dist-info/licenses/LICENSE,sha256=DyGb0fqHPZAsd_uXHA0DGcOCqsvrNsImuLC0Ts4s1zI,23413
52
+ nemo_evaluator_launcher-0.1.3.dist-info/METADATA,sha256=C1CcvT4U0Kt157_09t7NCS4oy-EEODyvmY2B40454SM,28714
53
+ nemo_evaluator_launcher-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ nemo_evaluator_launcher-0.1.3.dist-info/entry_points.txt,sha256=64z1T5GKSB9PW1fCENQuor6X6eqH1rcfg0NQGfKrEy8,130
55
+ nemo_evaluator_launcher-0.1.3.dist-info/top_level.txt,sha256=5PvawNm9TXKqPRjZita1xPOtFiMOipcoRf50FI1iY3s,24
56
+ nemo_evaluator_launcher-0.1.3.dist-info/RECORD,,
@@ -1,117 +0,0 @@
1
- # SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2
- # SPDX-License-Identifier: Apache-2.0
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
- import datetime as _dt
17
- import sys
18
- from dataclasses import dataclass
19
- from typing import Optional
20
-
21
- from simple_parsing import field
22
-
23
- from nemo_evaluator_launcher.api.functional import (
24
- get_invocation_benchmarks,
25
- list_all_invocations_summary,
26
- )
27
-
28
-
29
- @dataclass
30
- class Cmd:
31
- """Show a concise invocations table from the exec DB."""
32
-
33
- limit: Optional[int] = field(default=None, alias=["--limit"], help="Max rows")
34
- executor: Optional[str] = field(
35
- default=None, alias=["--executor"], help="Filter by executor"
36
- )
37
- since: Optional[str] = field(
38
- default=None,
39
- alias=["--since"],
40
- help="Filter by ISO date/time (e.g., 2025-08-20 or 2025-08-20T12:00:00)",
41
- )
42
-
43
- def execute(self) -> None:
44
- rows = list_all_invocations_summary()
45
-
46
- # Apply filters
47
- if self.executor:
48
- rows = [
49
- r
50
- for r in rows
51
- if (r.get("executor") or "").lower() == self.executor.lower()
52
- ]
53
-
54
- if self.since:
55
- try:
56
- # Parse with optional time
57
- if "T" in self.since:
58
- since_ts = _dt.datetime.fromisoformat(self.since).timestamp()
59
- else:
60
- since_ts = _dt.datetime.fromisoformat(
61
- self.since + "T00:00:00"
62
- ).timestamp()
63
- rows = [r for r in rows if (r.get("earliest_job_ts") or 0) >= since_ts]
64
- except Exception:
65
- print(
66
- f"Invalid --since value: {self.since}. Use YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS",
67
- file=sys.stderr,
68
- )
69
- sys.exit(2)
70
-
71
- if self.limit is not None and self.limit >= 0:
72
- rows = rows[: self.limit]
73
-
74
- # Print table (always include benchmarks column)
75
- header = [
76
- "invocation_id",
77
- "earliest_job_ts",
78
- "num_jobs",
79
- "executor",
80
- "benchmarks",
81
- ]
82
- # Format ts as ISO without microseconds
83
- table_rows = []
84
- for r in rows:
85
- ts = r.get("earliest_job_ts", 0) or 0
86
- try:
87
- ts_iso = (
88
- _dt.datetime.fromtimestamp(ts).replace(microsecond=0).isoformat()
89
- )
90
- except Exception:
91
- ts_iso = ""
92
- inv = r.get("invocation_id", "")
93
- try:
94
- bmarks = get_invocation_benchmarks(inv)
95
- bmarks_cell = ",".join(bmarks) if bmarks else "unknown"
96
- except Exception:
97
- bmarks_cell = "unknown"
98
- table_rows.append(
99
- [
100
- str(inv),
101
- ts_iso,
102
- str(r.get("num_jobs", 0)),
103
- str(r.get("executor", "")),
104
- bmarks_cell,
105
- ]
106
- )
107
-
108
- widths = [len(h) for h in header]
109
- for tr in table_rows:
110
- for i, cell in enumerate(tr):
111
- if len(cell) > widths[i]:
112
- widths[i] = len(cell)
113
- fmt = " ".join([f"{{:<{w}}}" for w in widths])
114
- print(fmt.format(*header))
115
- print(" ".join(["-" * w for w in widths]))
116
- for tr in table_rows:
117
- print(fmt.format(*tr))