Registry / ai-ml / wandb-osh

wandb-osh

JSON →
library1.2.3pypypi✓ verified 85d ago

Trigger W&B offline syncs from compute nodes without internet access. Current version: 1.2.3. Release cadence is irregular, with bug fixes and minor enhancements.

pip install wandb-osh
INSTALL
IMPORT
SIG · WANDB-OSH
W
wandb-osh
ai-mlpythonv1.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wandb_osh
import wandb_osh
from wandb_osh import WandbOSH
wandb_osh is a module, not a class; the main class is wandb_osh.WandbOSH
TriggerWandbSyncHook
from wandb_osh import TriggerWandbSyncHook
from wandb_osh.hooks import TriggerWandbSyncHook
The hook is re-exported from the top-level module since v1.0.0
wandb_osh.set_log_level
wandb_osh.set_log_level('INFO')
wandb_osh.set_log_level(logging.INFO)
Accepts a string, not a logging level constant; added in v1.2.0

Minimal setup for offline W&B logging with automatic sync trigger.

import wandb_osh import wandb # Initialize W&B in offline mode wandb.init(mode="offline", project="my_project") # Create the sync trigger trigger = wandb_osh.TriggerWandbSyncHook() # Example: trigger sync after each run (e.g., at end of script) # Note: In practice, the trigger runs in a background thread/process. # For a full example, see the GitHub README. print("Run completed. Sync will be triggered automatically.")
wandb-osh --version
Debug
Known issues
gotchawandb_osh.TriggerWandbSyncHook requires W&B to be initialized in offline mode. If mode is not set to 'offline', the hook may not work.
fix
Call wandb.init(mode='offline', ...) before using the hook.
affects: all
deprecatedThe optional dependency 'pytorch-lightning' was replaced by 'lightning' (the new unified package) in v1.2.2. Installing 'pytorch-lightning' is deprecated.
fix
Install wandb-osh with 'lightning' extra: pip install wandb-osh[lightning]
affects: >=1.2.2
gotchaIn distributed training (e.g., DDP), the sync hook may trigger on every process, causing duplicate syncs. This was partially fixed in v1.2.3, but ensure only rank 0 triggers sync.
fix
Wrap trigger instantiation with a rank check: if dist.get_rank() == 0: trigger = TriggerWandbSyncHook()
affects: <=1.2.2
breakingPython 3.7 support was dropped in v1.1.0.
fix
Use Python 3.8 or higher.
affects: >=1.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'wandb_osh'
Library not installed or wrong import path.
fix
Install using: pip install wandb-osh
AttributeError: module 'wandb_osh' has no attribute 'TriggerWandbSyncHook'
Outdated version (<1.0.0) or trying to import from wrong submodule.
fix
Update to latest version: pip install --upgrade wandb-osh, then use: from wandb_osh import TriggerWandbSyncHook
wandb.errors.error.UsageError: Mode must be 'offline' to use TriggerWandbSyncHook
W&B initialized without mode='offline'.
fix
Call wandb.init(mode='offline', ...) before creating the trigger.
Upgrade
Version history
1.2.3latest on PyPI
Audit
Dependencies
wandbrequiredCore dependency for W&B integration
lightningoptionalOptional integration for PyTorch Lightning
Agent activity
39 hits · last 30 days
node
34
OpenAI (training)
1
Resources
wandb-osh — pip install wandb-osh · libregistry