nemo-evaluator-launcher 0.1.0rc4__py3-none-any.whl → 0.1.0rc5__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.
- nemo_evaluator_launcher/common/helpers.py +47 -10
- nemo_evaluator_launcher/executors/slurm/executor.py +2 -1
- nemo_evaluator_launcher/package_info.py +1 -1
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/METADATA +1 -1
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/RECORD +9 -9
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/WHEEL +0 -0
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/entry_points.txt +0 -0
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/licenses/LICENSE +0 -0
- {nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/top_level.txt +0 -0
|
@@ -13,18 +13,51 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
|
+
import base64
|
|
16
17
|
import copy
|
|
17
18
|
import datetime
|
|
18
19
|
from typing import Optional
|
|
19
20
|
|
|
21
|
+
import yaml
|
|
20
22
|
from omegaconf import DictConfig, OmegaConf
|
|
21
23
|
|
|
22
24
|
from nemo_evaluator_launcher.common.logging_utils import logger
|
|
23
25
|
|
|
24
26
|
|
|
27
|
+
def _yaml_to_echo_command(yaml_str: str, filename: str = "config_ef.yaml") -> str:
|
|
28
|
+
yaml_str_b64 = base64.b64encode(yaml_str.encode("utf-8")).decode("utf-8")
|
|
29
|
+
return f'echo "{yaml_str_b64}" | base64 -d > {filename}'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_eval_factory_config(
|
|
33
|
+
cfg: DictConfig, user_task_config: DictConfig, task_definition: dict
|
|
34
|
+
) -> dict:
|
|
35
|
+
"""Extract config fields for eval factory.
|
|
36
|
+
|
|
37
|
+
This function extracts the config field similar to how overrides are handled.
|
|
38
|
+
"""
|
|
39
|
+
# Extract config fields similar to overrides - convert to basic Python types first
|
|
40
|
+
cfg_config = cfg.evaluation.get("config", {})
|
|
41
|
+
user_config = user_task_config.get("config", {})
|
|
42
|
+
|
|
43
|
+
# Convert OmegaConf objects to basic Python types
|
|
44
|
+
if cfg_config:
|
|
45
|
+
cfg_config = OmegaConf.to_container(cfg_config, resolve=True)
|
|
46
|
+
if user_config:
|
|
47
|
+
user_config = OmegaConf.to_container(user_config, resolve=True)
|
|
48
|
+
|
|
49
|
+
# Merge the configs
|
|
50
|
+
config_fields = copy.deepcopy(cfg_config or {})
|
|
51
|
+
config_fields.update(user_config or {})
|
|
52
|
+
|
|
53
|
+
return config_fields
|
|
54
|
+
|
|
55
|
+
|
|
25
56
|
def get_eval_factory_command(
|
|
26
57
|
cfg: DictConfig, user_task_config: DictConfig, task_definition: dict
|
|
27
58
|
) -> str:
|
|
59
|
+
config_fields = get_eval_factory_config(cfg, user_task_config, task_definition)
|
|
60
|
+
|
|
28
61
|
overrides = copy.deepcopy(dict(cfg.evaluation.get("overrides", {})))
|
|
29
62
|
overrides.update(dict(user_task_config.get("overrides", {})))
|
|
30
63
|
# NOTE(dfridman): Temporary fix to make sure that the overrides arg is not split into multiple lines.
|
|
@@ -34,16 +67,20 @@ def get_eval_factory_command(
|
|
|
34
67
|
}
|
|
35
68
|
overrides_str = ",".join([f"{k}={v}" for k, v in overrides.items()])
|
|
36
69
|
model_url = get_endpoint_url(cfg, user_task_config, task_definition)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
70
|
+
|
|
71
|
+
model_id = get_served_model_name(cfg)
|
|
72
|
+
model_type = task_definition["endpoint_type"]
|
|
73
|
+
eval_type = task_definition["task"]
|
|
74
|
+
|
|
75
|
+
create_file_cmd = _yaml_to_echo_command(
|
|
76
|
+
yaml.safe_dump(config_fields), "config_ef.yaml"
|
|
77
|
+
)
|
|
78
|
+
nv_eval_command = f"""nv_eval run_eval --model_id {model_id} --model_type {model_type} --eval_type {eval_type} --model_url {model_url} --api_key_name API_KEY --output_dir /results --run_config config_ef.yaml"""
|
|
79
|
+
|
|
80
|
+
if overrides:
|
|
81
|
+
nv_eval_command = f"{nv_eval_command} --overrides {overrides_str}"
|
|
82
|
+
|
|
83
|
+
return create_file_cmd + " && " + "cat config_ef.yaml && " + nv_eval_command
|
|
47
84
|
|
|
48
85
|
|
|
49
86
|
def get_endpoint_url(
|
|
@@ -594,8 +594,9 @@ def _create_slurm_sbatch_script(
|
|
|
594
594
|
s += "--no-container-mount-home "
|
|
595
595
|
s += "--container-mounts {} ".format(",".join(evaluation_mounts_list))
|
|
596
596
|
s += "--output {} ".format(remote_task_subdir / "logs" / "client-%A.out")
|
|
597
|
+
s += "bash -c '"
|
|
597
598
|
s += get_eval_factory_command(cfg, task, task_definition)
|
|
598
|
-
s += "\n\n"
|
|
599
|
+
s += "'\n\n"
|
|
599
600
|
|
|
600
601
|
# terminate the server after all evaluation clients finish
|
|
601
602
|
if cfg.deployment.type != "none":
|
{nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/RECORD
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
nemo_evaluator_launcher/__init__.py,sha256=2F703fttLaIyMHoVD54rptHMXt4AWnplHDrwWJ3e3PM,1930
|
|
2
|
-
nemo_evaluator_launcher/package_info.py,sha256=
|
|
2
|
+
nemo_evaluator_launcher/package_info.py,sha256=sginTs4w_dL6skrnEgbCWyjmTIN6Vra-t1s46Q86M3I,1427
|
|
3
3
|
nemo_evaluator_launcher/api/__init__.py,sha256=U9q_MJK2vRsFaymanhyy0nD1SNAZQZC8oY45RXPX7ac,1024
|
|
4
4
|
nemo_evaluator_launcher/api/functional.py,sha256=lsLV0RUvVqd1VG0KAgUDmHPe7DUVFJ5bVaWUuSILx7A,24918
|
|
5
5
|
nemo_evaluator_launcher/api/types.py,sha256=RXr_QoKdhejj1T9-HybSjd4KTxJmSv0bE0uLUFtF7Zc,3269
|
|
@@ -16,7 +16,7 @@ nemo_evaluator_launcher/cli/status.py,sha256=JYQnT3YVtx9lzxme4Xak00Cme5MN87wyt4k
|
|
|
16
16
|
nemo_evaluator_launcher/cli/version.py,sha256=puMwIvkmfD3HESjftdTSP6T3Nc8J4cbz8uXWHJcTemY,2030
|
|
17
17
|
nemo_evaluator_launcher/common/__init__.py,sha256=6-xb4KpG8-lZbWBI42c_Gax-Sq0kMSW8UG0Vn8dOBlo,744
|
|
18
18
|
nemo_evaluator_launcher/common/execdb.py,sha256=ZSMClC2kl6KI28tnHCEtNbbFZ2tLKcSbFeUenbb4E6Q,6547
|
|
19
|
-
nemo_evaluator_launcher/common/helpers.py,sha256=
|
|
19
|
+
nemo_evaluator_launcher/common/helpers.py,sha256=eQKNsLp9D5NoKZXOjoaKnu3WJAQF3GCKWOIJldG4sKU,7632
|
|
20
20
|
nemo_evaluator_launcher/common/logging_utils.py,sha256=8UMAQ22t5NAJRDZtI0gVbdKUlNAiG23WQwZZ0HwzOT4,11843
|
|
21
21
|
nemo_evaluator_launcher/common/mapping.py,sha256=tD3jWN7rm9-iJEFlENhYMt7adz8DKs67g3Xd43XIAMM,10731
|
|
22
22
|
nemo_evaluator_launcher/configs/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
|
|
@@ -39,7 +39,7 @@ nemo_evaluator_launcher/executors/local/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQn
|
|
|
39
39
|
nemo_evaluator_launcher/executors/local/executor.py,sha256=ctiyi2rMi01lzTInFdtUdetXU0JTPlT3E-acFjgWdjA,17802
|
|
40
40
|
nemo_evaluator_launcher/executors/local/run.template.sh,sha256=ta55-WukiVXO2hyqqt0JCEjW23JrF41DYG0dBT1tdJA,3320
|
|
41
41
|
nemo_evaluator_launcher/executors/slurm/__init__.py,sha256=lNC_skFLYTOt-arnY3ZQnZMWzHlrtD2wAoHvDcHddwM,673
|
|
42
|
-
nemo_evaluator_launcher/executors/slurm/executor.py,sha256=
|
|
42
|
+
nemo_evaluator_launcher/executors/slurm/executor.py,sha256=xfSvQ1MRlAqM6TI9Rsmh-MNIq0DdHaHo_Vu_SlrMNUM,35813
|
|
43
43
|
nemo_evaluator_launcher/exporters/__init__.py,sha256=mBXG9FG48FeYrs8sF0zA2mgo1eqBmRgoml7zjJrqDso,1323
|
|
44
44
|
nemo_evaluator_launcher/exporters/base.py,sha256=toeitHi-reouJvhRULtsceMlpZat4fHcQIXIbAKury0,3904
|
|
45
45
|
nemo_evaluator_launcher/exporters/gsheets.py,sha256=P2TeHr63qXIGh5nzXhs2l10n5_r2I2C4uWx3pbjX-EY,15084
|
|
@@ -49,9 +49,9 @@ nemo_evaluator_launcher/exporters/registry.py,sha256=XsPTv_SBAFjcErO6BJ3OHqs3EvX
|
|
|
49
49
|
nemo_evaluator_launcher/exporters/utils.py,sha256=uXH4b-Hk7_FQyLOjMRB0b3zK-Ksb2rGlSdc-oECfGHI,24756
|
|
50
50
|
nemo_evaluator_launcher/exporters/wandb.py,sha256=xdaPNw0QM0jZo20UERbViy_vFT-HgbLYzTgmWaev_kk,13430
|
|
51
51
|
nemo_evaluator_launcher/resources/mapping.toml,sha256=uOg4Y-gDXXskbbba2vuwJ5FLJ3W0kSZz7Fap_nJnFQc,11322
|
|
52
|
-
nemo_evaluator_launcher-0.1.
|
|
53
|
-
nemo_evaluator_launcher-0.1.
|
|
54
|
-
nemo_evaluator_launcher-0.1.
|
|
55
|
-
nemo_evaluator_launcher-0.1.
|
|
56
|
-
nemo_evaluator_launcher-0.1.
|
|
57
|
-
nemo_evaluator_launcher-0.1.
|
|
52
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/licenses/LICENSE,sha256=DyGb0fqHPZAsd_uXHA0DGcOCqsvrNsImuLC0Ts4s1zI,23413
|
|
53
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/METADATA,sha256=EFGSW8P-9TWK3k0p2uhkek2vVP4v2QMVoY5BIxzQAQc,1282
|
|
54
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/entry_points.txt,sha256=64z1T5GKSB9PW1fCENQuor6X6eqH1rcfg0NQGfKrEy8,130
|
|
56
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/top_level.txt,sha256=5PvawNm9TXKqPRjZita1xPOtFiMOipcoRf50FI1iY3s,24
|
|
57
|
+
nemo_evaluator_launcher-0.1.0rc5.dist-info/RECORD,,
|
{nemo_evaluator_launcher-0.1.0rc4.dist-info → nemo_evaluator_launcher-0.1.0rc5.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|