Skip to content

Instantly share code, notes, and snippets.

View Delaunay's full-sized avatar

Setepenre Delaunay

  • Montréal
View GitHub Profile
@Delaunay
Delaunay / pool.cpp
Last active April 11, 2018 11:58
Simple Pool Implementation (gcc 8, C++2a)
#include <thread>
#include <mutex>
#include <tuple>
#include <list>
#include <memory>
namespace pool{
namespace internal {
template<typename T>
@Delaunay
Delaunay / ImageNet_HDF5.py
Created December 21, 2018 16:03
HDF5 POC
import torchvision
import torchvision.transforms as transforms
import time
import torch
import os
import h5py
import numpy as np
from MixedPrecision.tools.stats import StatStream
@Delaunay
Delaunay / log.err
Last active February 25, 2019 23:28
HIP_DB=3 HCC_SERIALIZE_KERNEL=0x6 python test/test_cuda.py TestCuda.test_multinomial_invalid_probs_cuda > log.out
HIP_DB=0x3 [api+sync]
hip-api pid:22173 tid:1:HIP initialized short_tid#1 (maps to full_tid: 0x7fd84c378740)
hip-sync pid:22173 tid:1:locking criticalData=0x7fd7ee7da798 for ctx:0x7fd7ee7da780.dev:0..
hip-sync pid:22173 tid:1: addStream: stream:0.0
hip-sync pid:22173 tid:1:created ctx with defaultStream=0x7fd7eee38670 (stream:0.0)
hip-sync pid:22173 tid:1:auto-unlocking criticalData=0x7fd7ee7da798 for ctx:0x7fd7ee7da780.dev:0...
hip-sync pid:22173 tid:1:pid=22173 <ihipInit> g_numLogicalThreads=4
<<hip-api pid:22173 tid:1.1 hipGetDeviceCount (0x7ffcaee0a1c4) @370289587147796
hip-api pid:22173 tid:1.1 hipGetDeviceCount ret= 0 (hipSuccess)>> +3657 ns
# I setup my docker runner to cache those directories
# So the environments are only updated when different
variables:
XDG_CACHE_HOME: "/cache/pip"
PIP_CACHE_DIR: "/cache/pip"
OLYMPUS_DATA_PATH: "/cache/data"
ENV_CACHE_DIR: "/cache/env"
stages:
- tests
@Delaunay
Delaunay / mongod.py
Created August 2, 2022 15:39
Run MongoDB inside python for integration testing
from dataclasses import dataclass
import tempfile
import os
import subprocess
import traceback
import logging
from contextlib import contextmanager
import time
from multiprocessing import Manager, Process
@Delaunay
Delaunay / GKGameplayCueNotify_ActorExample.cpp
Created November 13, 2022 02:25
GKGameplayCueNotify_ActorExample
// BSD 3-Clause License Copyright (c) 2022, Pierre Delaunay All rights reserved.
#include "GKGameplayCueNotify_ActorExample.h"
void AGKGameplayCueNotify_ActorExample::ReuseAfterRecycle() {
AGameplayCueNotify_Actor::ReuseAfterRecycle();
OnReuseAfterRecycle();
}
@Delaunay
Delaunay / GKFogOfWarPawn.patch
Created April 22, 2023 15:04
GKFogOfWarPawn.patch
diff --git a/Source/GKFogOfWar/Public/GKFogOfWarPawn.h b/Source/GKFogOfWar/Public/GKFogOfWarPawn.h
index b7d940c..33eda34 100644
--- a/Source/GKFogOfWar/Public/GKFogOfWarPawn.h
+++ b/Source/GKFogOfWar/Public/GKFogOfWarPawn.h
@@ -8,13 +8,16 @@
// Unreal Engine
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
+#include "Net/UnrealNetwork.h"
@Delaunay
Delaunay / llama2.sh
Last active October 2, 2023 15:55
Run LLAMA2 on a Slurm cluster
#!/bin/bash
#
# Assume you have conda installed
# Clone the LLAMA code and create a new environment
#
# Usage:
#
# sbatch --ntasks-per-node=1 --mem=32G llama2.sh llama-2-7b-chat
# sbatch --ntasks-per-node=2 --mem=64G llama2.sh llama-2-13b-chat
@Delaunay
Delaunay / client.py
Last active October 2, 2023 17:45
Run a LLAMA2 inference server on slurm
import json
import subprocess
import random
import openai
def get_slurm_job_by_name(name):
command = ["squeue", "-h", f"--name={name}", "--format=\"%A %j %T %P %U %k %N\""]
output = subprocess.check_output(command, text=True)
_defaults:
max_duration: 600
voir:
options:
stop: 60
interval: "1s"
_torchvision:
inherits: _defaults
definition: ../benchmarks/torchvision