Skip to content

Instantly share code, notes, and snippets.

View ResidentMario's full-sized avatar

Aleksey Bilogur ResidentMario

View GitHub Profile
@ResidentMario
ResidentMario / build_gpu_image_on_ec2.sh
Last active February 13, 2024 13:55
EC2 GPU Image Builder Script
#!/bin/bash
# https://gist.github.com/ResidentMario/9f41ac480f9efbf2ff1d05d450c29470
set -ex
if [[ -z "$EC2_SSH_KEY_NAME" ]]; then
echo "EC2_SSH_KEY_NAME environment variable not set, exiting." && exit 1
fi
if [[ -z "$EC2_SSH_KEY_FILEPATH" ]]; then
echo "EC2_SSH_KEY_FILEPATH environment variable not set, exiting." && exit 1
fi
@ResidentMario
ResidentMario / devenv_settings.md
Last active August 11, 2023 02:56
Shell settings

This gist contains my development environment settings. The idea is that I should be able to reproduce my development environment from scratch.

@ResidentMario
ResidentMario / .block
Last active February 13, 2023 21:01
Sankey webmap
license: mit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import os
import torch
import torch.distributed as dist
from torch.multiprocessing import Process
def run(rank, size):
""" Distributed function to be implemented later. """
# collective ops are performed against groups
group = dist.new_group([0, 1, 2])
import json
import random
import time
import os
from spell.serving import BasePredictor
import spell.serving.metrics as m
class Predictor(BasePredictor):
# import torch
from torch.utils.data import Dataset, DataLoader
import torchvision
import pandas as pd
from PIL import Image
import time
import argparse
@ResidentMario
ResidentMario / go.mod
Last active July 14, 2021 21:21
Create Azure machine
module go-azure
go 1.16
require (
github.com/Azure/azure-sdk-for-go v55.4.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.19 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.7 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
+ [[ ! -d /tmp/tvm ]]
+ git clone --recursive https://github.com/apache/tvm /tmp/tvm
Cloning into '/tmp/tvm'...
remote: Enumerating objects: 85, done.
remote: Counting objects: 100% (85/85), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 95489 (delta 26), reused 8 (delta 6), pack-reused 95404
Receiving objects: 100% (95489/95489), 36.67 MiB | 33.38 MiB/s, done.
Resolving deltas: 100% (69864/69864), done.
Submodule 'dlpack' (https://github.com/dmlc/dlpack) registered for path '3rdparty/dlpack'