Skip to content

chore: jobs#16

Merged
brodeynewman merged 4 commits into
mainfrom
brodey/jobs
Mar 17, 2026
Merged

chore: jobs#16
brodeynewman merged 4 commits into
mainfrom
brodey/jobs

Conversation

@brodeynewman
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread sdk/python/src/p95/cli.py
# Check for cloud commands first
if _is_cloud_command():
from p95.cloud_cli import main_cloud
main_cloud()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
main_cloud()
main_cloud()

# Runs Commands
# ===========================================

def runs_list(args: argparse.Namespace) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def runs_list(args: argparse.Namespace) -> None:
def runs_list(args: argparse.Namespace) -> None:

# Jobs Commands
# ===========================================

def jobs_create(args: argparse.Namespace) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def jobs_create(args: argparse.Namespace) -> None:
def jobs_create(args: argparse.Namespace) -> None:

# Workers Commands
# ===========================================

def workers_list(args: argparse.Namespace) -> None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def workers_list(args: argparse.Namespace) -> None:
def workers_list(args: argparse.Namespace) -> None:

# Main CLI Entry Point
# ===========================================

def create_parser() -> argparse.ArgumentParser:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def create_parser() -> argparse.ArgumentParser:
def create_parser() -> argparse.ArgumentParser:

Comment thread sdk/python/src/p95/worker.py Outdated
["sysctl", "-n", "hw.memsize"],
capture_output=True, text=True
)
caps.memory_gb = int(result.stdout.strip()) / (1024 ** 3)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
caps.memory_gb = int(result.stdout.strip()) / (1024 ** 3)
caps.memory_gb = int(result.stdout.strip()) / (1024**3)

