style: apply ruff format to cli.py and test_condor_gpu.py
Pre-existing formatting drift, unrelated to any functional change.
This commit is contained in:
+12
-24
@@ -543,14 +543,10 @@ def new_run(
|
|||||||
conditioning: Annotated[
|
conditioning: Annotated[
|
||||||
Optional[Conditioning], typer.Option("--conditioning")
|
Optional[Conditioning], typer.Option("--conditioning")
|
||||||
] = None,
|
] = None,
|
||||||
router: Annotated[
|
router: Annotated[Optional[bool], typer.Option("--router/--no-router")] = None,
|
||||||
Optional[bool], typer.Option("--router/--no-router")
|
|
||||||
] = None,
|
|
||||||
router_type: Annotated[Optional[str], typer.Option("--router-type")] = None,
|
router_type: Annotated[Optional[str], typer.Option("--router-type")] = None,
|
||||||
n_experts: Annotated[Optional[int], typer.Option("--n-experts")] = None,
|
n_experts: Annotated[Optional[int], typer.Option("--n-experts")] = None,
|
||||||
router_axis: Annotated[
|
router_axis: Annotated[Optional[list[str]], typer.Option("--router-axis")] = None,
|
||||||
Optional[list[str]], typer.Option("--router-axis")
|
|
||||||
] = None,
|
|
||||||
out: Annotated[
|
out: Annotated[
|
||||||
Optional[Path],
|
Optional[Path],
|
||||||
typer.Option("--out", "-o", help="Run dir (default: auto from hyperparams)"),
|
typer.Option("--out", "-o", help="Run dir (default: auto from hyperparams)"),
|
||||||
@@ -619,7 +615,9 @@ def new_run(
|
|||||||
if cli_router:
|
if cli_router:
|
||||||
cli_model["router"] = cli_router
|
cli_model["router"] = cli_router
|
||||||
|
|
||||||
cfg = gconfig.merge_cli_overrides(gconfig.DEFAULT_CONFIG, config, cli_train, cli_model)
|
cfg = gconfig.merge_cli_overrides(
|
||||||
|
gconfig.DEFAULT_CONFIG, config, cli_train, cli_model
|
||||||
|
)
|
||||||
run_dir = (out or gconfig.default_out_dir(cfg)).resolve()
|
run_dir = (out or gconfig.default_out_dir(cfg)).resolve()
|
||||||
|
|
||||||
if not force:
|
if not force:
|
||||||
@@ -1460,14 +1458,10 @@ def train_submit(
|
|||||||
request_gpus: Annotated[int, typer.Option("--request-gpus")] = 1,
|
request_gpus: Annotated[int, typer.Option("--request-gpus")] = 1,
|
||||||
gpu_type: Annotated[
|
gpu_type: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
typer.Option(
|
typer.Option("--gpu-type", help='Pin GPU model, e.g. "Tesla V100-PCIE-32GB"'),
|
||||||
"--gpu-type", help='Pin GPU model, e.g. "Tesla V100-PCIE-32GB"'
|
|
||||||
),
|
|
||||||
] = None,
|
] = None,
|
||||||
gpu_memory_mb: Annotated[Optional[int], typer.Option("--gpu-memory-mb")] = None,
|
gpu_memory_mb: Annotated[Optional[int], typer.Option("--gpu-memory-mb")] = None,
|
||||||
request_memory: Annotated[
|
request_memory: Annotated[int, typer.Option("--request-memory", help="MB")] = 16384,
|
||||||
int, typer.Option("--request-memory", help="MB")
|
|
||||||
] = 16384,
|
|
||||||
request_walltime: Annotated[
|
request_walltime: Annotated[
|
||||||
int, typer.Option("--request-walltime", help="Seconds (default: 2 days)")
|
int, typer.Option("--request-walltime", help="Seconds (default: 2 days)")
|
||||||
] = 172800,
|
] = 172800,
|
||||||
@@ -1615,7 +1609,8 @@ def rollout_submit(
|
|||||||
),
|
),
|
||||||
] = 10,
|
] = 10,
|
||||||
weights: Annotated[
|
weights: Annotated[
|
||||||
Weights, typer.Option("--weights", help="raw or ema (see `giant rollout --help`)")
|
Weights,
|
||||||
|
typer.Option("--weights", help="raw or ema (see `giant rollout --help`)"),
|
||||||
] = Weights.raw,
|
] = Weights.raw,
|
||||||
batch_size: Annotated[
|
batch_size: Annotated[
|
||||||
int, typer.Option("--batch-size", "-b", help="Tracks stepped per model forward")
|
int, typer.Option("--batch-size", "-b", help="Tracks stepped per model forward")
|
||||||
@@ -1647,14 +1642,10 @@ def rollout_submit(
|
|||||||
request_gpus: Annotated[int, typer.Option("--request-gpus")] = 1,
|
request_gpus: Annotated[int, typer.Option("--request-gpus")] = 1,
|
||||||
gpu_type: Annotated[
|
gpu_type: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
typer.Option(
|
typer.Option("--gpu-type", help='Pin GPU model, e.g. "Tesla V100-PCIE-32GB"'),
|
||||||
"--gpu-type", help='Pin GPU model, e.g. "Tesla V100-PCIE-32GB"'
|
|
||||||
),
|
|
||||||
] = None,
|
] = None,
|
||||||
gpu_memory_mb: Annotated[Optional[int], typer.Option("--gpu-memory-mb")] = None,
|
gpu_memory_mb: Annotated[Optional[int], typer.Option("--gpu-memory-mb")] = None,
|
||||||
request_memory: Annotated[
|
request_memory: Annotated[int, typer.Option("--request-memory", help="MB")] = 16384,
|
||||||
int, typer.Option("--request-memory", help="MB")
|
|
||||||
] = 16384,
|
|
||||||
request_walltime: Annotated[
|
request_walltime: Annotated[
|
||||||
int, typer.Option("--request-walltime", help="Seconds (default: 2 days)")
|
int, typer.Option("--request-walltime", help="Seconds (default: 2 days)")
|
||||||
] = 172800,
|
] = 172800,
|
||||||
@@ -1722,10 +1713,7 @@ def rollout_submit(
|
|||||||
|
|
||||||
command = f"uv run giant rollout {q(str(data_path))} " + " ".join(flags)
|
command = f"uv run giant rollout {q(str(data_path))} " + " ".join(flags)
|
||||||
wrapper_body = (
|
wrapper_body = (
|
||||||
"#!/bin/bash\n"
|
f"#!/bin/bash\nset -euo pipefail\ncd {q(str(repo_path))}\nexec {command}\n"
|
||||||
"set -euo pipefail\n"
|
|
||||||
f"cd {q(str(repo_path))}\n"
|
|
||||||
f"exec {command}\n"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
submit_cfg = GpuSubmitConfig(
|
submit_cfg = GpuSubmitConfig(
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ from typer.testing import CliRunner
|
|||||||
|
|
||||||
from giant import config as gconfig
|
from giant import config as gconfig
|
||||||
from giant.cli import app
|
from giant.cli import app
|
||||||
from giant.condor import CondorJobMeta, GpuSubmitConfig, parse_cluster_id, write_gpu_submit
|
from giant.condor import (
|
||||||
|
CondorJobMeta,
|
||||||
|
GpuSubmitConfig,
|
||||||
|
parse_cluster_id,
|
||||||
|
write_gpu_submit,
|
||||||
|
)
|
||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user