Skip to content

Instantly share code, notes, and snippets.

import os
import fsspec
import click
import huggingface_hub as hf_hub
from time import perf_counter
from braceexpand import braceexpand
import multiprocessing as mp
from tqdm import tqdm
@nousr
nousr / results.json
Last active October 20, 2022 02:44
vit-h-14 embeddings sanity check
[
{
"caption": "View Over Pyrenees Mountains, Spain",
"url": "https://static1.bigstockphoto.com/thumbs/0/0/1/large2/100000799.jpg"
},
{
"caption": "Mountain landscape with deer and forest at sunset",
"url": "https://cdn.xxl.thumbs.canstockphoto.com/vector-illustration-of-mountain-landscape-with-deer-and-forest-at-sunset-clip-art-vector_csp56740268.jpg"
},
{
2022-10-08 03:30:04 1922586752 img_emb_0000.npy
2022-10-08 03:57:15 1920735360 img_emb_0022.npy
2022-10-08 03:28:48 1921157248 img_emb_0044.npy
2022-10-08 03:28:30 1922345088 img_emb_0066.npy
2022-10-08 03:26:16 1922654336 img_emb_0088.npy
2022-10-08 03:31:30 1922353280 img_emb_0110.npy
2022-10-08 03:28:30 1922943104 img_emb_0132.npy
2022-10-08 03:26:54 1923940480 img_emb_0154.npy
2022-10-08 03:31:19 1922218112 img_emb_0176.npy
2022-10-08 03:28:39 1922607232 img_emb_0198.npy
import argparse, os, sys, glob
import torch
import torch.nn as nn
import numpy as np
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
from itertools import islice
from einops import rearrange
from torchvision.utils import make_grid
@nousr
nousr / out.txt
Created September 22, 2022 21:59
Loading intelmpi version 2021.4.0
hosts gpu-st-p4d-24xlarge-340
go 1
/opt/slurm/bin/srun: line 27: [: too many arguments
cpu-bind=MASK - gpu-st-p4d-24xlarge-340, task 0 0 [40118]: mask 0xffffffffffff set
/usr/lib64/python3.7/runpy.py:125: RuntimeWarning: 'clip_retrieval.clip_inference.worker' found in sys.modules after import of package 'clip_retrieval.clip_inference', but prior to execution of 'clip_retrieval.clip_inference.worker'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
/usr/lib64/python3.7/multiprocessing/semaphore_tracker.py:144: UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
len(cache))
wandb:
@nousr
nousr / pretrained_dreambench.py
Created August 2, 2022 23:00
A working example that will make a caption/image table and upload it to wandb for evaluation.
import torch
from dream_bench import benchmark, DreamBenchConfig
def mock_harness(conditioning_args):
caption = conditioning_args["caption.txt"]
tokenized_text = conditioning_args["tokenized_text.npy"]
img_emb = conditioning_args["prior_image_embedding.npy"]
return torch.rand((img_emb.shape[0], 3, 256, 256))
Loading intelmpi version 2021.4.0
go 8
compute-od-gpu-dy-p4d-24xlarge-8 compute-od-gpu-dy-p4d-24xlarge-9 compute-od-gpu-dy-p4d-24xlarge-10 compute-od-gpu-dy-p4d-24xlarge-11 compute-od-gpu-dy-p4d-24xlarge-12 compute-od-gpu-dy-p4d-24xlarge-13 compute-od-gpu-dy-p4d-24xlarge-14 compute-od-gpu-dy-p4d-24xlarge-15
myuser=zion
COUNT_NODE=8
LD_LIBRARY_PATH = /opt/aws-ofi-nccl/lib:/opt/amazon/efa/lib64:/usr/local/cuda-11.0/efa/lib:/usr/local/cuda-11.0/lib:/usr/local/cuda-11.0/lib64:/usr/local/cuda-11.0:/opt/nccl/build/lib:/opt/aws-ofi-nccl-install/lib:/opt/aws-ofi-nccl/lib:/opt/intel/mpi/2021.4.0//libfabric/lib:/opt/intel/mpi/2021.4.0//lib/release:/opt/intel/mpi/2021.4.0//lib:/opt/intel/mpi/2021.4.0/libfabric/lib:/opt/intel/mpi/2021.4.0/lib/release:/opt/intel/mpi/2021.4.0/lib
PATH = /opt/amazon/efa/bin:/opt/intel/mpi/2021.4.0//libfabric/bin:/opt/intel/mpi/2021.4.0//bin:/opt/intel/mpi/2021.4.0/libfabric/bin:/opt/intel/mpi/2021.4.0/bin:/fsx/nousr/dalle2/bin:/opt/amazon/openmpi/bin/:/opt/amazon/efa/bin/:/home/zion/.
This file has been truncated, but you can view the full file.
Loading intelmpi version 2021.4.0
go 8
compute-od-gpu-dy-p4d-24xlarge-8 compute-od-gpu-dy-p4d-24xlarge-9 compute-od-gpu-dy-p4d-24xlarge-10 compute-od-gpu-dy-p4d-24xlarge-11 compute-od-gpu-dy-p4d-24xlarge-12 compute-od-gpu-dy-p4d-24xlarge-13 compute-od-gpu-dy-p4d-24xlarge-14 compute-od-gpu-dy-p4d-24xlarge-15
myuser=zion
COUNT_NODE=8
LD_LIBRARY_PATH = /opt/aws-ofi-nccl/lib:/opt/amazon/efa/lib64:/usr/local/cuda-11.0/efa/lib:/usr/local/cuda-11.0/lib:/usr/local/cuda-11.0/lib64:/usr/local/cuda-11.0:/opt/nccl/build/lib:/opt/aws-ofi-nccl-install/lib:/opt/aws-ofi-nccl/lib:/opt/intel/mpi/2021.4.0//libfabric/lib:/opt/intel/mpi/2021.4.0//lib/release:/opt/intel/mpi/2021.4.0//lib:/opt/intel/mpi/2021.4.0/libfabric/lib:/opt/intel/mpi/2021.4.0/lib/release:/opt/intel/mpi/2021.4.0/lib
PATH = /opt/amazon/efa/bin:/opt/intel/mpi/2021.4.0//libfabric/bin:/opt/intel/mpi/2021.4.0//bin:/opt/intel/mpi/2021.4.0/libfabric/bin:/opt/intel/mpi/2021.4.0/bin:/fsx/nousr/dalle2/bin:/opt/amazon/openmpi/bin/:/opt/amazon/efa/bin/:/home/zion/.vscode
#!/bin/bash
#SBATCH --partition=compute-od-gpu
#SBATCH --job-name=intelmpi_test
#SBATCH --nodes 4
#SBATCH --ntasks-per-node 1
#SBATCH --cpus-per-gpu=6
#SBATCH --gres=gpu:8
#SBATCH --output=%x_%j.out
#SBATCH --comment "Key=Monitoring,Value=ON"
#SBATCH --exclusive
import os
import click
import clip
import numpy as np
from PIL import Image
import torch
import wandb
from dalle2_pytorch import (
DALLE2,