Comment thread sdk/python/src/p95/worker.py Outdated
for line in f:
if line.startswith("MemTotal:"):
# Value is in kB
caps.memory_gb = int(line.split()[1]) / (1024 ** 2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
caps.memory_gb = int(line.split()[1]) / (1024 ** 2)
caps.memory_gb = int(line.split()[1]) / (1024**2)

Comment thread sdk/python/src/p95/worker.py Outdated
Comment on lines +141 to +142
["nvidia-smi", "--query-gpu=count,memory.total,name", "--format=csv,noheader,nounits"],
capture_output=True, text=True
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
["nvidia-smi", "--query-gpu=count,memory.total,name", "--format=csv,noheader,nounits"],
capture_output=True, text=True
[
"nvidia-smi",
"--query-gpu=count,memory.total,name",
"--format=csv,noheader,nounits",
],
capture_output=True,
text=True,

elif job.script:
# Write script to temp file and run
import tempfile
with tempfile.NamedTemporaryFile(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
with tempfile.NamedTemporaryFile(
with tempfile.NamedTemporaryFile(

Comment thread sdk/python/src/p95/worker.py Outdated
Comment on lines +376 to +378
logger.info(f"Capabilities: GPU={self.capabilities.gpu_count}, "
f"CPU={self.capabilities.cpu_count}, "
f"Memory={self.capabilities.memory_gb:.1f}GB")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
logger.info(f"Capabilities: GPU={self.capabilities.gpu_count}, "
f"CPU={self.capabilities.cpu_count}, "
f"Memory={self.capabilities.memory_gb:.1f}GB")
logger.info(
f"Capabilities: GPU={self.capabilities.gpu_count}, "
f"CPU={self.capabilities.cpu_count}, "
f"Memory={self.capabilities.memory_gb:.1f}GB"
)

Comment thread sdk/python/src/p95/cloud_cli.py Outdated
import json
import os
import sys
from typing import Any, Dict, List, Optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-check] reported by reviewdog 🐶

Suggested change
from typing import Any, Dict, List, Optional
from typing import Any, Dict

Comment thread sdk/python/src/p95/cloud_cli.py Outdated
from typing import Any, Dict, List, Optional

from p95.client import P95Client
from p95.config import SDKConfig, get_config
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-check] reported by reviewdog 🐶

Suggested change
from p95.config import SDKConfig, get_config
from p95.config import get_config

Comment thread sdk/python/src/p95/worker.py Outdated
from typing import Any, Dict, List, Optional

from p95.client import P95Client
from p95.config import SDKConfig, get_config
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-check] reported by reviewdog 🐶

Suggested change
from p95.config import SDKConfig, get_config
from p95.config import get_config

Comment thread sdk/python/src/p95/cloud_cli.py Outdated
import json
import os
import sys
from typing import Any, Dict, List, Optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
typing.List imported but unused

Suggested change
from typing import Any, Dict, List, Optional
from typing import Any, Dict

Comment thread sdk/python/src/p95/cloud_cli.py Outdated
import json
import os
import sys
from typing import Any, Dict, List, Optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
typing.Optional imported but unused

Suggested change
from typing import Any, Dict, List, Optional
from typing import Any, Dict

Comment thread sdk/python/src/p95/cloud_cli.py Outdated
from typing import Any, Dict, List, Optional

from p95.client import P95Client
from p95.config import SDKConfig, get_config
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
p95.config.SDKConfig imported but unused

Suggested change
from p95.config import SDKConfig, get_config
from p95.config import get_config

Comment thread sdk/python/src/p95/worker.py Outdated
from typing import Any, Dict, List, Optional

from p95.client import P95Client
from p95.config import SDKConfig, get_config
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
p95.config.SDKConfig imported but unused

Suggested change
from p95.config import SDKConfig, get_config
from p95.config import get_config

import torch
import torch.nn as nn
import torch.optim as optim
HAS_TORCH = True
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
HAS_TORCH = True
HAS_TORCH = True



if HAS_TORCH:
class MLP(nn.Module):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
class MLP(nn.Module):
class MLP(nn.Module):

if HAS_TORCH:
class MLP(nn.Module):
"""Simple MLP classifier."""
def __init__(self, n_features, n_hidden, n_classes, dropout=0.2):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def __init__(self, n_features, n_hidden, n_classes, dropout=0.2):
def __init__(self, n_features, n_hidden, n_classes, dropout=0.2):


class NumpyMLP:
"""Simple numpy-based MLP for when PyTorch isn't available."""
def __init__(self, n_features, n_hidden, n_classes, lr=0.01):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
def __init__(self, n_features, n_hidden, n_classes, lr=0.01):
def __init__(self, n_features, n_hidden, n_classes, lr=0.01):

Comment thread sdk/python/examples/train_mlp.py Outdated
def __init__(self, n_features, n_hidden, n_classes, lr=0.01):
self.lr = lr
# Xavier initialization
self.W1 = np.random.randn(n_features, n_hidden).astype(np.float32) * np.sqrt(2.0 / n_features)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
self.W1 = np.random.randn(n_features, n_hidden).astype(np.float32) * np.sqrt(2.0 / n_features)
self.W1 = np.random.randn(n_features, n_hidden).astype(np.float32) * np.sqrt(
2.0 / n_features
)

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +215 to +220
run.log_metrics({
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
}, step=epoch)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
run.log_metrics({
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
}, step=epoch)
run.log_metrics(
{
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
},
step=epoch,
)

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +235 to +237
print(f"Epoch {epoch+1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
print(f"Epoch {epoch+1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}")
print(
f"Epoch {epoch + 1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}"
)

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +297 to +302
run.log_metrics({
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
}, step=epoch)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
run.log_metrics({
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
}, step=epoch)
run.log_metrics(
{
"train/loss": train_loss,
"train/accuracy": train_acc,
"val/loss": val_loss,
"val/accuracy": val_acc,
},
step=epoch,
)

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +315 to +317
print(f"Epoch {epoch+1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
print(f"Epoch {epoch+1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}")
print(
f"Epoch {epoch + 1}/{config['epochs']} - "
f"train_loss: {train_loss:.4f}, train_acc: {train_acc:.4f}, "
f"val_loss: {val_loss:.4f}, val_acc: {val_acc:.4f}"
)

Comment thread sdk/python/src/p95/client.py Outdated
Returns:
Updated job dictionary
"""
return self._request("POST", f"/jobs/{job_id}/link-run", data={"run_id": run_id})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-format] reported by reviewdog 🐶

Suggested change
return self._request("POST", f"/jobs/{job_id}/link-run", data={"run_id": run_id})
return self._request(
"POST", f"/jobs/{job_id}/link-run", data={"run_id": run_id}
)

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +19 to +21
import time
import math
import random
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-check] reported by reviewdog 🐶

Suggested change
import time
import math
import random

Comment thread sdk/python/examples/train_mlp.py Outdated
# Determine project - use env var if set (for remote mode)
project = os.environ.get("P95_PROJECT", "mlp-training")

print(f"Training MLP classifier")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ruff-check] reported by reviewdog 🐶

Suggested change
print(f"Training MLP classifier")
print("Training MLP classifier")

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +19 to +20
import time
import math
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
time imported but unused

Suggested change
import time
import math
import math

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +20 to +21
import math
import random
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
math imported but unused

Suggested change
import math
import random
import random

Comment thread sdk/python/examples/train_mlp.py Outdated
Comment on lines +21 to +22
import random

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F401> reported by reviewdog 🐶
random imported but unused

Suggested change
import random

Comment thread sdk/python/examples/train_mlp.py Outdated
# Determine project - use env var if set (for remote mode)
project = os.environ.get("P95_PROJECT", "mlp-training")

print(f"Training MLP classifier")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <F541> reported by reviewdog 🐶
f-string without any placeholders

Suggested change
print(f"Training MLP classifier")
print("Training MLP classifier")

@brodeynewman brodeynewman merged commit 28723ed into main Mar 17, 2026
3 checks passed
@brodeynewman brodeynewman deleted the brodey/jobs branch March 17, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant