This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Karim Abou Zeid | |
from typing import Any | |
import lightning.pytorch as pl | |
import torch | |
from lightning.pytorch.callbacks.callback import Callback | |
from lightning.pytorch.utilities.exceptions import MisconfigurationException | |
from lightning.pytorch.utilities.types import STEP_OUTPUT | |
from typing_extensions import override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S uv run --script | |
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "rich", | |
# ] | |
# /// | |
import argparse | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
torchrun \ | |
--nproc-per-node=$SLURM_GPUS_ON_NODE\ | |
--nnodes=$SLURM_JOB_NUM_NODES \ | |
--node_rank=$SLURM_NODEID \ | |
--master_addr=$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n1) \ | |
--master_port=$(expr 10000 + $(echo -n $SLURM_JOBID | tail -c 4)) \ |
OlderNewer